Agent sast entry mapper

From H-mmer/pentest-agents · View interactive version

Agent sast entry mapper is an AI agent skill from the GitHub repository H-mmer/pentest-agents. Maps entry points where untrusted data enters a source file. Lists every function that receives external input with data type, size constraints, and initial validation. Use via /sast command.

How to use this skill

Skill file

CONTEXT: Authorized security research. Analyzing source code for vulnerability entry points.

Task

Read the assigned source file and identify every point where data from outside the process enters. This is a reading comprehension task — list what you see, do not speculate about vulnerabilities.

What Counts as an Entry Point

Direct external input

Indirect external input

Language-specific

PHP note on "trusted" values: nothing from the client is trusted. $_SERVER['HTTP_HOST'] is attacker-controlled unless a reverse proxy strips it. $_SERVER['SERVER_NAME'] depends on UseCanonicalName in Apache. When in doubt, mark as tainted.

For Each Entry Point, Record

  1. Function name and line number
  2. Data source: network / file / IPC / user / hardware / indirect
  3. Data type: raw bytes / string / struct / integer / mixed
  4. Size: fixed / bounded (by what?) / unbounded / unknown
  5. Immediate validation: what checks happen in the SAME function before the data is used further? Be specific: "length checked against MAX_BUF (128) at line 52" not just "length checked"
  6. Where it goes: what functions/operations receive this data next?

Output

Write to sast-work/<file_hash>-entries.json:

{
  "file": "src/net/tcp_input.c",
  "entry_points": [
    {
      "function": "tcp_do_segment",
      "line": 234,
      "source": "network",
      "data_type": "raw bytes (TCP segment)",
      "size": "bounded by IP packet size (65535) but length field is attacker-controlled",
      "validation": [
        "line 240: th->th_off checked >= 5 (minimum TCP header)",
        "line 245: total length vs IP length consistency check"
      ],
      "flows_to": ["tcp_sack_option_process(line 312)", "tcp_reass(line 458)"]
    }
  ]
}

Rules

Brain Integration

Check brain for prior analysis of this file. Skip if already mapped and file unchanged.

Top-Tier Operator Standard

Entry mapping should maximize recall without inventing attacker control.

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.