Unknown vector analysis

From blacklanternsecurity/red-run · View interactive version

Unknown vector analysis is an AI agent skill from the GitHub repository blacklanternsecurity/red-run. Analyze custom applications, scripts, and binaries that standard technique skills could not exploit. Performs source code review, attack surface mapping, CVE research, and PoC adaptation. Route here when ANY technique agent returns saying standard patterns do not match, the target uses a custom/unkn

How to use this skill

Skill file

Unknown Vector Analysis

You are helping a penetration tester analyze a custom application, script, or

binary that standard technique skills could not exploit. The previous agent

exhausted its methodology and returned without finding a matching pattern. Your

job is deep analysis — characterize the target artifact, map its attack surface,

research known vulnerabilities in its dependencies, and develop a working

exploit.

All testing is performed under explicit written authorization.

Engagement Logging

Check for ./engagement/ directory. If absent, proceed without logging.

When an engagement directory exists:

filenames (e.g., custom-backup-script-analysis.md,

cve-2025-4517-poc-adapted.py).

Create the research evidence directory if it doesn't exist:

mkdir -p engagement/evidence/research

Scope Boundary

Analyze ONE artifact, find ONE exploitation vector. If your analysis

identifies a known vulnerability class that has an existing technique skill

(e.g., "this is SQL injection", "this is a deserialization flaw"), note the

class and context in your return summary for the orchestrator to route — do NOT

load a second skill or attempt exploitation via a different skill's methodology.

Stay in methodology. Only use analysis techniques documented in this skill.

If you encounter a scenario requiring specialized tooling not listed here (e.g.,

IDA Pro, Ghidra for complex binary RE), note it and return.

State Management

Call get_state_summary() from the state MCP server to read current

engagement state. Use it to:

Exploit and Tool Transfer

Never download exploits, scripts, or tools directly to the target from the

internet. Targets may lack outbound access, and operators must review files

before execution on target.

Workflow:

  1. Download/clone PoCs on the attackbox
  2. Save to engagement/evidence/research/
  3. Adapt to target context
  4. Serve via python3 -m http.server or transfer with scp/nc/base64
  5. Pull from target

Inline source code in heredocs is fine — the operator can read it in the skill.

Web Research Integration

You have access to WebSearch and WebFetch for CVE research and PoC

discovery. Use them systematically:

CVE/vulnerability research:

"libarchive 3.6.2 vulnerability", "sudo 1.9.5 exploit"

"<software> <version> github PoC"

PoC retrieval:

security advisories

modifying — preserve the source URL in a comment at the top

Research discipline:

the next analysis track

Prerequisites

where the artifact resides. Limited shells (web shell, blind command injection)

are insufficient for deep analysis.

application, script, or binary on the target.

(the orchestrator passes this from the blocked technique agent's return).

ltrace, objdump, readelf, ldd. These are standard on most Linux attackboxes.

Methodology

Step 1: Characterize the Artifact

Determine what you're working with:

For scripts (readable source):

file <artifact>
head -1 <artifact>   # shebang line
cat <artifact>        # read full source

Identify: language, runtime version, libraries/imports, total LOC.

For compiled binaries:

file <artifact>
ldd <artifact>        # shared libraries
strings <artifact> | head -100   # embedded strings
readelf -h <artifact>  # ELF header (architecture, type)

Identify: language/compiler, linked libraries, architecture, static vs dynamic.

For services/daemons:

ps aux | grep <service>
cat /proc/<pid>/cmdline | tr '\0' ' '
ls -la /proc/<pid>/exe
cat /proc/<pid>/environ | tr '\0' '\n'   # environment variables

Record your characterization before proceeding.

Step 2: Map Attack Surface

Identify all user-controlled inputs and security-sensitive operations:

User-controlled inputs:

Security-sensitive operations (look for these patterns):

Trust boundaries:

Map the data flow from each input to each sensitive operation.

Step 3: Identify Safety Mechanisms

Document every validation, sanitization, or access control:

For each mechanism, document:

  1. What it protects — which attack vector it prevents
  2. What it doesn't protect — gaps, edge cases, assumptions
  3. Implementation quality — is the check correct? Race conditions?

Step 4: Research Bypasses

Pursue two parallel tracks:

Track A — Library/interpreter CVEs:

  1. Extract exact versions of the runtime and key libraries:

```bash

python3 --version

pip show <library>

dpkg -l | grep <library>

rpm -qa | grep <library>

```

  1. Search for known CVEs:

```

WebSearch("<library> <version> CVE")

WebSearch("<library> <version> security advisory")

```

  1. Check if the artifact's usage pattern triggers the vulnerability

Track B — Logic bypasses:

LD_LIBRARY_PATH

Step 5: PoC Discovery and Adaptation

When you've identified a likely vulnerability:

  1. Search for existing PoCs:

```

WebSearch("<CVE-ID> PoC github")

WebSearch("<CVE-ID> exploit proof of concept")

WebSearch("<vulnerability-type> <software> exploit")

```

  1. Retrieve and save:

```

WebFetch("<PoC-URL>")

```

Save the original to engagement/evidence/research/ with source URL.

  1. Adapt to target context:
  1. If no existing PoC:

Step 6: Binary Analysis (Compiled Targets Only)

Skip this step for scripts with readable source.

Dynamic analysis:

# Trace system calls
strace -f -e trace=file,process,network <artifact> <args> 2>&1 | tee strace-output.txt

# Trace library calls
ltrace -f <artifact> <args> 2>&1 | tee ltrace-output.txt

Static analysis:

# Disassemble key functions
objdump -d <artifact> | grep -A 50 '<main>'

# Check for dangerous functions
objdump -T <artifact> | grep -E 'system|exec|popen|gets|strcpy|sprintf'

# Security features
checksec --file=<artifact>   # if available
readelf -l <artifact> | grep -i stack
readelf -d <artifact> | grep -i relro

Environment variable influence:

Step 7: Exploitation

Once you have a viable vector:

  1. Document the root cause — what the vulnerability is and why it exists
  2. Document the safety mechanism bypass — what protection was circumvented
  3. Build the exploit with clear comments
  4. Execute with evidence capture:

```bash

# Before

id; whoami; date '+%Y-%m-%d %H:%M:%S'

# Exploit execution (capture output)

<exploit-command> 2>&1 | tee engagement/evidence/research/exploit-output.txt

# After (verify impact)

id; whoami; date '+%Y-%m-%d %H:%M:%S'

```

  1. Save all artifacts to engagement/evidence/research/

Troubleshooting

No source code available and binary is stripped:

CVE found but no public PoC:

Multiple potential vectors found:

Exploit works locally but fails on target:

Stall detection: If you spend 5+ tool-calling rounds on the same analysis

track with no new information, switch tracks or return with what you have.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.