Recently, Taliban in Pakistan executed two suspected spies, using explosives. They attached explosives to the men, and blew them up in front of local villagers. Normally they just shoot people, slit their throats, or behead them. But these are desperate times. Uncertainty is a powerful weapon, and it's terrifying the Taliban. The people must stop supplying information to the infidels. But in the Pakistani tribal territories, near the Afghan border, Taliban and al Qaeda leaders continue a seemingly futile hunt for the spies who are telling the Americans where the big shots are. In last two years, over a hundred Hellfire missiles, launched from Predator and Reaper UAVs, have wiped out a large (about half) chunk of the terrorist leadership. In the trade, this is known as a "decapitation" (just kill the leadership) strategy.
In response, the Taliban and al Qaeda have seized and executed over a hundred local men (and a few women), for being American spies. Most of these victims were innocent. They were just in the wrong place, at the wrong time, and looked suspicious to the wrong people. Some of those killed may have been spies, but most likely for other tribes, or Pakistani or Afghan intelligence services. Lots of people hire informants in the tribal regions. Some locals are working for the Americans, but it appears that the UAV targeting information comes from a variety of sources. Some of them are electronic, some are the video from the UAVs overhead, and some from the Afghan, Pakistani and tribal spies.
The U.S. has arrangements with all three sources to obtain needed data. Rewards, gifts or "bonuses" are provided as needed. The tribal informants will rat out an al Qaeda leader if the guy has committed some harm to the informant's tribe. Al Qaeda has a long history of such bad behavior, and the tribesmen never forget. When the Americans come by, offering cash for the opportunity to settle some tribal grudge with an al Qaeda big shot, who can pass up such a deal? Same drill with Taliban leaders, who also tend to be tribal leaders, and all tribes have feuds with other tribes, as well as internal disputes.
There are other ways to find terrorist targets in the tribal territories. One of the more powerful methods involve the use of databases and data mining software. The U.S. has been collecting information on the tribes (in general, as well as individuals) for decades, and has acquired and developed software that can sort out who is who, and who is out to get who, in the tribal territories. The U.S. Army Special Forces has lots of operators (more than the CIA or State Department) who speak the local languages and can organize and run the informant networks to find the targets. The CIA has also hired private contractors to run informant networks in the territories. Thus selected targets usually have confirmation coming from a variety of sources.
You have to be careful that some guy, who just wants to get a Hellfire to take out a personal enemy, doesn't con you. This rarely happens, mainly because there are usually multiple intel "indicators" putting the cross hairs on the terrorist leader you really want. Thus you need Special Forces involved, as these are guys who not only speak the language, but understand the culture. The data mining software is also culturally aware, with special filters for different tribes and cultures (the Arab tribes of Anbar don't play by the same rules as the Pushtun tribes of Waziristan).
The pattern analysis has reached the point where combinations of activities caught by the vidcams, electronic surveillance and informants on the ground, often indicates where terrorists are. Closer scrutiny often identifies individuals, or known terrorist groups. Then the Hellfires are put to work. So, in the end, the al Qaeda and Taliban efforts to find the people who are spying on them is futile. It's not individual spies that are providing the deadly information, but a collection of live, and machine, operatives. Going after that with guns is like trying to kill a blizzard with an AK-47. You will kill some snowflakes, but you still get buried.