You've found the crown jewels - a database dump, confidential documents, or source code. Now you need to get it out. Data exfiltration is the art of extracting data from a compromised network while evading detection.
In real penetration tests, you might just grab a screenshot of sensitive data. But for red team operations or demonstrating data breach impact, actual exfiltration proves the threat is real.
Engagement Scope
Identifying Valuable Data
Know what to look for:
- Databases: Customer data, credentials, financial records
- Source Code: Proprietary applications, configs with secrets
- Documents: Contracts, HR files, strategic plans
- Credentials: Password files, SSH keys, certificates
- Email: Communication, attachments
HTTP/HTTPS Exfiltration
HTTP is usually allowed through firewalls. HTTPS adds encryption, making inspection harder.
Chunked Exfiltration
DNS Exfiltration
DNS is rarely blocked and often unmonitored. Data is encoded in subdomain queries that your DNS server captures.
DNS is Sneaky
ICMP Exfiltration
Ping packets can carry data in the payload. Often allowed through firewalls for troubleshooting.
SMB/File Share Exfiltration
Cloud Service Exfiltration
Legitimate cloud services blend with normal traffic and are rarely blocked.
Leave No Trace
Email Exfiltration
Encryption Before Exfiltration
Always Encrypt
Steganography
Hide data inside innocent-looking files like images.
Evading Detection
- Timing: Exfiltrate slowly during business hours
- Encryption: Prevent content inspection
- Common Protocols: Use HTTP, DNS, HTTPS
- Chunking: Small packets blend with normal traffic
- Legitimate Services: Cloud storage, email
- Encoding: Base64, hex to avoid pattern matching
Think Like a Defender
Data Exfiltration Methodology
Exfiltration Process
Knowledge Check
Challenges
Key Takeaways
- Always get explicit permission before exfiltrating data
- HTTP/HTTPS is usually allowed and blends with normal traffic
- DNS exfiltration is stealthy - rarely blocked or monitored
- Encrypt data before exfiltration to evade DLP
- Chunk large files and transfer slowly to avoid detection
- Cloud services provide legitimate-looking channels
- Clean up staged files and logs after exfiltration