| name | web-pentesting |
| description | Web application penetration testing methodology. Use this skill whenever the user needs to assess web applications for security vulnerabilities, enumerate web services, identify technologies, discover hidden endpoints, or perform security testing on HTTP/HTTPS services. Trigger for any web security assessment, bug bounty hunting, CTF web challenges, or vulnerability scanning tasks on ports 80/443. |
Web Application Penetration Testing
A comprehensive methodology for security testing web applications. This skill guides you through systematic enumeration, vulnerability discovery, and assessment of web services.
When to Use This Skill
Use this skill when:
- Assessing web applications for security vulnerabilities
- Performing bug bounty hunting on web targets
- Testing HTTP/HTTPS services (ports 80/443)
- Enumerating web technologies and versions
- Discovering hidden endpoints, files, or parameters
- Conducting CTF web challenges
- Performing security audits on web infrastructure
Methodology Overview
Follow this systematic approach for each target domain, subdomain, or IP:
- Technology Identification - Identify web server, frameworks, and versions
- Initial Checks - Check robots.txt, sitemap, error pages, SSL/TLS
- Spidering - Crawl to discover all paths, files, and parameters
- Directory Brute-Forcing - Find hidden directories and files
- Backup File Discovery - Look for exposed backups and configs
- Parameter Discovery - Find hidden form/query parameters
- Vulnerability Testing - Test discovered endpoints for vulnerabilities
1. Technology Identification
Identify Web Server and Technologies
Check HTTP headers and use automated tools to identify technologies:
curl -I https://target.com
whatweb -a 1 https://target.com
whatweb -a 3 https://target.com
webtech -u https://target.com
Check for Known Vulnerabilities
Once you identify the technology and version:
- Search for CVEs related to the specific version
- Check if the technology has known default credentials
- Look for specialized scanners for that technology
Check for WAF (Web Application Firewall)
wafw00f https://target.com
whatwaf https://target.com
nmap --script http-waf-detect https://target.com
Technology-Specific Tricks
If you identify specific technologies, apply targeted techniques:
- WordPress: Use wpscan, check for plugin vulnerabilities
- Drupal: Use droopescan, check for known exploits
- Joomla: Use joomscan, check for component vulnerabilities
- Apache/Nginx: Check for misconfigurations, directory traversal
- PHP: Look for file inclusion, code execution vulnerabilities
- Git: If .git is exposed, extract repository contents
- S3 Buckets: Check for public read/write permissions
2. Initial Checks
Default Information Pages
Check these common paths for information disclosure:
/robots.txt
/sitemap.xml
/crossdomain.xml
/clientaccesspolicy.xml
/.well-known/
Force Error Pages
Web servers may reveal information through error responses:
curl https://target.com/whatever_fake.php
curl https://target.com/nonexistent.aspx
curl -H "Cookie: test=[]" https://target.com
curl "https://target.com/page?param=[[]]"
curl -X PATCH https://target.com
curl -X DEBUG https://target.com
curl -X FAKE https://target.com
SSL/TLS Vulnerability Check
testssl.sh --htmlfile https://target.com:443
sslscan target.com:443
sslyze --regular target.com:443
Critical checks:
- Is HTTPS enforced? (MitM vulnerability if not)
- Are passwords sent over HTTP? (High severity)
- Are there weak cipher suites?
3. Spidering
Spider the application to discover all accessible paths, files, and parameters.
Spidering Tools
katana -u https://target.com -J -d 3 -s /tmp/spider-output.txt
feroxbuster -u https://target.com -w /usr/share/wordlists/dirb/common.txt
gospider -S https://target.com -d 3 -t 10 -o /tmp/gospider-output.txt
python3 LinkFinder.py -d 3 -i /tmp/page.html -o /tmp/linkfinder-output
gau https://target.com > /tmp/gau-urls.txt
paramspider -d target.com -o /tmp/params.txt
JavaScript Analysis
JavaScript files often contain hidden endpoints and API keys:
python3 LinkFinder.py -f /path/to/file.js -o /tmp/js-endpoints
jsluice /path/to/file.js
python3 SecretFinder.py -f /path/to/file.js
4. Directory Brute-Forcing
Systematically discover hidden directories and files.
Brute-Force Tools
gobuster dir -w /usr/share/wordlists/dirb/common.txt -u https://target.com
gobuster dir -w /usr/share/wordlists/dirb/big.txt -u https://target.com -r
feroxbuster -u https://target.com -w /usr/share/wordlists/dirb/big.txt -r
dirsearch -u https://target.com -w /usr/share/wordlists/dirb/common.txt -r
ffuf -w /usr/share/wordlists/dirb/big.txt -u https://target.com/FUZZ
wfuzz -w /usr/share/wordlists/dirb/common.txt https://target.com/FUZZ
Recommended Wordlists
/usr/share/wordlists/dirb/common.txt
/usr/share/wordlists/dirb/big.txt
/usr/share/wordlists/dirbuster/directory-list-2.3-medium.txt
https://github.com/danielmiessler/SecLists/tree/master/Discovery/Web-Content
https://wordlists.assetnote.io
Important: Recursive Discovery
Any new directory discovered should be brute-forced recursively. This is critical for finding deeply nested resources.
5. Backup File Discovery
Look for exposed backup files, configuration files, and sensitive data.
Common Backup Extensions
Check these variations for each discovered file:
file.ext~
#file.ext#
~file.ext
file.ext.bak
file.ext.tmp
file.ext.old
file.bak
file.tmp
file.old
file.ext.swp
file.ext.orig
Automated Backup Checking
bfac -u https://target.com -w /path/to/wordlist.txt
curl https://target.com/.env
curl https://target.com/.git/config
curl https://target.com/config.php.bak
curl https://target.com/wp-config.php.bak
Sensitive Files to Check
.env
.git/
.git/config
.git/HEAD
.htaccess
.htpasswd
config.php
config.php.bak
wp-config.php
wp-config.php.bak
web.config
application.properties
6. Parameter Discovery
Find hidden form and query parameters that may be vulnerable.
Parameter Discovery Tools
arjun -i https://target.com -o /tmp/arjun-output.txt
parameth -u https://target.com
x8 -u https://target.com
Parameter Wordlists
https://github.com/s0md3v/Arjun/tree/master/arjun/db
https://github.com/PortSwigger/param-miner/blob/master/resources/params
https://wordlists.assetnote.io/parameters_top_1m
7. Special Findings
.git Repository Exposure
If you find a .git directory exposed:
git clone file://https://target.com/.git /tmp/leaked-git
cd /tmp/leaked-git
git log --all
git show HEAD
API Key Discovery
If you find API keys, check their permissions:
gmapapiscanner --key AIzaSy...
trufflehog --regex --entropy 4.5 /path/to/files/
keyhacks
S3 Bucket Discovery
While spidering, look for S3 bucket references and check permissions:
aws s3 ls s3://bucket-name/
aws s3api get-bucket-policy --bucket bucket-name
502 Proxy Error (SSRF)
If you see 502 errors, test for SSRF:
curl -H "Host: google.com" https://target.com
NTLM Authentication Info Disclosure
curl -H "Authorization: NTLM TlRMTVNTUAABAAAAB4IIAAAAAAAAAAAAAAAAAAAAAAA=" https://target.com
nmap --script http-ntlm-info https://target.com
8. Vulnerability Testing
After enumeration, test discovered endpoints for vulnerabilities:
Common Vulnerability Types
- SQL Injection - Test all parameters with SQL payloads
- XSS (Cross-Site Scripting) - Test input fields and parameters
- Command Injection - Test for OS command execution
- File Inclusion - Test for LFI/RFI vulnerabilities
- Authentication Bypass - Test login mechanisms
- Authorization Issues - Test for IDOR, privilege escalation
- SSRF - Test for server-side request forgery
- XXE - Test XML parsing endpoints
- CSRF - Test state-changing operations
- Insecure Direct Object References - Test for IDOR
Automated Scanners
nikto -h https://target.com
wapiti -u https://target.com
nuclei -u https://target.com
node puff.js -w ./wordlist-examples/xss.txt -u "https://target.com/?query=FUZZ"
CMS-Specific Scanners
wpscan --url https://target.com --enumerate ap,at,cb,dbe
wpscan --url https://target.com --enumerate u,tt,t,vp --passwords /path/to/passwords.txt
droopescan scan -t https://target.com
joomscan -u https://target.com
cmsmap -f W -F -d https://target.com
cmsmap -f J -F -d https://target.com
cmsmap -f D -F -d https://target.com
9. Monitoring
Monitor pages for changes that might indicate new vulnerabilities:
Quick Reference Commands
Rapid Web Assessment
whatweb -a 3 https://target.com
nikto -h https://target.com
gobuster dir -w /usr/share/wordlists/dirb/common.txt -u https://target.com
katana -u https://target.com -J -d 3
curl https://target.com/.git/config
curl https://target.com/.env
WordPress Specific
wpscan --url https://target.com --enumerate ap,at,cb,dbe,u,tt,t,vp --passwords /path/to/passwords.txt
hydra -l admin -P /path/to/passwords.txt target.com -V http-form-post '/wp-login.php:log=^USER^&pwd=^PASS^&wp-submit=Log In&testcookie=1:S=Location'
Drupal Specific
droopescan scan -t https://target.com
git clone https://github.com/immunIT/drupwn.git
cd drupwn && python3 drupwn.py -u https://target.com
Best Practices
- Always enumerate first - Don't jump to exploitation without understanding the target
- Document everything - Keep track of discovered endpoints, parameters, and findings
- Test recursively - Any new directory should be brute-forced
- Check backups - Backup files often contain sensitive information
- Analyze JavaScript - JS files frequently contain hidden endpoints and API keys
- Use multiple tools - Different tools find different things
- Manual testing - Automated tools miss context-specific vulnerabilities
- Respect scope - Only test targets within your authorization
Output Format
When reporting findings, use this structure:
# Web Security Assessment Report
## Target
- URL: https://target.com
- IP: x.x.x.x
- Date: YYYY-MM-DD
## Technology Stack
- Web Server: Apache 2.4.41
- CMS: WordPress 5.8.2
- Plugins: [list]
- Themes: [list]
## Discovered Endpoints
- /admin/
- /wp-admin/
- /api/v1/
- [list all discovered paths]
## Vulnerabilities Found
### Critical
- [vulnerability description]
- [proof of concept]
- [impact]
### High
- [vulnerability description]
### Medium
- [vulnerability description]
### Low
- [vulnerability description]
## Recommendations
- [remediation steps]
Scripts
Use the bundled scripts for common tasks:
scripts/quick-web-scan.sh - Rapid technology identification and vulnerability scanning
scripts/directory-bruteforce.sh - Systematic directory enumeration
scripts/backup-file-check.sh - Check for exposed backup files
scripts/parameter-discovery.sh - Find hidden parameters
scripts/tech-identification.sh - Comprehensive technology detection
Run scripts with:
./scripts/quick-web-scan.sh https://target.com
./scripts/directory-bruteforce.sh https://target.com
Notes
- This methodology assumes you have authorization to test the target
- Always follow responsible disclosure practices
- Document all findings with evidence
- Consider the impact of your testing on production systems
- Some automated scans may be noisy - coordinate with target owners
- For bug bounty programs, follow the program's specific rules and scope