Some slides on a way to do this: http://prezi.com/p5et9yawg2c6/ip-packet-staining/
Their solution was to re-route traffic to a package management device which clamps on a stain. Ipv6 makes this easy, if the traffic is Ipv4 they tunnel it inside Ipv6 with the stain header in Destination Option header.
Not sure how you would prevent this, besides the obvious answer (dont visit terrorist forums). Jondonym routing traffic through 3 mix servers might help so long as they don't stain your traffic at source by compromising your system. Making your own Tor bridge node is another solution to at least have some sort of safe entrance into the network. Seems they are unwilling to exploit relay nodes and bridges in the leaked slides.
If it was packet level it would likely be in the IP headers, I don't imagine it would be that difficult to rewrite the packets with optional fields and then put a token in the optional headers.
- It's called "User Agent staining" - "Each stain is visible in passively collected SIGINT and is stamped into every packet, which enables all the events from that stained machine to be brought back together to recreate a browsing session."
I'm wondering if they're not staining the browser user-agent string itself, but somehow modifying another part of the browser fingerprint (e.g., any of the things listed at https://panopticlick.eff.org/index.php?action=log&js=yes). If it's in "every packet", it would have to be a piece of info that is always sent by the browser.