Your understanding is senseless, you don't know a sh*t about what's this TTP group all about and you're comparing it with Hamas, can you understand simple things, TTP is fighting without any solid reason, their stance is disputed, some of them say, they want a True Islamic State, some say, they want US-Pak relations to be ceased, some say they are fighting because of Drone attacks, whatever the reasons they present, it makes them a Internal Rebellion, a insurgency, funded n supported by hostile Intelligence agencies.
On the other hand, Hamas is not your home-grown terrorist group, they consist of locals of the Country which you are occupying illegally, like Afghan Taliban are fighting US-NATO forces because they are aggressors, some of their actions can't be justified but then again, we have to see who started killing the innocents first and that's Illegal State of Israel.