TOP SECRET//COMINT//REL TO USA, FVEY # XKEYSCORE for Counter-CNE "Using the XKS CNE dataset and a DISGRUNTLEDDUCK fingerprint, we now see at least 21 TAO boxes with evidence of this intrusion set, most of which are associated with projects aimed at Iran WMD targets." -- MHS, July 2010 March, 2011 [REDACTED] xks-cne@r1.r.nsa TOP SECRET//COMINT//REL TO USA, FVEY --- UNCLASSIFIED//FOUO ## Overall Classification The overall classification of this presentation is: TOP SECRET//COMINT//REL TO USA, FVEY UNCLASSIFIED//FOUO --- SECRET//COMINT//REL TO USA, FVEY ## What is XKEYSCORE? * A suite of software running on a Linux host * Classically, used for DNI processing, selection and survey * A distributed hierarchy of servers at field sites and headquarters * Extract and tag metadata & content from traffic * Servicing analyst queries and workflows * Web and programmatic front-ends SECRET//COMINT//REL TO USA, FVEY --- SECRET//COMINT//REL TO USA, FVEY ## What is XKEYSCORE? * A suite of software running on a Linux host * Classically, used for DNI processing, selection and survey * A distributed hierarchy of servers at field sites and headquarters * Extract and tag metadata & content from traffic * Servicing analyst queries and workflows * Web and programmatic front-ends SECRET//COMINT//REL TO USA, FVEY --- TOP SECRET//COMINT//REL TO USA, FVEY ## XKEYSCORE GUI ``` XK Metaviewer: shared by f610065: Category Hits at 67D - Mozilla Firefox File Edit View History Bookmarks Tools Help ic.gov https://xks-central.corp.nsa.iv.gov:8113/XKEYSCORE/search/standardSearch/searchHome wp Ethernet ESS1377: SIDToday for 1/24... | Ethernet - Wikipedia, the fre... | My Signatures | XK Metaviewer shared by ... | XKEYSCORE - For Analysts ... This system is audited for USSID 18 and Human Rights Act compliance TOP SECRET//COMINT//REL TO USA, AUS, CAN, GBR, NZL X-KEYSCORE Welcome [REDACTED] og Out Home Admin Users Search Workflow Central Results Fingerprints Statistics Map My Account XK Help Navigation SearchWizard CNE EmailAddresses Extracted Files Full Log DNI Keylogger Machine Information Network Information Registry Classic MultiSearch Classic A-M Alert BlackBerry CallLogs Category DNI Cisco Passwords DNS Document metadata Document tagging Email Addresses Extracted Files FullLog DNI Geo Info HTTP Activity KEParser Keylogger Logins and Passwords Histogram Grid Page 1 of 1 Clear Searcher Displaying 1- 1 of 1 Filter Fm Port Count Displaying 1 - 1 of 3 2804 174 shared by f810085 Category Hit... Help Actions Reports View MapView FILTERS ``` | Sigad | Active User | Casenotation | Full IP | To IP | Fm Port | To Port | Fm Country | Fm City (IP) | Fm Latitude | Fm Longti | To Country ( | To City (IP) | To L | |---------|-------------|--------------|---------|-------|---------|---------|------------|--------------|-------------|-----------|--------------|--------------|------| | US-967D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 2631 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | | US-967D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 1679 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | | US-967D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 3190 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | | US-987D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 1853 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | | US-967D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 1120 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | | US-967D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 1138 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | | US-967D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 1579 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | | US-987D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 7581 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | | US-967D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 3190 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | | US-967D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 1120 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | | US-967D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 1603 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | | US-967D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 1603 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | | US-987D | | UA2AA0DCB | 57[REDACTED] | 57[REDACTED] | 2304 | 3050 | FR | NEUILLYSUR | 48.88 | 2.27 | FR | NEUILLYSUR | 48 | ``` Page 1 of 6 Page Size: 30 (Max 200 rows per page) Displaying 1 - 30 of 174 saved_802197577093313 This system is audited for USSID 18 and Human Rights Act compliance TOP SECRET//COMINT//REL TO USA, AUS, CAN, GBR, NZL ``` TOP SECRET//COMINT//REL TO USA, FVEY --- TOP SECRET//COMINT//REL TO USA, FVEY ## Example Search * Let's try a search for suspicious stuff... http_activity search, 5-eyes defeat, look for fingerprints: ``` ndist/discovery/heuristic/BHAM/get_with_content or http/get/with_content ``` * While the search runs, some gotchas: * You choose where your query is run * Content and metadata age-off * Burden is on user/auditor to comply with USSID-18 or other rules * Geolocation based on IP TOP SECRET//COMINT//REL TO USA, FVEY --- SECRET//COMINT//REL TO USA, FVEY ## Search Results ``` XK Session Viewer - Mozilla Firefox File Edit Views History Bookmarks Tools Help ic.gov https://xks-central.corp.nsa.ic.gov:8443/XKEYSCORE/layouts/popOutLayout.jsp?pageTitle=Session Viewer&rowUrl=5621 This system is audited for USSID 18 and Human Rights Act compliance CLASSIFICATION: SECRET//COMINT//REL TO USA, AUS, CAN, GBR, NZL X-KEYSCORE C2C Session Viewer Session 15 of 17 Datetime | Case Notation | From IP | To IP | From Port | To Port | Protocol | Length 2011-04-11 08:47:44 | 3 441836 | 192[REDACTED] (Private Address | TO [REDACTED] Private Address | 4370 | 12468 | TCP | 224 | Formatter ASCII | Send to: Download Session | Mode: Snippet | Options | Search Content: Enter text to search Quick Clicks Session Attachments unknown text unknown_515.xww One-Click Searches Find fingerprint nd/discovery http/gc/with_content ndis/discovery Find traffic on 192[REDACTED] 10[REDACTED] Find application http//get/x-www-form-url Find proxy hash 0d0020f7 Find opposite side of sess 192[REDACTED]4307 10.[REDACTED] GET /?CAVIT HTTP/1.0 User-Agent: 62591C333F62DA7333FB2C02702B7BD2 Accept: */* Host: 10.[REDACTED]:12466 Content-Type: application/w-www-form-urlencoded Connection: Keep-Alive Reset from local: (1231) seq = 2662134980 This system is audited for USSID 18 and Human Rights Act compliance CLASSIFICATION: SECRET//COMINT//REL TO USA, AUS, CAN, GBR, NZL Done ``` Notes: * Strange User-Agent * Probably NOT CNE but definitely something non-standard * Content: maybe a HTTP tunnel for some weird protocol? * Reset from local... * Should we write a Fingerprint? SECRET//COMINT//REL TO USA, FVEY --- SECRET//COMINT//REL TO USA, FVEY ## Fingerprints and Appids * Useful for identifying classes of traffic or particular targets (for SIGDEV or collection): ``` mail/webmail/yahoo browser/cellphone/blackberry topic/s2B/chinese_missile ``` * appid – a contest, highest scoring appid wins * fingerprint – many fingerprints per session * microplugin – a fingerprint or appid that is relatively complex (e.g. extracts and databases metadata) SECRET//COMINT//REL TO USA, FVEY --- SECRET//COMINT//REL TO USA, FVEY ## Fingerprints and Appids (more) * Written in language called “GENESIS" (go genesis-language): ``` appid('encyclopedia/wikipedia', 2.0) = http_host('wikipedia' or 'wikimedia`); fingerprint('dns/malware/MalwareDomains') = dns_host('erofreex.info' or 'datayakoz.info' or 'erogirlx.info' or 'pornero.info' or ... ``` * If a fingerprint contains a schema definition, a search form automatically appears in the XKEYSCORE GUI * Power users can drop in to C++ to express themselves SECRET//COMINT//REL TO USA, FVEY --- SECRET//COMINT//REL TO USA, FVEY ## More about searches * Many different searches * Base search is **Full Log DNI** * Depending on traffic type, will generate searchable results for (example): | HTTP Activity | Network Information | GEO Info | | :------------------- | :------------------ | :----------- | | Extracted Files | Email Addresses | Registry | | Logins and Passwords | Document Metadata | Machine Info | * workflow – a user query that is run automatically usually every 24 hours SECRET//COMINT//REL TO USA, FVEY --- SECRET//COMINT//REL TO USA, FVEY ## XKEYSCORE Gotchas * Not all sites run latest XKEYSCORE software or fingerprints * fingerprint submission: * XKEYSCORE team weighs mission-worthiness of user fingerprints vs computational cost * Content and metadata ageoff SECRET//COMINT//REL TO USA, FVEY --- TOP SECRET//COMINT//REL TO USA, FVEY ## XKEYSCORE CNE * Lots of endpoint data flows into XKS * TAO (no ECIs), GCHQ (almost all) * Other limited flows include SIGINT Forensics Center, TAO STAT * XKEYSCORE works well for endpoint data * Sometimes the paradigm breaks (e.g. collected browser history file) TOP SECRET//COMINT//REL TO USA, FVEY --- TOP SECRET//COMINT//REL TO USA, FVEY ## XKEYSCORE CNE (more) * Payload types: ``` dirwalk, extracted file, system survey, network config, captured credentials, registry query, key logger, etc. ``` * Labeled `dnt_payload` in appid/fingerprint ontology * Let's look at some DANDERSPRITZ data... TOP SECRET//COMINT//REL TO USA, FVEY --- TOP SECRET//COMINT//REL TO USA, FVEY ## XKEYSCORE CNE (more) ``` XK Session Viewer - Mozilla Firefox File Edit View History Bookmarks Tools Help ic.gov https://xks-central.corp.nsa.ic.gov:8443/XKEYSCORE/layouts/popOutLayout.jsp?pageTitle=Session+Viewer&rowUrl=%2FXKEYSCORE%2F%2Fmetaviewer$ This system is audited for US SID 18 and Human Rights Act compliance CLASSIFICATION: TOP SECRET//COMINT//REL TO USA, AUS, CAN, GBR, NZL X-KEYSCORE C2C Session Viewer Session 56 of 703 Datetime Case Notation From IP To IP From Port To Port Protocol Length 2011-04-13 02:06:12 CC.WYUDCCAACDTD 10074 Session | Header (3) | Meta (4) Format: DNT_PAYLOAD | Send to: Download Session | Mode: Snippet | Options | Search Content | enter text to search Clear Quick Clicks Session One-Click Searches Find fingerprint exfil/experimental/proces Find traffic on Find application dnt_payload/processlist Find opposite side of sess o :0 -> :0 PAYLOAD XML lsass.cxe svchost.exe svchost.exe svchost.exe svc..exe svchost.exe svchost.exe ccSvcHst.exe spoolsv.exe msdtc.exe NWRCS.EXE svchost.exe HPLaserJetService.exe HPSIsvc.exe KRPRDU-1.EXE svchost.exe MHOSTSVC.EXE svchost.exe svchost.exe fltvscon.exe svchost.exe VMwareService.exe svchost.exe UIHSTMP7.FXP SIDRMP3.FXP wmiprvse.exe explorer.exe hncau.exe VMwareTray.exe VMwareUser.exe jusched.exe ccfmon.exe kpsservice.exe conime.exe dwwm.exe logon.scr csrss.exe winlogon.exe csrss.exe winlogon.exe csrss.exe winlogon.exe csrss.exe winlogon.exe This system is audited for USSID 18 and Human Rights Act compliance CLASSIFICATION: TOP SECRET//COMINT//REL TO USA, AUS, CAN, GBR, NZL Done ``` TOP SECRET//COMINT//REL TO USA, FVEY --- TOP SECRET//COMINT//REL TO USA, FVEY ## XKEYSCORE CNE (more) * Recent Developments * Upgrade of XKEYSCORE CNE * Keyloggers: keylogger/perfect/extension * PCAP Reingestion * Router Redirection TOP SECRET//COMINT//REL TO USA, FVEY --- TOP SECRET//COMINT//REL TO USA, FVEY ## Counter CNE Methodology (refer to Counter CNE Resources slide...) * Hypothesis/research-driven * "Could South Korean CNE be using similar selectors to FVEY CNE?" * "What keywords could be used to find keyloggers ("example: keylog OR keystroke") * Bogus or Unusual Traffic * HTTP GET with content (example in this presentation) * HTTP POST at odd hours (from Russia 0200-0359Z) * Funky user agents * Known-Host or User driven (e.g. drop sites) * XKEYSCORE is GOOD at these kinds of things TOP SECRET//COMINT//REL TO USA, FVEY --- TOP SECRET//COMINT//REL TO USA, FVEY ## CNE-Specific * Registry searches (e.g. SIMBAR) * Fused Active/Passive search * common selectors * document hashes * Known Processes (malicious executables or code) * ... Let's enhance the process list appid * map-reduce within CNE cluster using GENESIS calls TOP SECRET//COMINT//REL TO USA, FVEY --- TOP SECRET//COMINT//REL TO USA, FVEY ## XKEYSCORE Doesn't Do... * ... at all (well, automatically, anyways) * Paired traffic heuristic-based approach * HTTP[S] imbalance (e.g. GET without response) * IP/DNS mismatch* * ... on an automatic basis * Network or host characterization * Changes in IP/DNS mapping over time * Changes over time in malware comms TOP SECRET//COMINT//REL TO USA, FVEY --- TOP SECRET//COMINT//REL TO USA, FVEY ## Counter CNE Resources * How to Discover Intrusions [using XKEYSCORE] by [REDACTED] and [REDACTED] (paper) * MHS INDEX - Foreign CNE Discovery Page * https://wiki.itd.nsa/wiki/Foreign_CNE_Discovery * CSEC and GCHQ - DONUT (unknown protocols): * https://tiso.sigint.cse/snipehunt/index.php/DONUT * GCHQ Discovery Posted some Research of Detecting Man-on-the-Side Attacks: * https://tiso.sigint.cse/snipehunt/index.php/MOTS * GCQH Disco Team posts POC's for different Intrusions and some Details: * https://wiki.gchq/index.php/Discovery * The GCHQ DISCO team also posts Discovery Theories they run once a week: * https://wiki.gchq/index.php/Discovery_Afternoons * XKEYSCORE Fingerprints TOP SECRET//COMINT//REL TO USA, FVEY --- TOP SECRET//COMINT//REL TO USA, FVEY ## Success Story - MHS INDEX Using TAO-obtained Iranian implant encryption keys, inline decrypt using XKS microplugin - IRGC-QF keylogger data! ``` XK Session Viewer - Mozilla Firefox File Edit View History Bookmarks Tools Help https://xks-central.corp.nsa.ic.gov:8443/XKEYSCORE/layouts/popOutLayout.jsp?pageTitle=Session Viewer&rowUrl=%2FXKEYSCORE%2F%2Fmetaview This system is audited for USSID 18 and Human Rights Act compliance CLASSIFICATION: TOP SECRET//COMINT//REL TO USA, AUS, CAN, GBR, NZL X-KEYSCORE C2C Session Viewer Session 15 of 70 | Datetime | Case Notation | From IP | To IP | From Po | To Port | Protoc | Length | 2011-03-28 19:51:28 | IRS1014 | 78[REDACTED] (Iran) | 174[REDACTED] United States | 42325 | 80 | tcp | 320 Session | Header (3) | Attachments (2) | Meta (9) Formatter: AUTO | Send to: Download Session | Mode: Snippet | Options | Search Content: Exter text to search Quick Clicks Session Attachments unknown text keylogger.txt unknown_1931.x-www- One-Click Searches Find fingerprint ntoc/ntocg/malware/amulet botnet/AMULETSTELLAR/k Find traffic on 78.38.110.163 174.132.180.34 Find application mail/webmail/yahoo Find proxy hash c8b0d875 Find opposite side of session 78[REDACTED]:42325 -> 174.[REDACTED] Download this from XKEYSCORE keylogger.txt FORMATTER AUTO Virus scan results Clean Using TXT formatter << (2 unread) Yahoo! Mail, mehrab.raisi - Mozilla Firefox >> [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] [] << The page at http://us.mg4.mail.yahoo.com says: >> [] << (1 unread) Yahoo! Mail, [REDACTED] - Mozilla Firefox >> [][][][Backspace]sa[Backspace][Backspace][][Right Alt]...[Space]...[Backs << Yahoo! Messenger >> [Backspace]sara[Space][Backspace]ce[REDACTED] << (0 unread) Yahoo! Mail, mehrab.raisi - Mozilla Firefox >> [] [] [] [] [] cloo[Down] [] []5250024300 This system is audited for USSID 18 and Human Rights Act compliance CLASSIFICATION: TOP SECRET//COMINT//REL TO USA, AUS, CAN, GBR, NZL Done xks-central.corp.nsa.ic.gov:8443 ``` * Login TOP SECRET//COMINT//REL TO USA, FVEY --- TOP SECRET//COMINT//REL TO USA, FVEY ## Points of Contact * MHS Index Team * [REDACTED] : [REDACTED]@nsa.ic.gov * CES/TRANGRESSION * [REDACTED] : [REDACTED]@nsa.ic.gov * [REDACTED] : [REDACTED]@nsa.ic.gov * NSA/Countering Foreign Intelligence * [REDACTED] : [REDACTED]@nsa.ic.gov * NTOC ?? * XKEYSCORE * [REDACTED],[REDACTED] : xks-cne@r1.r.nsa TOP SECRET//COMINT//REL TO USA, FVEY