Skip to content

Commit 4ae3cd0

Browse files
author
RTOSploit
committed
feat: rename exploits to vulnerability scanners, rewrite reporting, fix CLI bugs
- Rename exploits/ → scanners/ with ScannerModule, ScanResult, ScanTarget - CLI: rtosploit scan-vuln (list, info, check, run) - Reporting: add FuzzCampaignStats, CoverageStats, PeripheralSummary to reports - SARIF: fuzzStats, coverageStats, peripheralSummary in run properties - HTML: fuzzing campaign, coverage, peripheral detection sections - Triage: 3-tier classification (CFSR, StopReason, fallback) for Unicorn crashes - Fix: --engine unicorn no longer requires --machine - Fix: peripheral detection import in CI pipeline - Fix: load_elf caps flat blob at 16MB to avoid 536MB allocations - Add vulnerable test firmware for fuzzing validation - 1550 tests passing
1 parent 963cedb commit 4ae3cd0

60 files changed

Lines changed: 1474 additions & 611 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ cargo test --workspace
3939
- Rust: use `cargo fmt` and `cargo clippy`
4040
- Keep imports sorted (stdlib, third-party, local)
4141

42-
## Adding Exploit Modules
42+
## Adding Vulnerability Scanner Modules
4343

44-
1. Create `rtosploit/exploits/<rtos>/mymodule.py`
45-
2. Extend `ExploitModule` ABC — implement `check()`, `exploit()`, `cleanup()`, `requirements()`
46-
3. Add tests to `tests/unit/test_<rtos>_exploits.py`
44+
1. Create `rtosploit/scanners/<rtos>/mymodule.py`
45+
2. Extend `ScannerModule` ABC — implement `check()`, `exploit()`, `cleanup()`, `requirements()`
46+
3. Add tests to `tests/unit/test_<rtos>_scanners.py`
4747
4. If the module has a CVE, add it to `rtosploit/cve/bundled_cves.json`
4848
5. Submit PR
4949

50-
See [Writing Exploits](docs/writing-exploits.md) for the full API reference.
50+
See [Writing Scanners](docs/writing-scanners.md) for the full API reference.
5151

5252
## Adding VulnRange Labs
5353

@@ -75,7 +75,7 @@ Edit `rtosploit/cve/bundled_cves.json` and add entries following the existing fo
7575
}
7676
```
7777

78-
Set `has_exploit: true` if there's a corresponding exploit module in `rtosploit/exploits/`.
78+
Set `has_exploit: true` if there's a corresponding scanner module in `rtosploit/scanners/`.
7979

8080
## Project Structure
8181

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<a href="#installation"><img src="https://img.shields.io/badge/python-3.10%2B-blue?logo=python&logoColor=white" alt="Python 3.10+"/></a>
88
<img src="https://img.shields.io/badge/tests-1528%20passing-brightgreen" alt="Tests"/>
99
<img src="https://img.shields.io/badge/license-Apache--2.0-orange" alt="License"/>
10-
<img src="https://img.shields.io/badge/exploits-15%20modules-red" alt="Exploits"/>
10+
<img src="https://img.shields.io/badge/scanners-15%20modules-red" alt="Vulnerability Scanners"/>
1111
</p>
1212

1313
<p align="center">
@@ -31,12 +31,12 @@ RTOSploit is a firmware security testing framework for embedded RTOS systems. It
3131
| RTOS fingerprint | Yes (strings + symbols) | Yes | N/A |
3232
| CVE correlation | Yes (59 bundled CVEs) | Yes | N/A |
3333
| Peripheral detection | Yes (6-layer engine) | Yes | N/A |
34-
| Exploit assessment | Yes (15 modules, static) | Yes | N/A |
34+
| Vulnerability scanning | Yes (15 modules, static) | Yes | N/A |
3535
| Payload/ROP generation | Yes | Yes | N/A |
3636
| Emulate and boot | No (needs matching machine) | Yes | Yes (model-free) |
3737
| Coverage-guided fuzzing | No | Yes (~3-5 exec/sec) | Yes (~200+ exec/sec) |
3838

39-
> **On real hardware firmware:** Static analysis, CVE correlation, exploit assessment, and payload generation work on any firmware binary. Emulation and fuzzing require either a matching QEMU machine or the Unicorn engine with Peripheral Input Playback (PIP), which drives all peripheral I/O from fuzz input without hardware models.
39+
> **On real hardware:** Static analysis, CVE correlation, vulnerability scanning, and payload generation work on any firmware binary. Emulation and fuzzing require either a matching QEMU machine or the Unicorn engine with Peripheral Input Playback (PIP), which drives all peripheral I/O from fuzz input without hardware models.
4040
4141
---
4242

@@ -49,7 +49,7 @@ RTOSploit is a firmware security testing framework for embedded RTOS systems. It
4949
5. [Quick Start](#quick-start)
5050
6. [Emulation Engines](#emulation-engines)
5151
7. [CLI Reference](#cli-reference)
52-
8. [Exploit Modules](#exploit-modules)
52+
8. [Vulnerability Scanners](#vulnerability-scanners)
5353
9. [Machine Configurations](#machine-configurations)
5454
10. [Configuration](#configuration)
5555
11. [CI/CD Integration](#cicd-integration)
@@ -68,7 +68,7 @@ Embedded RTOS firmware (FreeRTOS, ThreadX, Zephyr) runs on billions of devices
6868

6969
1. **Analyze** — fingerprint RTOS, version, MCU, heap allocator, MPU config, peripherals
7070
2. **Correlate CVEs** — match against 59 bundled vulnerabilities from NVD
71-
3. **Assess vulnerabilities** — run 15 exploit modules (heap corruption, MPU bypass, BLE overflows)
71+
3. **Assess vulnerabilities** — run 15 vulnerability scanners (heap corruption, MPU bypass, BLE overflows)
7272
4. **Generate payloads** — ARM Thumb2/RISC-V shellcode, ROP chains, protocol packets
7373
5. **Emulate** — boot firmware in QEMU (interactive) or Unicorn (high-speed)
7474
6. **Fuzz** — coverage-guided fuzzing with crash deduplication and interrupt injection
@@ -98,8 +98,8 @@ RTOSploit has two execution paths depending on the use case:
9898
┌─────────────────┼─────────────────┐
9999
▼ ▼ ▼
100100
┌──────────────┐ ┌─────────────┐ ┌──────────────┐
101-
│ Static │ │ CVE │ │ Exploit
102-
│ Analysis │ │ Correlation │ │ Assessment
101+
│ Static │ │ CVE │ │ Vulnerability
102+
│ Analysis │ │ Correlation │ │ Scanners
103103
│ │ │ │ │ │
104104
│ Fingerprint │ │ 59 bundled │ │ 15 modules │
105105
│ Heap detect │ │ CVEs from │ │ FreeRTOS (6) │
@@ -189,7 +189,7 @@ Works on any firmware binary — no QEMU, no symbols required.
189189

190190
### Vulnerability Assessment and Payload Generation
191191

192-
15 exploit modules that detect vulnerability patterns via static analysis and generate concrete artifacts.
192+
15 vulnerability scanner modules that detect vulnerability patterns via static analysis and generate concrete artifacts.
193193

194194
| Category | Count | Produces |
195195
|----------|-------|----------|
@@ -402,7 +402,7 @@ rtosploit fuzz -f real-product.elf --engine unicorn --timeout 300
402402
|---------|-------------|
403403
| `analyze` | Static firmware analysis (RTOS, heap, MPU, peripherals) |
404404
| `cve` | CVE correlation (`scan`, `search`, `update`) |
405-
| `exploit` | Vulnerability assessment (`list`, `info`, `check`, `run`) |
405+
| `scan-vuln` | Vulnerability scanning (`list`, `info`, `check`, `run`) |
406406
| `payload` | Shellcode and ROP generation (`shellcode`, `rop`) |
407407
| `emulate` | QEMU emulation with optional GDB |
408408
| `rehost` | Peripheral-aware rehosting (QEMU or Unicorn) |
@@ -419,7 +419,7 @@ Run `rtosploit <command> --help` for detailed options.
419419

420420
---
421421

422-
## Exploit Modules
422+
## Vulnerability Scanners
423423

424424
### FreeRTOS (6 modules)
425425

@@ -531,7 +531,7 @@ rtosploit/
531531
├── peripherals/ Peripheral modeling (HAL database, SVD, PIP handler, rehosting)
532532
├── fuzzing/ Fuzzing engine (corpus, mutator, crash reporter, Unicorn worker)
533533
├── coverage/ Coverage collection (AFL bitmap, FERMCov)
534-
├── exploits/ Exploit modules (FreeRTOS, ThreadX, Zephyr)
534+
├── scanners/ Vulnerability scanners (FreeRTOS, ThreadX, Zephyr)
535535
├── emulation/ QEMU orchestration (process, GDB, QMP, machines)
536536
├── cve/ CVE database and correlation
537537
├── payloads/ Shellcode and ROP generation
@@ -543,7 +543,7 @@ rtosploit/
543543
└── vulnrange/ CVE reproduction labs
544544
```
545545

546-
See [docs/writing-exploits.md](docs/writing-exploits.md) for the exploit module development guide.
546+
See [docs/writing-scanners.md](docs/writing-scanners.md) for the vulnerability scanner module development guide.
547547

548548
---
549549

@@ -555,7 +555,7 @@ See [docs/writing-exploits.md](docs/writing-exploits.md) for the exploit module
555555

556556
**Fuzzer reports 0 exec/sec** — Firmware may not boot. Try `rtosploit emulate` first to verify. For real hardware firmware, use `--engine unicorn`.
557557

558-
**Exploit check says "not_vulnerable"** — Modules assess binary patterns. A CVE match by version doesn't guarantee the vulnerable code path is present — the vendor may have backported fixes.
558+
**Scan check says "not_vulnerable"** — Modules assess binary patterns. A CVE match by version doesn't guarantee the vulnerable code path is present — the vendor may have backported fixes.
559559

560560
**Unicorn not available** — Install with `pip install unicorn`. QEMU mode works without it.
561561

USAGE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ rtosploit triage \
417417

418418
### Report Generation
419419

420-
Generate reports from collected crash and exploit data:
420+
Generate reports from collected crash and scan data:
421421

422422
```bash
423423
# Both SARIF and HTML

docs/architecture.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ flowchart TB
1818
analysis["Static Analysis\nfingerprint · heap · MPU · strings"]
1919
emulation["Emulation Layer\nQEMU orchestration · GDB · QMP"]
2020
fuzzer["Fuzzing Engine\nAFL bitmap · crash dedup · corpus"]
21-
exploits["Exploit Modules\nFreeRTOS · ThreadX · Zephyr"]
21+
scanners["Vulnerability Scanners\nFreeRTOS · ThreadX · Zephyr"]
2222
cve["CVE Intelligence\ndatabase · correlator · NVD sync"]
2323
end
2424
@@ -222,30 +222,30 @@ flowchart LR
222222

223223
---
224224

225-
## Exploit Module Architecture
225+
## Vulnerability Scanner Architecture
226226

227-
All exploit modules follow the `ExploitModule` abstract base class. The registry discovers them at runtime via Python's `importlib`.
227+
All scanner modules follow the `ScannerModule` abstract base class. The registry discovers them at runtime via Python's `importlib`.
228228

229229
```mermaid
230230
classDiagram
231-
class ExploitModule {
231+
class ScannerModule {
232232
<<abstract>>
233233
+name: str
234234
+description: str
235235
+rtos: str
236236
+category: str
237237
+reliability: str
238238
+cve: str | None
239-
+options: dict[str, ExploitOption]
239+
+options: dict[str, ScanOption]
240240
+register_options() void
241-
+check(target: ExploitTarget) bool*
242-
+exploit(target: ExploitTarget) ExploitResult*
241+
+check(target: ScanTarget) bool*
242+
+exploit(target: ScanTarget) ScanResult*
243243
+requirements() list[str]*
244244
+cleanup() void*
245245
+add_option(name, type, required, default, description) void
246246
}
247247
248-
class ExploitOption {
248+
class ScanOption {
249249
+name: str
250250
+type: str
251251
+required: bool
@@ -254,7 +254,7 @@ classDiagram
254254
+current_value: Any
255255
}
256256
257-
class ExploitResult {
257+
class ScanResult {
258258
+module: str
259259
+status: str
260260
+target_rtos: str
@@ -266,25 +266,25 @@ classDiagram
266266
+cve: str | None
267267
}
268268
269-
class ExploitRegistry {
269+
class ScannerRegistry {
270270
+_modules: dict[str, type]
271271
+discover() void
272272
+get(path: str) type | None
273273
+search(term: str) list
274274
}
275275
276-
ExploitModule "1" --> "*" ExploitOption : options
277-
ExploitModule --> ExploitResult : returns
278-
ExploitRegistry "1" --> "*" ExploitModule : manages
276+
ScannerModule "1" --> "*" ScanOption : options
277+
ScannerModule --> ScanResult : returns
278+
ScannerRegistry "1" --> "*" ScannerModule : manages
279279
```
280280

281281
### Module Discovery Flow
282282

283283
```mermaid
284284
flowchart LR
285-
registry["ExploitRegistry.discover()"] --> scan["Scan rtosploit/exploits/\nfreertos/ threadx/ zephyr/"]
285+
registry["ScannerRegistry.discover()"] --> scan["Scan rtosploit/scanners/\nfreertos/ threadx/ zephyr/"]
286286
scan --> importlib["importlib.import_module()\nfor each .py file"]
287-
importlib --> inspect["Inspect for ExploitModule\nsubclasses"]
287+
importlib --> inspect["Inspect for ScannerModule\nsubclasses"]
288288
inspect --> register["registry._modules[path] = cls"]
289289
register --> ready["Modules available\nfor use/search/run"]
290290
```

docs/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ rtosploit --json coverage stats --firmware fw.bin --bitmap ./bitmap \
180180

181181
- [CLI Reference](../README.md#cli-reference) — Full option documentation for every command
182182
- [Architecture](architecture.md) — System design, data flows, and Mermaid diagrams
183-
- [Writing Exploit Modules](writing-exploits.md) — Add your own exploit modules
183+
- [Writing Scanner Modules](writing-scanners.md) — Add your own vulnerability scanner modules
184184
- [CI/CD Integration](ci-integration.md) — GitHub Actions, GitLab CI, and Makefile recipes
185185
- [Crash Triage](crash-triage.md) — Deep dive into exploitability classification
186186
- [CVE Correlation](cve-correlation.md) — Database internals and NVD sync

0 commit comments

Comments
 (0)