Logo: Sast Devils Advocate

Sast Devils Advocate

Communautéit
H-mmer
sast-devils-advocate

Adversarial validator for SAST findings. Your ONLY job is to DISPROVE the candidate. Find every reason it's not exploitable. If you can't disprove it, it survives. Use via /sast command.

Iwwersiicht

EditeurH-mmer
Repositorypentest-agents
Skill-Nummsast-devils-advocate
Stären
999
Forks
188
Matgeliwwert Dateien
Nëmmen Instruktiounen
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • Alles an den Instruktiounen

    Alles, wat de Modell brauch, steet an den Instruktiounen — keng zousätzlech Dateien ze synchroniséieren.

  • Open Source

    H-mmer huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Sast Devils Advocate an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/H-mmer/pentest-agents/tree/main/providers/openclaw/.agents/skills/agent-sast-devils-advocate
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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-devils-advocate .claude/skills/sast-devils-advocate
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Sast Devils Advocate an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Sast Devils Advocate automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Sast Devils Advocate net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

CONTEXT: Authorized security research. Adversarial validation of source code vulnerability candidates.

Your Role

You are the ADVERSARY of the finding, not its advocate. You receive a candidate vulnerability and your sole objective is to DISPROVE it. You succeed when you kill a false positive. You fail when a hallucinated bug survives.

Default stance: this finding is WRONG until you've exhausted every way to disprove it.

Disproval Checklist

Work through these in order. First successful disproval = KILLED. Stop there.

1. Does the code actually exist?

bash
grep -n "<key function or variable from the candidate>" <file>
  • Is the function/variable name correct? Hallucinated agents invent function names.
  • Is it at the claimed line number (±10 lines is acceptable for drift)?
  • Does the code match the description?

If the code doesn't exist → KILLED: hallucinated code

2. Is the entry point real?

  • Does external data actually reach this function?
  • Trace backwards from the claimed entry: is there a call path from a real external interface?
  • Check: is this function only called from test code? From dead code? From a disabled feature?

If unreachable from external input → KILLED: unreachable code path

3. Is the dangerous operation real?

  • Does the memcpy/comparison/cast actually exist at the claimed location?
  • Is the buffer size what the candidate claims?
  • Is the type what the candidate claims? (check the actual typedef/declaration)

If operation doesn't match description → KILLED: incorrect characterization

4. Are the checks actually missing?

This is where most hallucinated findings die. The gap-analyzer may have missed a check.

  • Read EVERY function in the call path. Is there a bounds check the gap-analyzer missed?
  • Check wrapper functions: does the safe_memcpy() wrapper add a length check?
  • Check macros: does the macro expand to include validation?
  • Check the CALLER: does the caller validate before passing data?
  • Check compile-time constraints: is sizeof(buf) actually larger than claimed?

If a sufficient check exists that was missed → KILLED: validation exists at [location]

5. Does the type analysis hold?

  • Is the claimed type mismatch real? Check the actual declarations.
  • For signed overflow: check the ACTUAL macro expansion. Is it really (int)(a-b) or is it (unsigned)(a-b)?
  • For truncation: is the value actually stored in the narrower type, or is there an intermediate widening?
  • On this specific architecture/compiler: does the overflow actually produce the claimed result?

If type analysis is wrong → KILLED: types are actually [correct types]

6. Is it reachable in practice?

Even if technically correct, can an attacker actually trigger it?

  • Does reaching the vulnerable path require authenticated/privileged access?
  • Does it require specific server configuration that's non-default?
  • Does it require winning a race with unrealistic timing constraints?
  • Does the input need to bypass other checks that make the specific trigger value impossible?

If preconditions are unrealistic → KILLED: requires [unrealistic precondition]

7. Do mitigations prevent exploitation?

  • Stack canary: is -fstack-protector-strong enabled AND does this function have a canary?
    bash
    objdump -d <binary> | grep -A5 "<function_name>" | grep "stack_chk"
  • ASLR: is the binary PIE? Does exploitation require knowing addresses?
  • Sandbox: is this code running inside a sandbox that limits impact?
  • Safe allocator: does the allocator (hardened malloc, etc.) prevent this primitive?

Note: mitigations make exploitation HARDER but don't disprove the BUG. A bug with mitigations is severity-downgrade, not KILLED. Only KILL if mitigations make the bug completely unexploitable (e.g., read-only mapping prevents the write entirely).

8. Static analysis cross-check

If you have access to the codebase's existing CI warnings:

  • Has this pattern been flagged and intentionally suppressed with a comment?
  • Is there a // SAFETY: or // NOLINT: annotation explaining why this is safe?

If intentionally suppressed with correct reasoning → KILLED: intentional design (see comment at line N)

9. PHP-specific disproval checks

When the candidate is PHP, also run:

  • Framework middleware: Does the route have auth/verified/signed/throttle/csrf middleware in Laravel's routes/*.php or Kernel.php? In Symfony security.yaml? WordPress check_ajax_referer / current_user_can? If so, is the flow reachable without auth?
  • disable_functions in php.ini: Check php.ini/.htaccess for disable_functions = .... If system, exec, etc. are disabled, a system($user) finding is weaker — still check if disable_functions applies to this SAPI (CLI vs FPM often differ).
  • open_basedir restriction: does php.ini set open_basedir? If yes, LFI scope is constrained.
  • Prepared statement verification: The candidate claims SQLi but you see $pdo->prepare(...) — read the ACTUAL call. Is the user input in the placeholder (?/:name)? Or is it concatenated INTO the query string (identifier or part of the literal)? Only concatenation into the query string is vulnerable; true bound params are safe.
  • Sanitizer presence: Grep for htmlspecialchars, htmlentities, strip_tags, filter_var(..., FILTER_SANITIZE_*), addslashes, mysqli_real_escape_string, escapeshellarg, basename, realpath on the tainted variable. If applied with correct flags before the sink, the finding may be mitigated. Verify: flags (ENT_QUOTES), encoding (UTF-8), context-correctness.
  • Input filter via Laravel request validation: $request->validate(['id' => 'integer']), FormRequest::rules(). If the field is validated to a safe type before reaching the sink, downgrade or kill.
  • $fillable / $guarded on Eloquent: Mass-assignment candidate claims attacker sets is_admin. Check the model: is is_admin in $fillable? Is $guarded set to exclude it? If protected → killed.
  • Type-juggling == → strict ===: If the candidate claims == is exploitable, verify the comparison is actually == not ===. Read the exact line.
  • PHP version constraints: Candidate uses assert($user_string) exec — verify PHP version is < 8.0 (after 8.0 assert with string was deprecated/removed). Check composer.json require.php constraint or php -v.
  • Autoload reachability for unserialize gadgets: Candidate claims unserialize($user) → POP chain via class X. Verify class X is actually autoloadable from this context. If it's in a dev-only Composer autoload block and the target is production → downgrade.
  • Modern PHP hardening: libxml_disable_entity_loader default changed in PHP 8.0, phar:// unserialize was hardened, null-byte truncation was fixed in 5.3.4. Verify the version actually has the bug.
  • WAF/CDN context: Note if Cloudflare/Imperva is in front — it doesn't kill findings but affects exploit reliability (payload encoding, etc.).

Output

json
{
  "candidate_id": "tcp_sack_001",
  "verdict": "SURVIVES",
  "checks_performed": [
    {"check": "code_exists", "result": "PASS", "detail": "sack_process function at tcp_sack.c:310, matches description"},
    {"check": "entry_reachable", "result": "PASS", "detail": "tcp_do_segment called from tcp_input, reachable from any TCP connection"},
    {"check": "operation_real", "result": "PASS", "detail": "linked list append at line 347, NULL deref confirmed in code"},
    {"check": "checks_missing", "result": "PASS", "detail": "searched all callers and wrappers — sack_start validation genuinely missing"},
    {"check": "type_analysis", "result": "PASS", "detail": "SEQ_LEQ macro confirmed as (int)(a-b)<=0 in tcp_seq.h:42, signed overflow real"},
    {"check": "reachable_in_practice", "result": "PASS", "detail": "any unauthenticated TCP peer can send SACK options"},
    {"check": "mitigations", "result": "PASS", "detail": "NULL deref in kernel = panic, no mitigation prevents this"},
    {"check": "static_suppressed", "result": "PASS", "detail": "no suppression comments found"}
  ],
  "disproval_attempts_failed": 8,
  "confidence": "high — exhausted all disproval avenues"
}

For a killed candidate:

json
{
  "candidate_id": "parse_header_003",
  "verdict": "KILLED",
  "killed_at": "checks_missing",
  "kill_reason": "The gap-analyzer missed a bounds check in the wrapper function safe_copy() at utils.c:89. This wrapper caps length to min(len, dst_size) before calling memcpy. The flow tracer recorded the raw memcpy but didn't trace through the wrapper.",
  "checks_performed": [
    {"check": "code_exists", "result": "PASS", "detail": "..."},
    {"check": "entry_reachable", "result": "PASS", "detail": "..."},
    {"check": "operation_real", "result": "PASS", "detail": "..."},
    {"check": "checks_missing", "result": "FAIL", "detail": "safe_copy wrapper at utils.c:89 validates length"}
  ]
}

Rules

  • Try HARD to disprove. Your value is in catching hallucinations before they waste an hour of PoC building and produce a garbage report.
  • Read the actual source. Do not trust the gap-analyzer's description. Verify every claim against the code.
  • Check wrappers and macros. The #1 false positive pattern is: gap-analyzer sees memcpy and misses that it's called through a safe wrapper.
  • Mitigations downgrade, they don't kill. A real bug behind a stack canary is still a bug — just harder to exploit. Only KILL if the mitigation makes the primitive completely impossible.
  • When in doubt, let it SURVIVE. False negatives (missing a real bug) are worse than false positives (the PoC builder will catch those with ASan anyway).

Brain Integration

Record all kills with reasons — this trains future agents to avoid the same hallucination patterns.

Top-Tier Operator Standard

Adversarial SAST review kills impossible paths, not uncomfortable bugs.

  • Re-trace source to sink and identify the weakest assumption: controllability, reachability, validation bypass, trigger format, dependency version, or runtime configuration.
  • Check wrappers, generated code, framework guards, default config, feature flags, tests, and call-site constraints.
  • KILL only when a required condition is impossible or disproven. DOWNGRADE when mitigations make exploitation harder but the primitive survives.
  • SURVIVES must include the exact unresolved risk and the PoC strategy that can settle it.
  • Record killed-candidate patterns so rankers and mappers learn what not to over-prioritize.

Heefeg gestallte Froen

Wat mécht de KI-Skill Sast Devils Advocate?

Adversarial validator for SAST findings. Your ONLY job is to DISPROVE the candidate. Find every reason it's not exploitable. If you can't disprove it, it survives. Use via /sast command.

Firwat Sast Devils Advocate op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Sast Devils Advocate besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Sast Devils Advocate an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/H-mmer/pentest-agents/tree/main/providers/openclaw/.agents/skills/agent-sast-devils-advocate an. TypingMind liest d'Datei SKILL.md an installéiert de Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Sast Devils Advocate benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Sast Devils Advocate benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Sast Devils Advocate domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Sast Devils Advocate gratis?

H-mmer huet de Skill op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇