In an wired article the FBI spelled the way in which they "hacked" the TOR network. Here some of the things they were able to do:
Hacking into a popular TOR server.
Having that server offer up what looked like an error message screen.
Embedding malware in that error message that executed on...