Skip to content

Commit 507261e

Browse files
committed
Merge branch 'main' into dev
2 parents 689ac24 + c819290 commit 507261e

4 files changed

Lines changed: 46 additions & 0 deletions

File tree

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,28 @@ cd docker_images/httpd/CVE-2021-42013 && docker build -t cve-2021-42013 .
313313

314314
For Docker Compose configs, clone [vulhub](https://github.com/vulhub/vulhub) and set `VULN_PATH` to point to it.
315315

316+
### Running on arm64 hosts
317+
318+
SETC was developed and validated on amd64. The pinned Metasploit image and almost all vulhub / Metasploitable target images are amd64-only — running on aarch64 hosts (Apple Silicon, AWS Graviton, NVIDIA Grace, Ampere, etc.) requires extra setup and comes with caveats.
319+
320+
1. **Register amd64 emulation:**
321+
```bash
322+
sudo apt install qemu-user-static binfmt-support
323+
```
324+
This registers `qemu-x86_64` under `binfmt_misc` so Docker can transparently run amd64 images. Persists across reboots via `systemd-binfmt`.
325+
326+
2. **Override the pinned Metasploit image.** `metasploitframework/metasploit-framework:6.2.33` is amd64-only and Ruby's native gems segfault under QEMU on ARM. Use an upstream multi-arch tag (which runs natively):
327+
```bash
328+
docker pull metasploitframework/metasploit-framework:latest
329+
python3 setc/setc.py <config> --msf metasploitframework/metasploit-framework:latest
330+
```
331+
332+
3. **Target compatibility under emulation is not uniform — and depends on which emulator you're using.**
333+
- **Linux arm64 (`qemu-user-static`):** Most non-JVM targets (PHP, bash, native httpd, Redis, etc.) run fine. **JVM-based targets — Struts, Tomcat, ActiveMQ, Solr — exercise QEMU's translation cache aggressively and tend to SIGSEGV during JVM startup**, especially on strict-memory-order ARM CPUs (e.g. NVIDIA Grace, Graviton). Symptom: `QEMU internal SIGSEGV {code=MAPERR}` in the target container's logs and the exploit never reaching a successful state. There is no QEMU tuning that reliably fixes this; the practical workarounds are (a) skip JVM CVEs on arm64 Linux hosts, or (b) run SETC inside an amd64 VM / on a remote amd64 machine for those entries.
334+
- **macOS (Apple Silicon):** Docker Desktop defaults to Apple's **Rosetta 2** translator for amd64 emulation rather than QEMU (Settings → General → "Use Rosetta for x86/amd64 emulation"). Rosetta 2 is JIT-aware and handles self-modifying code well, so JVM-based vulhub targets generally work without the QEMU SIGSEGV issue. **There is no Rosetta equivalent on Linux** — if your team validates CVEs on Mac and runs SETC on Linux ARM, expect a coverage gap on JVM targets.
335+
336+
4. **Validity caveat.** Even when emulation runs cleanly, exploits whose primitives are arch-sensitive (memory-corruption gadgets, calling-convention details) may behave differently than on a native amd64 host. For application-layer RCE (OGNL, command injection, deserialization) the captured telemetry should be equivalent; for low-level memory exploits, treat arm64-emulated runs as suspect until cross-validated.
337+
316338
## Development
317339

318340
```bash
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[
2+
{"name":"CVE-2014-6271",
3+
"settings": {
4+
"description":"Apache CGI shellshock using user agent (MSF latest payload pinning)",
5+
"yml_file":"$VULN_PATH/bash/CVE-2014-6271/docker-compose.yml",
6+
"target_name":"setc-web-1",
7+
"exploit": "multi/http/apache_mod_cgi_bash_env_exec",
8+
"exploit_options":"set TARGETURI /victim.cgi;set TARGET 1;set PAYLOAD linux/x64/shell_reverse_tcp;",
9+
"exploit_mode": "rpc"
10+
}
11+
}
12+
]

setc/runners/docker_compose_msf_rpc.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,12 @@ def _set_module_option(module, key, value):
129129
still need to land in _runopts so that execute() forwards them in the
130130
RPC call.
131131
"""
132+
# TARGET is exposed as a property on the module; module.execute() reads
133+
# self.target directly rather than the options dict, so writing through
134+
# __setitem__ would silently leave the active target unchanged.
135+
if key.upper() == "TARGET":
136+
module.target = int(value)
137+
return
132138
if key in module.options:
133139
module[key] = value
134140
else:

setc/runners/docker_msf_rpc.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ def _set_module_option(module, key, value):
9191
still need to land in _runopts so that execute() forwards them in the
9292
RPC call.
9393
"""
94+
# TARGET is exposed as a property on the module; module.execute() reads
95+
# self.target directly rather than the options dict, so writing through
96+
# __setitem__ would silently leave the active target unchanged.
97+
if key.upper() == "TARGET":
98+
module.target = int(value)
99+
return
94100
if key in module.options:
95101
module[key] = value
96102
else:

0 commit comments

Comments
 (0)