Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

███████╗██╗  ██╗██████╗ ██╗      ██████╗ ██╗████████╗      ██████╗██╗      █████╗ ██╗   ██╗██████╗ ███████╗
██╔════╝╚██╗██╔╝██╔══██╗██║     ██╔═══██╗██║╚══██╔══╝     ██╔════╝██║     ██╔══██╗██║   ██║██╔══██╗██╔════╝
█████╗   ╚███╔╝ ██████╔╝██║     ██║   ██║██║   ██║        ██║     ██║     ███████║██║   ██║██║  ██║█████╗  
██╔══╝   ██╔██╗ ██╔═══╝ ██║     ██║   ██║██║   ██║        ██║     ██║     ██╔══██║██║   ██║██║  ██║██╔══╝  
███████╗██╔╝ ██╗██║     ███████╗╚██████╔╝██║   ██║        ╚██████╗███████╗██║  ██║╚██████╔╝██████╔╝███████╗
╚══════╝╚═╝  ╚═╝╚═╝     ╚══════╝ ╚═════╝ ╚═╝   ╚═╝         ╚═════╝╚══════╝╚═╝  ╚═╝ ╚═════╝ ╚═════╝ ╚══════╝

Associative Memory Graph - Binary Analysis - Finding Validation for Claude Code

License: MIT Python Claude Code Graph DB

A Claude Code skill that gives the AI an associative memory graph, a binary analysis toolkit, and a bug bounty finding validator - all token-efficient by design.

Quick Start · /exploitdev · Memory Graph · Binary Analysis · Validation · Token Economy · Exploit Dev


What Is This?

Standard Claude Code forgets everything between sessions and wastes tokens re-reading flat files.

Exploit-Claude replaces that with three components wired together:

Component Replaces Token saving
hub.py - associative graph memory MEMORY.md flat files ~66% per retrieval
rx.py - binary analysis objdump - checksec - ROPgadget - nm ~50% per disasm block
validate.py - 7Q+4Gates pipeline manual triage kills invalid findings instantly

The graph uses Dijkstra keyword propagation - ask for UAF,heap and it surfaces transitively related techniques (grooming, tcache, one_gadget) without re-reading files. Bloom filter prevents re-processing already-seen targets. §XPL notation encodes a full exploit chain analysis in ~20 BPE tokens.


Quick Start

git clone https://github.com/Ne02ni/Exploit-Claude.git
cd Exploit-Claude
chmod +x install.sh && ./install.sh

install.sh does everything:

  • Installs capstone + pyelftools into local vendor/
  • Seeds the exploit knowledge graph (450+ nodes, CVEs, BB chains)
  • Seeds from your notes vault if found
  • Writes ~/.claude/CLAUDE.md with session rules
  • Installs /exploitdev slash command into Claude Code

After install, open Claude Code and type /exploitdev to activate Researcher mode.

Requirements: Python 3.10+, Claude Code CLI, objdump / readelf (standard on Linux/macOS)


/exploitdev Command

After install, type /exploitdev in any Claude Code session to instantly switch into Researcher mode.

/exploitdev

What it does on activation:

  1. Loads your memory graph context (m:find -k "user,context,pref")
  2. Sets all rules: §compact output, bloom checks, validate-before-report
  3. Activates §XPL notation for exploit analysis
  4. Points to all tools: scripts/hub.py, scripts/rx.py, scripts/validate.py

The command lives at ~/.claude/commands/exploitdev.md - reinstall anytime with ./install.sh.


How It Works

+-------------------------------------------------------+
|                     Claude Code                       |
|                                                       |
|  Session start -> hub.py m:find -k "user,context"    |
|                         |                             |
|              +----------v----------+                  |
|              |   SQLite Graph DB   |                  |
|              |   Nodes + Edges +   |                  |
|              |   Bloom Filter      |                  |
|              +----------+----------+                  |
|                         |                             |
|         +---------------+---------------+             |
|         v               v               v             |
|     hub.py           rx.py        validate.py         |
|   (memory)        (binaries)      (findings)          |
|                                         |             |
|                              findings/program/bug/    |
|                              +-- report.md            |
+-------------------------------------------------------+

Memory Graph

hub.py stores knowledge as typed nodes in a SQLite graph and retrieves by keyword similarity via Dijkstra propagation.

Output format (§ compact - BPE-optimized)

§{id}·{type}·{score}·{keywords}·{content}    - node result
§{id}+                                         - created
⊕{a}->{b}->{c}·w{score}                       - hypothesis path
§bf·1·{key}                                   - bloom: already seen
∅                                             - empty

Node types

Code Full Use for
m mem User context, preferences, session state
t tech Techniques, methods, primitives
f find Discovered vulnerabilities
h hyp Unverified hypotheses
k kw Concept anchor nodes
r ref URLs, tools, references

Commands

# Session start (always run first)
hub.py m:find -k "user,context,pref" -n 5

# Save memory (instead of MEMORY.md)
hub.py m:add -t mem  -k "user,pref"       -c "user wants terse output"
hub.py m:add -t find -k "XSS,search,p1"  -c "XSS in ?q= - cookie theft confirmed"
hub.py m:add -t tech -k "UAF,heap,glibc" -c "UAF->64bit->rw->pc->ASLR,NX->grm->lk->ogl"

# Retrieve
hub.py m:find -k "UAF,heap"     -n 5          # standard
hub.py m:find -k "XSS,bypass"  -n 8 -x 3     # deep (depth=3)

# Batch - 1 subprocess call instead of N
hub.py m:batch -q 'a·m·user,pref·terse|f·UAF,heap·5·2'

# Associations
hub.py m:link  -s ID_A -d ID_B -r sup -w 0.9
hub.py m:hyp   -a ID_A -b ID_B    # hypothesis: chain between distant nodes

# I/O dedup
hub.py m:bloom  -k "https://target.com"    # 0=new 1=seen
hub.py m:bf:add -k "https://target.com"

Graph after seeding

The install seeds exploit primitives, mitigations, bypass techniques, and their relationships as a pre-built knowledge graph. m:hyp finds exploitation chains automatically:

hub.py m:hyp -a <UAF_node> -b <ogl_node>
-> ⊕UAF->arb_read->libc_leak->one_gadget·w0.578

Binary Analysis

rx.py is a drop-in replacement for common RE tools. Outputs § compact format for token efficiency.

rx.py i  ./target              # ELF info + checksec
rx.py c  ./target              # checksec only
rx.py d  ./target -F main -N 40      # disassemble function
rx.py d  ./target -O 0x1234  -N 20   # disassemble at offset
rx.py g  ./target -f "pop rdi" -n 30 # ROP gadgets with filter
rx.py s  ./target -f "system"        # symbol search
rx.py S  ./target -m 8               # strings (min len 8)
rx.py h  ./target -O 0x1000          # hexdump
rx.py x  ./target -a 0x4020          # xrefs to address
rx.py G  ./target                    # save analysis to graph + bloom

Token cost comparison:

Tool        40 instructions    Checksec output
-----------------------------------------------
objdump     ~720 tokens        ~80 tokens
rx.py       ~360 tokens        ~15 tokens
Savings     50%                81%

Example output:

§rx·i·target·ELF64·x86_64·ET_DYN·entry:0x1234
§rx·c·PIE NX RELRO_full canary
§rx·d·0x401234·4889e5·mov rbp,rsp
§rx·d·0x401237·4883ec10·sub rsp,0x10
§rx·g·0x401abc·pop rdi;ret

Only present mitigations are listed - absent ones cost zero tokens.


Finding Validation

The AI never reports a finding until it passes all gates.

# Quick kill-signal check (instant)
validate.py quick "SSRF dns-only" "POST /api/fetch" "dns callback" "HackerOne"
# -> KILL  NEVER_SUBMIT:ssrf dns only

# Full 7Q + 4 Gates pipeline
validate.py template > answers.json    # fill the template
validate.py check -f answers.json      # validate
# -> PASS  -> findings/program-xss/report.md written
# -> KILL  gate2:theoretical_impact | missing:q1_request

Auto-kill list

missing headers/CSP/HSTS    graphql introspection alone    version disclosure
cors wildcard alone          ssrf dns-only                  self-xss
open redirect alone          logout csrf                    rate limit non-critical
host header injection alone  session not invalidated        clickjacking non-sensitive

Kill signals by class

Class Signal Verdict
XSS CSP present + alert(1) only + no cookie KILL
SSRF DNS callback only, no HTTP response KILL
IDOR Own data only (attacker_id == victim_id) KILL
SQLi Error message only, no rows exfiltrated KILL
CORS No Access-Control-Allow-Credentials KILL
Auth Requires admin precondition KILL

4 Gates

Gate 0  HTTP request written + all required fields present
Gate 1  In-scope program + in-scope asset + realistic access + not known
Gate 2  Impact proven - no "could potentially" / "may allow"
Gate 3  Two sessions documented + anonymous repro tested

Chain required before reporting

Standalone + Chain Result
Open redirect + OAuth code theft ATO Critical
CORS wildcard + credentialed PII exfil High
SSRF dns-only + internal service data Medium
Self-XSS + CSRF trigger Medium

Token Economy

Sonnet's BPE vocabulary (~100K tokens) encodes common security terms cheaply:

UAF=1t  ROP=1t  BOF=1t  ASLR=1t  heap=1t  libc=1t  XSS=1t  SSRF=1t

vs

"use-after-free"=4t  "exploitation"=4t  "vulnerability"=4t  "primitive"=3t

Format savings

Format              Example                                       Tokens
-------------------------------------------------------------------------
JSON node           {"id":"a1b2","type":"mem","score":0.85,...}    35t
§ node              §a1b2·m·85·user,role·content                  12t  (-66%)

English analysis    "A UAF vulnerability allows arbitrary RW..."   70t
§XPL notation       ⊢UAF·64·prim:rw->pc·ASLR,NX·grm->lk->ogl     20t  (-71%)

objdump 40 lines    (raw output)                                  720t
rx.py 40 lines      (§ format)                                    360t  (-50%)

Depth guide

hub.py m:find -n 3 -x 1    fast context load    ~40 tokens
hub.py m:find -n 5 -x 2    standard (default)   ~80 tokens
hub.py m:find -n 8 -x 3    deep association      ~150 tokens

Use -x 3 only when standard search returns .


Exploit Dev

§XPL notation

⊢{vuln}·{arch}·prim:{gained}·mit:{mitigations}·chain:{bypass_steps}
⊢UAF·64·prim:rw->pc·ASLR,NX,PIE·chain:grm->lk->ogl
⊢BOF·heap·64·prim:rw·ASLR,NX,RELRO·chain:tcache_poison->lk->ogl
⊢tyc·V8·prim:rw->oob·ASLR,sandbox·chain:addrof->caged_ptr->wasm_rwx
⊢fmt·32·prim:rw·canary,ASLR·chain:fmt_lk_canary->fmt_write_got

1-token abbreviation table

Short Full Saved
vuln vulnerability 3t
xpl exploitation 3t
prim primitive 2t
UAF use-after-free 3t
BOF buffer overflow 3t
ogl one_gadget 2t
r2l ret2libc 2t
grm heap grooming 2t
lk libc leak 2t
gw GOT overwrite 3t

Workflow

scripts/rx.py i  ./target                           # checksec
scripts/rx.py s  ./target -f "gets\|strcpy\|system" # dangerous symbols
scripts/hub.py m:find -k "UAF,heap,glibc" -n 5     # known techniques
scripts/rx.py d  ./target -F vuln_func  -N 50       # disassemble
scripts/rx.py g  ./target -f "pop rdi"  -n 30       # gadgets
scripts/hub.py m:add -t find -k "UAF,heap,p0" \
  -c "⊢UAF·64·prim:rw->pc·ASLR,NX·chain:grm->lk->ogl @ /bin/target"
scripts/hub.py m:hyp -a {find_id} -b {ogl_id}      # auto-chain

File Structure

Exploit-Claude/
├── install.sh
├── scripts/
│   ├── hub.py            - memory graph CLI
│   ├── rx.py             - binary analysis CLI
│   └── validate.py       - 7Q+4Gates finding validator
├── skill/
│   ├── SKILL.md          - full command reference
│   └── CLAUDE.md         - Claude session rules + structure
├── core/
│   ├── graph.py          - SQLite graph + Bloom filter + Dijkstra
│   └── fmt.py            - BPE-compact output formatter
└── seeds/
    ├── exploit_kb.py     - exploit knowledge graph seed
    └── notes.py          - personal notes vault seed

data/ (graph.db) and vendor/ (pip packages) are created by install.sh and excluded from git.


Built from security researchers to security researchers.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages