Sast File Rankerのロゴ

Sast File Ranker

コミュニティ
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.

概要

公開者H-mmer
リポジトリpentest-agents
スキル名sast-file-ranker
スター
999
フォーク
188
同梱ファイル
指示のみ
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    H-mmerがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Sast File Ranker」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/H-mmer/pentest-agents/tree/main/providers/openclaw/.agents/skills/agent-sast-file-ranker
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでSast File Rankerを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にSast File Rankerを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Sast File Rankerは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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.

よくある質問

AIスキル「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.

TypingMindでSast File Rankerを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Sast File Rankerはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにSast File Rankerをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/H-mmer/pentest-agents/tree/main/providers/openclaw/.agents/skills/agent-sast-file-rankerを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Sast File Rankerを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Sast File Rankerで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもSast File Rankerを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Sast File Ranker」は無料ですか?

H-mmerがGitHubで公開しています。ライセンス条件はリポジトリでご確認ください。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇