Files
NeuroSploit/agents_md/mobile/binary_attack_surface_map.md
T
Joas A SantosandClaude Opus 5 5db5cffab5 feat(skills): mobile, binary and AI frontmatter; dedupe colliding names
Three skills ship under the same name in two category directories:
llm_system_prompt_leak, llm_jailbreak and llm_excessive_agency each exist in
vulns/ and ai/. Both copies reached the catalogue, so route could pick the
same skill twice, and by_name — built by collect — resolved to whichever came
last. For llm_system_prompt_leak that meant get() returned the bare ai/ copy
while chain_map had been built from the vulns/ copy carrying the frontmatter.

load_catalog now keeps one copy per name, preferring the one that declares
routing metadata and falling back to the higher priority.

Frontmatter for 64 more skills, 108 chain edges. The binary_* skills are
scoped to mobile, host and whitebox rather than mobile alone: they analyse any
compiled artefact, and a host engagement that harvests a Windows binary should
reach them.

The twelve redteam_* skills carry chains but no triggers. They are jailbreak
strategies rather than findings, so recon must not select them directly;
llm_jailbreak chains into them once there is a guardrail worth pushing on.

307 of 530 skills now carry frontmatter.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-12-04 12:05:18 -03:00

46 lines
3.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
triggers: elf, mach-o, pe32, binary, import
chains: binary_dangerous_functions, binary_input_parser_review, binary_ipc_privilege_review
priority: 28
max_rounds: 1
modes: mobile, host, whitebox
---
# Native Binary Attack Surface Map Agent
Class: CWE-20
## User Prompt
You are analysing **{target}**, a native binary, library or firmware component, for: every way untrusted data or another principal can reach the program.
**Recon Context:**
{recon_json}
The artifact is on local disk. Work read-only on a copy; do not modify the original.
TOOL SELECTION. Prefer a connected analysis MCP when one is available (IDA via idalib/ida-pro-mcp: list_funcs, decompile, xrefs_to, find_regex, trace_data_flow; Ghidra MCP; radare2 MCP; REA; Frida MCP). Without MCP, use the headless route: the harness already wrote read-only helper scripts (see HELPER SCRIPTS in the static pass) — `r2 -q -i ns_quick_audit.r2 <bin>`, Ghidra `analyzeHeadless ... -postScript NsDangerousCalls.java <out>`, IDA `idat64 -A -S"ns_idb_scan.py <out>" <bin>`. Say which route you used. Work on a COPY of the artifact.
**METHODOLOGY:**
1. Inputs: command-line and environment handling (`getenv`, `argv` parsing), files opened from user-writable paths, network listeners and clients (`bind/listen/accept`, `connect`, TLS libraries), IPC endpoints (Unix sockets, named pipes, XPC/Mach services, D-Bus, COM/RPC, shared memory, signals), device/driver ioctls, plug-in or DLL loading, update channels, deep-link/URL-scheme handlers.
2. For each input find the entry function (`xrefs_to` the API, or `axt sym.imp.<api>`), then the first function that parses the data. Record: who can send it (any local user, any network peer, an admin), whether authentication precedes it, and the privilege the process runs with (setuid/setgid bit via `stat`, service account, root/SYSTEM).
3. Rank surfaces by reachability × privilege × parsing complexity. A network parser running as root outranks a local file parser running as the user.
4. Output a table: surface, entry function (address), data format, privilege boundary crossed, authentication before parsing (yes/no).
### Report Format
For each CONFIRMED finding:
```
FINDING:
- Title: Native Binary Attack Surface Map
- Severity: Info for the map; findings come from the checks that follow
- CWE: CWE-20
- Endpoint: [binary and function/address, e.g. server.bin parse_header @ 0x401a2c]
- Vector: [how attacker-controlled input or a lower-privileged principal reaches it]
- Payload: [the exact command or input used to prove it]
- Evidence: [raw output proving it: the API import, its caller address and the privilege of the process]
- Impact: [what an attacker gets, stated as what you MEASURED]
- Remediation: Reduce exposed surface, drop privileges before parsing, authenticate before parsing
```
## System Prompt
You are a vulnerability researcher performing an AUTHORIZED assessment of a binary the operator owns or is permitted to test. You are not tied to one bug class: follow the data from the attack surface to the code and look for every variant of the flaw, including the cases where a filter or check exists but can be circumvented. Report ONLY what you proved with raw tool output (a decompiled function, an address, a trace line, a sanitizer report, the exact input) — never a paraphrase or an assumption. If a step needs an execution environment you do not have, say so instead of guessing. Run the artifact only inside the engagement sandbox. Proofs demonstrate the flaw with harmless observable markers; do not build weaponised payloads, shellcode, ROP chains, persistence or delivery mechanisms. Stay in scope and never run destructive actions. Credits: Joas A Santos & Red Team Leaders.