🛡️ How the Web Works (for Web Application Pentesters)

Your Foundation for Hacking the Modern Web, One Request at a Time Before exploiting web applications, you must understand how they are built, behave, and break. This guide walks through key web technologies—like HTTP, sessions, REST APIs, and architectures—with a strong focus on how attackers manipulate them. 📑 Table of Contents Section Description 1️⃣ Understanding…

Your Foundation for Hacking the Modern Web, One Request at a Time

Before exploiting web applications, you must understand how they are built, behave, and break. This guide walks through key web technologies—like HTTP, sessions, REST APIs, and architectures—with a strong focus on how attackers manipulate them.


📑 Table of Contents

SectionDescription
1️⃣ Understanding the Web & the InternetNetworking basics for attackers
2️⃣ Request/Response Cycle for AttackersIdentifying attack entry points
3️⃣ HTTP, HTTP/2, and HTTPS for PentestersHeader tampering, encryption, and protocol downgrade attacks
4️⃣ Session Management VulnerabilitiesSession fixation, hijacking, JWT cracking
5️⃣ REST APIs in the CrosshairsAPI enumeration, broken object level auth
6️⃣ Web App Architecture for Recon & ExploitsMapping assets and understanding attack surface
7️⃣ Examples, Tools, and PayloadsFuzzers, proxies, scanners
🧠 Conclusion & Lab ResourcesPractice environments and next steps

1️⃣ Understanding the Web & the Internet

Pentesters must distinguish between network layers to know where to inject payloads.

💡 Focus Points:

  • OSI model (especially Layers 3–7)
  • TCP/IP stack
  • Ports and protocols (e.g., port 80/443 for HTTP/HTTPS)

🔎 Recon Tip:

  • Use nmap with service detection:
nmap -sV -p 1-1000 target.com

2️⃣ Request/Response Cycle for Attackers

Every web exploit happens in the HTTP request/response loop. Understanding this is critical.

🔍 Key Attack Vectors in HTTP Requests:

ComponentVulnerabilities
MethodVerb tampering (e.g., DELETE /users)
URLIDOR (Insecure Direct Object Reference), path traversal
HeadersHost header attacks, header injection
BodyXSS, SQLi, CSRF payloads

🛠️ Tools:

  • Burp Suite → Intercept and manipulate requests
  • OWASP ZAP → Passive and active scanning

3️⃣ HTTP, HTTP/2, and HTTPS for Pentesters

📡 HTTP

Plaintext, easy to intercept and modify. Vulnerable to MITM if no HTTPS.

⚡ HTTP/2

Better performance, multiplexed requests—but few tools support exploitation (yet). Check for misconfigurations.

🔐 HTTPS

Encrypted using TLS. Still vulnerable if:

  • Misconfigured TLS (check with ssllabs.com)
  • Downgrade attacks (e.g., SSLStrip)

🧪 Test:

curl -I http://target.com -H "Host: malicious.com"

4️⃣ Session Management Vulnerabilities

Web sessions are gold for attackers.

💣 Common Flaws:

IssueAttack
Session FixationForce session ID pre-login
Weak TokensBrute-force or predict session IDs
Missing HttpOnly/Secure flagsJS-accessible tokens or sent over HTTP
JWT MisuseNone algorithm abuse, key disclosure

🧰 Tools:

  • jwt.io for decoding
  • ffuf or burp intruder for brute-force
  • Check cookies in DevTools or Burp Proxy

🧪 Attack Example:

http
Cookie: session=admin

5️⃣ REST APIs in the Crosshairs

Modern web apps are API-driven—and APIs often lack security parity with UIs.

🚨 Common API Vulnerabilities:

  • BOLA (Broken Object Level Authorization)
  • Mass Assignment
  • Rate Limiting Bypass
  • Leaky Metadata in Swagger/OpenAPI

🛠️ Tools:

  • Postman: for crafting raw API calls
  • Burp Repeater: for parameter manipulation
  • Amass / Subfinder for subdomain enumeration

🔎 Try:

curl -X GET https://target/api/users/1

Then test for users/2, ../admin, etc.


6️⃣ Web App Architecture for Recon & Exploits

Pentesters map out the architecture to identify:

  • Hidden endpoints
  • Broken authentication
  • Unprotected admin panels
  • Misconfigured frontend/backend separation

🧱 Common Architectures:

LayerTech StackCommon Flaws
FrontendReact, AngularDOM-based XSS
BackendNode.js, DjangoLogic bugs, RCE
APIsREST/GraphQLIDOR, injection
DBSQL/MongoSQLi, NoSQLi

📸 Recon Tools:

  • Aquatone for screenshots
  • httpx to probe HTTP servers
  • Google Dorking to find dev panels

7️⃣ Examples, Tools, and Payloads

CategoryToolUse
ProxyBurp SuiteIntercept, modify requests
Fuzzerffuf / wfuzzBruteforce params, directories
ScannerNikto / NucleiVulnerability scanning
ReconSublist3r / AmassSubdomain discovery
PayloadsPayloadAllTheThingsExploits and fuzz strings
TestingHTTPBin / RequestBinObserve request behavior

🔫 Payload Example for XSS:

html
<script>alert('XSS')</script>

💣 CSRF Proof of Concept:

html
<img src="http://target.com/delete?id=1">

🧠 Conclusion & Lab Resources

🚀 Ready to Practice?

ResourcePurpose
PortSwigger LabsReal-world web vulnerabilities
Hack The BoxCTF-style web challenges
DVWADeliberately vulnerable web app
OWASP Juice ShopFull-stack app to exploit
bWAPPHundreds of web flaws

See also

You may also enjoy

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *