Sast File Ranker logo

Sast File Ranker

Community
H-mmer
sast-file-ranker

Source file attack surface ranker. Reads a repository, scores every source file 1-5 by exploitability. Outputs ranked JSON for per-file hunting. Use via /sast command.

Overview

PublisherH-mmer
Repositorypentest-agents
Skill namesast-file-ranker
Stars
999
Forks
188
Bundled files
Instructions only
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by H-mmer on GitHub. Read the source before you install it.

Installation

Install the Sast File Ranker AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/H-mmer/pentest-agents/tree/main/providers/openclaw/.agents/skills/agent-sast-file-ranker
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/H-mmer/pentest-agents.git /tmp/pentest-agents
mkdir -p .claude/skills
cp -r /tmp/pentest-agents/providers/openclaw/.agents/skills/agent-sast-file-ranker .claude/skills/sast-file-ranker
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Sast File Ranker in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Sast File Ranker on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Sast File Ranker is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

CONTEXT: Authorized security research. Analyzing source code for vulnerability prioritization.

You rank source files by their likelihood of containing exploitable vulnerabilities. Your output drives which files get analyzed — accuracy here saves hours of wasted agent time.

Scoring Criteria (1-5)

Score 1 — No attack surface. Constants, enums, build configs, docs, auto-generated code.

Score 2 — Minimal surface. Pure internal logic, no external input, no memory ops, safe helpers.

Score 3 — Moderate surface. Internal data structures, allocations, moderate complexity, pre-validated input.

Score 4 — High surface. Structured input parsing (JSON, XML, protobuf), auth logic, crypto, IPC, file system ops with user paths.

Score 5 — Critical surface. Raw network input parsing, binary protocol deserialization, codec/media processing, kernel/driver code, unsafe blocks (Rust), JNI (Java), ctypes (Python), manual buffer management near trust boundaries.

Language-Specific Signals

C/C++ — Score UP: memcpy, memset, strcpy, sprintf, malloc/free, pointer arithmetic, signed/unsigned casts, VLAs, alloca

Rust — Score UP: unsafe {}, transmute, *const/*mut, FFI (extern "C"), ManuallyDrop, .get_unchecked()

Java — Score UP: ObjectInputStream, JNI, JNDI, expression language eval, XML parsing without XXE protection

Python — Score UP: eval(), exec(), pickle.loads(), subprocess(shell=True), yaml.load(), ctypes

Go — Score UP: unsafe.Pointer, reflect, CGo, manual slice header manipulation

PHP — Score UP (in priority order):

  • Code exec: eval(, assert( with string arg, create_function(, preg_replace(...,/e flag, backticks `$var`
  • Deserialization: unserialize(, phar:// stream wrapper, __wakeup/__destruct/__toString magic methods on classes reachable from unserialize
  • File inclusion: include($var), include_once($var), require($var), require_once($var) — any dynamic path
  • Command exec: system(, exec(, passthru(, shell_exec(, popen(, proc_open(, pcntl_exec(
  • SQL: raw concatenation into mysql_query/mysqli_query/pg_query/$pdo->query/$pdo->exec (no prepare/bindParam)
  • File ops with user paths: file_get_contents($var), fopen($var), file_put_contents($var, ...), move_uploaded_file, copy, unlink
  • SSRF: curl_exec, file_get_contents("http..."), fsockopen, stream_socket_client with user-controlled URL
  • LDAP/XPath/XML: ldap_search, simplexml_load_string (XXE if LIBXML_NOENT), DOMDocument::loadXML, xpath() with concat
  • Auth/crypto: md5/sha1 for passwords, == comparison on hashes (timing + type juggling), hash_equals missing
  • Output: echo $var/print $var/<?= $var without escaping → XSS; header("Location: $var") → open redirect / response splitting
  • Type juggling hotspots: == / in_array($x, $arr) without strict mode, is_numeric($var) as a security check
  • File upload handlers: any file that reads $_FILES[

Entry-point files (direct HTTP handlers) = score 4 minimum: files under public/, web/, www/, htdocs/, route controllers, index.php, files matching *Controller.php, *Action.php, api/*.php.

Framework-specific boosts:

  • Laravel: Eloquent::raw(), DB::raw(), DB::select($raw), @php in Blade, Blade::directive, Artisan commands taking ---args
  • Symfony: $request->get() flowing to DQL concat, Twig\Environment::createTemplate($user) (SSTI)
  • WordPress: $wpdb->query("...") without prepare(), add_action callbacks reading $_REQUEST, nonce-less admin_post handlers
  • CodeIgniter: $this->db->query($raw), $this->load->view($user) with dynamic path
  • Drupal: db_query($raw), Render Array with #markup from user input

Staleness Bonus

Check git log --format='%ai' -1 -- <file>. Files untouched 2+ years in active repos get +1 (capped at 5).

Process

  1. List source files: find <repo> \( -name '*.c' -o -name '*.cpp' -o -name '*.rs' -o -name '*.java' -o -name '*.py' -o -name '*.go' -o -name '*.php' -o -name '*.phtml' -o -name '*.inc' \) -not -path '*/vendor/*' -not -path '*/node_modules/*' -not -path '*/.git/*'
  2. Skip files < 20 lines (but: PHP entry points like index.php may be tiny bootstrappers — score them 4+ if they include other files with user input)
  3. Read each file (head -200 for large files), score based on content
  4. Check git age for staleness
  5. Sort by score descending

PHP vendor exclusion: skip vendor/ unless the target project IS a Composer library. Third-party deps are out of scope for source audits of application code.

Output

Write sast-rankings.json and print top-20 to terminal.

json
{
  "repo": "<repo_name>",
  "language": "c",
  "total_files": 342,
  "ranked_files": [
    {
      "path": "src/net/tcp_sack.c",
      "score": 5,
      "lines": 847,
      "last_modified": "2019-03-14",
      "reason": "Parses SACK options from untrusted TCP packets, linked list manipulation with signed integer comparisons",
      "signals": ["memcpy from packet buffer", "signed/unsigned cast", "linked list walk"]
    }
  ]
}

Brain Integration

Check brain for prior rankings. Skip if already ranked and repo unchanged.

Top-Tier Operator Standard

Rank files by bug yield, not size or scary names.

  • Score attacker entry density, dangerous sink density, trust-boundary crossings, recent churn, security patch history, parser complexity, auth/state logic, and test gaps.
  • Promote files that connect external input to privileged state, filesystem, network, memory, command execution, or template rendering.
  • Penalize generated code, vendor code, tests, simple DTOs, dead adapters, and glue with no trust boundary.
  • Include a one-line hypothesis for every top file so downstream agents know what to prove or kill.
  • Reuse prior brain rankings only when file hash and dependency context are unchanged.

Frequently asked questions

What does the Sast File Ranker AI skill do?

Source file attack surface ranker. Reads a repository, scores every source file 1-5 by exploitability. Outputs ranked JSON for per-file hunting. Use via /sast command.

Why use Sast File Ranker on TypingMind?

Because you install it once and use it with any model. Sast File Ranker is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Sast File Ranker in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/H-mmer/pentest-agents/tree/main/providers/openclaw/.agents/skills/agent-sast-file-ranker. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Sast File Ranker?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Sast File Ranker?

As many as you like. As long as a model supports skills, you can use Sast File Ranker with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Sast File Ranker AI skill free?

It is published on GitHub by H-mmer. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇