NSA XKeyScore Source Code [+]


SUBMITTED BY: Guest

DATE: July 9, 2014, 1:57 a.m.

FORMAT: Text only

SIZE: 4.1 kB

HITS: 785

  1. #############################################################################
  2. // START_DEFINITION
  3. /*
  4. The fingerprint identifies sessions visiting the Tor Project website from
  5. non-fvey countries.
  6. */
  7. fingerprint('anonymizer/tor/torpoject_visit')=http_host('www.torproject.org')
  8. and not(xff_cc('US' OR 'GB' OR 'CA' OR 'AU' OR 'NZ'));
  9. // END_DEFINITION
  10. // START_DEFINITION
  11. /*
  12. These variables define terms and websites relating to the TAILs (The Amnesic
  13. Incognito Live System) software program, a comsec mechanism advocated by
  14. extremists on extremist forums.
  15. */
  16. $TAILS_terms=word('tails' or 'Amnesiac Incognito Live System') and word('linux'
  17. or ' USB ' or ' CD ' or 'secure desktop' or ' IRC ' or 'truecrypt' or ' tor ');
  18. $TAILS_websites=('tails.boum.org/') or ('linuxjournal.com/content/linux*');
  19. // END_DEFINITION
  20. // START_DEFINITION
  21. /*
  22. This fingerprint identifies users searching for the TAILs (The Amnesic
  23. Incognito Live System) software program, viewing documents relating to TAILs,
  24. or viewing websites that detail TAILs.
  25. */
  26. fingerprint('ct_mo/TAILS')=
  27. fingerprint('documents/comsec/tails_doc') or web_search($TAILS_terms) or
  28. url($TAILS_websites) or html_title($TAILS_websites);
  29. // END_DEFINITION
  30. // START_DEFINITION
  31. requires grammar version 5
  32. /**
  33. * Aggregate Tor hidden service addresses seen in raw traffic.
  34. */
  35. mapreduce::plugin('anonymizer/tor/plugin/onion') =
  36. immediate_keyword(/(?:([a-z]+):\/\/){0,1}([a-z2-7]{16})\.onion(?::(\d+)){0,1}/c : c++
  37. includes: {{
  38. #include <boost/lexical_cast.hpp>
  39. }}
  40. proto: {{
  41. message onion_t {
  42. required string address = 1;
  43. optional string scheme = 2;
  44. optional string port = 3;
  45. }
  46. }}
  47. mapper<onion_t>: {{
  48. static const std::string prefix = "anonymizer/tor/hiddenservice/address/";
  49. onion_t onion;
  50. size_t matches = cur_args()->matches.size();
  51. for (size_t pos=0; pos < matches; ++pos) {
  52. const std::string &value = match(pos);
  53. if (value.size() == 16)
  54. onion.set_address(value);
  55. else if(!onion.has_scheme())
  56. onion.set_scheme(value);
  57. else
  58. onion.set_port(value);
  59. }
  60. if (!onion.has_address())
  61. return false;
  62. MAPPER.map(onion.address(), onion);
  63. xks::fire_fingerprint(prefix + onion.address());
  64. return true;
  65. }}
  66. reducer<onion_t>: {{
  67. for (values_t::const_iterator iter = VALUES.begin();
  68. iter != VALUES.end();
  69. ++iter) {
  70. DB["tor_onion_survey"]["onion_address"] = iter->address() + ".onion";
  71. if (iter->has_scheme())
  72. DB["tor_onion_survey"]["onion_scheme"] = iter->scheme();
  73. if (iter->has_port())
  74. DB["tor_onion_survey"]["onion_port"] = iter->port();
  75. DB["tor_onion_survey"]["onion_count"] = boost::lexical_cast<std::string>(TOTAL_VALUE_COUNT);
  76. DB.apply();
  77. DB.clear();
  78. }
  79. return true;
  80. }});
  81. /**
  82. * Placeholder fingerprint for Tor hidden service addresses.
  83. * Real fingerpritns will be fired by the plugins
  84. * 'anonymizer/tor/plugin/onion/*'
  85. */
  86. fingerprint('anonymizer/tor/hiddenservice/address') = nil;
  87. // END_DEFINITION
  88. // START_DEFINITION
  89. appid('anonymizer/mailer/mixminion', 3.0, viewer=$ascii_viewer) =
  90. http_host('mixminion') or
  91. ip('128.31.0.34');
  92. // END_DEFINITION

comments powered by Disqus