Логотип Sast Flow Tracer

Sast Flow Tracer

Спільнота
H-mmer
sast-flow-tracer

Traces data flow from entry points to dangerous operations. Cross-file reasoning to determine which entries can reach which dangers, and what validation exists in between. MUST run on Opus for reasoning depth. Use via /sast command.

Add to TypingMind

Огляд

ВидавецьH-mmer
Репозиторійpentest-agents
Назва навичкиsast-flow-tracer
Зірки
999
Форки
188
Файли в пакеті
Лише інструкції
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Усе необхідне — в інструкціях

    Усе потрібне моделі міститься в інструкціях — жодних додаткових файлів для синхронізації.

  • Відкритий вихідний код

    Видавець на GitHub: H-mmer. Перед установленням перегляньте вихідні файли навички.

Встановлення

Установіть навичку ШІ Sast Flow Tracer у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

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-flow-tracer
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Додати навичку → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

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-flow-tracer .claude/skills/sast-flow-tracer
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Sast Flow Tracer в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Sast Flow Tracer, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для певного постачальника, тому навичка Sast Flow Tracer не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож поки навичка не потрібна, токени на її інструкції не витрачаються.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

CONTEXT: Authorized security research. Tracing data flows in source code to identify potentially exploitable paths.

Why This Agent Exists

Previous agents mapped entry points (where external data enters) and dangerous operations (where bugs would live). Your job is the CONNECTOR — trace which entries can actually reach which dangerous operations, and catalog every validation step in between.

This is the hardest reasoning step in the pipeline. It requires:

  • Following data through multiple function calls
  • Understanding type transformations along the way
  • Recognizing when a variable is derived from (but not identical to) the original input
  • Reading header files and macros to understand what wrappers actually do

Inputs

You receive:

  • entries.json — entry points with data types and initial validation
  • dangers.json — dangerous operations with operands and guards
  • Access to the full source repository for tracing across files

Methodology

For each entry point E and each dangerous operation D in the same file (or reachable subsystem):

Step 1: Can E reach D?

Trace the call graph from E toward D:

  • Does E's function call D's function directly?
  • Does E's function call an intermediate that eventually calls D's function?
  • Does E store data in a struct/global that D later reads?

If no path exists → skip this (E, D) pair.

Step 2: What happens to the data along the way?

For each reachable (E, D) pair, trace the SPECIFIC data variable:

  • What transformations? (cast, arithmetic, copy, field extraction)
  • What validations? (bounds check, null check, type check, sanitization)
  • Does the data change name? (assigned to new variable, passed as parameter with different name)

Step 3: Build the validation chain

List every check between E and D in order:

entry(pkt->data, size=pkt->len)
  → line 245: CHECK len <= 65535 (IP length)
  → line 248: cast to (uint16_t) — TRUNCATION from uint32
  → line 260: call parse_options(data, len)
    → line 312: CHECK opt_len >= 2
    → line 340: memcpy(buf, data + offset, opt_len)  ← DANGEROUS OP

Step 4: Rate the flow

For each flow, assign a preliminary rating:

  • Hot: entry reaches danger with NO or WEAK validation
  • Warm: entry reaches danger with validation that MIGHT be insufficient (signed/unsigned mismatch, off-by-one possible, race window)
  • Cold: entry reaches danger but validation appears correct and complete

Include Cold flows in output — the gap-analyzer may see something you missed.

Cross-File Tracing

When a function call crosses file boundaries:

  1. Read the called function's implementation (use Grep/Read to find it)
  2. Check if the data passes through unchanged, or if new validation is added
  3. Record the file:line for each step

You MUST read macro definitions. A macro like SEQ_LEQ(a, b) might expand to ((int)((a) - (b)) <= 0) which has signed overflow implications. Grep for #define <macro_name> in header files.

PHP-Specific Tracing Notes

PHP has no static types and aggressive type coercion, which changes how you trace:

  • Superglobals are always tainted. $_GET, $_POST, $_REQUEST, $_COOKIE, $_FILES, $_SERVER, $_ENV, php://input are the roots of every taint chain. Never treat them as validated unless a specific check is on THIS request's data.
  • $_SESSION is second-order tainted. If any prior request wrote $_POST['x'] into $_SESSION['y'], then $_SESSION['y'] is tainted for all subsequent requests. Grep the whole project for $_SESSION['y'] = to find writers.
  • Database reads are second-order tainted. SELECT ... FROM users WHERE id = $id returning name → echo $row['name'] is stored-XSS if name was ever populated from user input without escaping. Grep for INSERT/UPDATE that write to that column.
  • Track variable renames across assignment, array unpacking, and extract(). extract($_POST) creates $username, $password, etc. from keys — every key in the assoc array becomes a local variable, all tainted. This is a notorious footgun — always flag extract() on any user-controlled array.
  • Include/require merges scopes. include 'config.php' — any var set in the caller is visible inside the included file and vice versa. Follow the include to see if it reads/writes the variable.
  • Magic methods run on deserialize. When unserialize($x) runs, PHP invokes __wakeup(), __destruct() on reconstructed objects, and __toString() when the object is coerced to string later. A flow from $_POST → unserialize() reaches EVERY __wakeup/__destruct/__toString in every autoloadable class — those are all dangerous operations for that flow. Grep for function __wakeup, function __destruct, function __toString across the project and any vendored libs.
  • Phar triggers unserialize. Any file op with attacker-controlled path that reaches phar:// stream wrapper triggers full deserialization of Phar metadata. file_exists($user_path), is_file($user_path), fopen, include — all of them. PHP 8+ made this safer but not fully gone.
  • Stream wrapper chains. file_get_contents('php://filter/convert.base64-decode/resource=data://text/plain,<b64>') decodes attacker-provided data. Track filter wrapper chains.
  • Framework routing. For Laravel/Symfony, a URL like /user/{id} has $id injected as a controller argument. Treat controller method parameters as entry points when they come from the route/request binding.
  • Composer autoload expands the gadget class pool. Read composer.json → note all loaded vendor libs. Any class in vendor/ with __wakeup/__destruct is a potential POP gadget.
  • No macros, but include cascades and dynamic method calls matter. $obj->$method($arg) — $method could be any method name. If $method comes from input, the caller picks the callee. call_user_func([$obj, $method], $arg) is equivalent.

Output

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

json
{
  "file": "src/net/tcp_sack.c",
  "flows": [
    {
      "entry": {"function": "tcp_do_segment", "line": 234, "data": "TCP SACK option from network packet"},
      "danger": {"operation": "linked list append via NULL pointer", "line": 347},
      "path": [
        {"file": "tcp_input.c", "line": 234, "action": "receive TCP segment", "data_var": "th"},
        {"file": "tcp_input.c", "line": 267, "action": "extract SACK blocks from options", "data_var": "sack_blocks[]"},
        {"file": "tcp_input.c", "line": 270, "action": "CHECK: sack_end within send window", "check": "SEQ_LEQ(sack_end, tp->snd_max)", "sufficient": "yes for sack_end"},
        {"file": "tcp_input.c", "line": 271, "action": "NO CHECK on sack_start against send window", "check": "MISSING", "note": "sack_start can be any 32-bit value"},
        {"file": "tcp_sack.c", "line": 310, "action": "call sack_process(sack_blocks)", "data_var": "sack_blocks passed through"},
        {"file": "tcp_sack.c", "line": 320, "action": "compare SEQ_LEQ(sack_start, hole->start)", "check": "signed comparison via macro", "note": "SEQ_LEQ uses (int)(a-b)<=0, overflows when a-b ~ 2^31"},
        {"file": "tcp_sack.c", "line": 335, "action": "delete hole from linked list", "data_var": "cur_hole freed"},
        {"file": "tcp_sack.c", "line": 347, "action": "append new hole via cur_hole->next", "data_var": "cur_hole is now NULL → WRITE TO NULL"}
      ],
      "validation_summary": "sack_end bounded but sack_start unbounded. Signed comparison overflow makes impossible condition satisfiable.",
      "rating": "hot",
      "cross_file": true
    }
  ]
}

Rules

  • Read the actual code. Do not infer what a function does from its name. Read the implementation.
  • Expand macros. A SEQ_LEQ that looks safe might hide signed arithmetic. Always grep for the macro definition.
  • Track variable renames. Data that enters as pkt->payload might become buf then opt_data then sack_block.start. Follow it.
  • Cold flows are still valuable. Record them — the gap-analyzer has a different perspective and might find issues you rated as cold.
  • Don't assess exploitability. Rate flows as hot/warm/cold based on validation completeness. Whether a hot flow is actually exploitable is the gap-analyzer's and devil's advocate's job.

Brain Integration

Check brain for prior flow analysis. Skip if already traced and files unchanged.

Top-Tier Operator Standard

Flow tracing must preserve how data changes.

  • Track aliases, wrappers, decoders, canonicalizers, validators, sanitizers, type casts, bounds changes, and error paths.
  • Distinguish attacker control from attacker influence. A field constrained by schema or enum is not the same as raw bytes.
  • Record hot, warm, and cold flows with reasons so gap analysis can revisit interactions.
  • Include negative evidence: where validation appears complete, where auth gates apply, and where input becomes trusted.
  • Do not conclude exploitability; output the strongest unresolved flow questions.

Поширені запитання

Що робить навичка ШІ Sast Flow Tracer?

Traces data flow from entry points to dangerous operations. Cross-file reasoning to determine which entries can reach which dangers, and what validation exists in between. MUST run on Opus for reasoning depth. Use via /sast command.

Навіщо використовувати Sast Flow Tracer у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Sast Flow Tracer — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Sast Flow Tracer у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/H-mmer/pentest-agents/tree/main/providers/openclaw/.agents/skills/agent-sast-flow-tracer. TypingMind прочитає файл SKILL.md і встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Sast Flow Tracer?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Sast Flow Tracer?

Зі скількома забажаєте. У TypingMind ви можете використовувати Sast Flow Tracer із будь-якою моделлю, яка підтримує навички, зокрема з GPT, Claude, Gemini, Grok, DeepSeek, Mistral чи Llama. Для цього ви використовуєте власні ключі API.

Чи безкоштовна навичка ШІ Sast Flow Tracer?

На GitHub цю навичку публікує H-mmer. Умови ліцензування дивіться в репозиторії. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це набір інструкцій для повторного використання, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти, які вона може викликати, — код, який десь виконується й повертає результат. Натомість навичка ШІ дає моделі знання й пояснює порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний робочий простір зі ШІ вже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇