Some enthusiastic supporter of Julian Assange wrote elsewhere: "Do you think Afghans and Iraqis should sue the US government for launching an illegal war?"
Afghans definitely should not, because there's no war that would be more legal than the Western intervention in Afghanistan. It is a rare case in the category of wars, covered by UN resolutions and international law (like this one and many others since.)
Of course, the whole concept of "launching" a war in Afghanistan (in 2001) is a pretty moot point considering that the country has been in an constant state of (civil) war for the past 30 years. In the 80's, the Soviets occupied it and Americans supported the (largely Islamic) resistance. Now, US, UK and NATO/ISAF forces occupy it (with UN backing) and resistance is by an unholy alliance of militant Islamists and drug lords.
Calling the UN-backed intervention "illegal" is not a statement of juridical facts, it is a statement for your preference to support bronze-age barbarism that the Taleban represents, instead of the possibly well-meaning but bureaucratic and ineffective UN, or Western democracies.
It is equally folly to say that if Western armed forces withdraw from the country, it would somehow "end" the war. No, the war would not end. The combatants would just take some other targets (for instance, people whose names were exposed by Julian Assange). And the war might spread to neighbouring countries. But one thing is sure, the war would not end there.
The idea that a war in Afghanistan or Iraq would end when the US, UK and NATO/ISAF forces leave is in my opinion very, very wrong, and perhaps "colonialist" would be a good characterization. To believe this idea, you must assume that Afghans and Iraqis are not real people who would be leading their own lives; they are just targets, subjects, proxies in a cultural war against Americans; if left alone, they will be quite irrelevant and the focus moves on the the next cause where Western powers can be blamed. In this viewpoint, if the Americans have lost a war, that is a great victory, and what happens to the proxies - for instance, the people in Afghanistan - is not material at all. They're not people, they're just tools for proving what a nice SWPL you are when you "oppose the war".
It is another matter whether the intervention in Afghanistan will achieve its long-term goals; some short-term goals have been achieved (after all, there are now probably tens or hundreds of thousands of girls who have been allowed to go to school and learn to read, for instance) but the country is not stable and peaceful at all.
Iraq is then a completely different point regarding legality. There the invaders had no UN backing, and the WMD hype was made up when US and UK simply wanted attack and to get rid of Saddam Hussein. The American, British and other troops have committed atrocities in the course of war. However, when those who are fighting against the Americans and British commit atrocities, it is somehow "natural", it is an act of God, or in fact it is a fault of the Americans and needs to be added to the Iraq body count.
How come some people are not responsible for their own actions, and Americans are responsible for everything? Are they so much better and more important people that no one else needs to be accounted at all?
Finally, I'm slightly astonished to see well-educated Western people say Al-Qaida fighters are "defending" their country. First of all, much of Al-Qaida in Afghanistan is Arabs in a non-Arab country. They are defending an ideology, and that is an ideology that deserves to lose (much more so than the materialistic, reactionary but secular Western ideology).