Webhacking

17 min read3,356 words

WEB HACKING

Web hacking asks:

“How does this application work, where does it trust the user, and can that trust be abused?”

All practical testing below should be performed only on your own applications, intentionally vulnerable labs, CTFs, or systems where you have explicit authorization.


1 What Is Web Hacking?

Web hacking is the security testing of:

  • Websites
  • Web applications
  • REST APIs
  • GraphQL APIs
  • Authentication systems
  • Session management
  • File-upload functionality
  • Databases behind applications
  • Web servers
  • Browser-side JavaScript
  • Business logic

A modern application usually looks like:

USER │ ▼ ┌──────────┐ │ Browser │ └────┬─────┘ │ HTTP/HTTPS │ ▼ ┌───────────────┐ │ Web Server / │ │ Reverse Proxy │ └───────┬───────┘ │ ▼ ┌───────────────┐ │ Application │ │ Backend │ └───────┬───────┘ │ ┌──────────┴──────────┐ ▼ ▼ Database APIs

A vulnerability can exist at any of these layers.


2 First: Understand How the Web Works

Before learning attacks, you need to understand normal web communication.

When you visit:

https://example.com

roughly:

Browser ↓ DNS ↓ IP address ↓ TCP/TLS ↓ HTTP request ↓ Web server ↓ Application ↓ HTTP response ↓ Browser

If you don't understand this flow, web hacking becomes memorization.


3 HTTP Request

A request might look conceptually like:

GET /profile HTTP/1.1 Host: lab.local User-Agent: Mozilla/0 Cookie: session=abc123

Important components:

GET ↓ HTTP Method /profile ↓ Path Host ↓ Target hostname Cookie ↓ Session information

4 HTTP Response

The server may respond:

HTTP/1.1 200 OK Content-Type: text/html Set-Cookie: session=abc123 <html> ... </html>

You need to understand:

  • Status code
  • Headers
  • Cookies
  • Response body
  • Redirects
  • Content type
  • Caching
  • Security headers

5 HTTP Methods

Know these extremely well:

MethodTypical Purpose
GETRetrieve data
POSTSubmit/create data
PUTReplace/update resource
PATCHPartially update
DELETEDelete resource
HEADHeaders only
OPTIONSSupported methods/capabilities

Example:

GET /users/10

versus:

DELETE /users/10

The difference can be enormous.


6 HTTP Status Codes

You should already know the basics from scanning, but web testing requires deeper understanding.

200 → Success 201 → Created 204 → Success, no content 301/302 → Redirect 400 → Bad Request 401 → Authentication required 403 → Forbidden 404 → Not Found 405 → Method Not Allowed 429 → Too Many Requests 500 → Server Error 502 → Bad Gateway 503 → Service Unavailable

During testing, status-code changes can provide important clues.


7 Cookies

Cookies are commonly used for:

  • Sessions
  • Preferences
  • Authentication state
  • Tracking

Example:

Cookie: session=abc123

Important cookie attributes include:

Secure HttpOnly SameSite Domain Path Expires/Max-Age

Secure

Cookie should only be sent over HTTPS.

HttpOnly

JavaScript cannot normally access the cookie through document.cookie.

SameSite

Controls when cookies are sent in cross-site contexts.

These aren't magic protections, but they are important security controls.


8 Sessions

Authentication and sessions are fundamental.

Example:

Login ↓ Username + Password ↓ Server verifies identity ↓ Session created ↓ Session ID stored in cookie ↓ Browser sends session on future requests

You should investigate:

How is the session generated? Is it unpredictable? Does logout invalidate it? Does login regenerate it? Can sessions be reused? Are cookies protected? Does changing privileges invalidate old sessions?

These are professional testing questions.


9 Authentication vs Authorization

Again:

Authentication

Who are you?

Authorization

What are you allowed to do?

Example:

Application │ ┌───────────┴───────────┐ ▼ ▼ Normal User Admin │ │ Own Profile Manage Users Own Orders Delete Users

A very common vulnerability is:

Authentication = Strong Authorization = Weak

10 Burp Suite — Your Main Web Hacking Tool

For practical web hacking, Burp Suite is extremely important.

Think of Burp as:

Browser ↓ BURP ↓ Application

Instead of:

Browser ───────────────→ Website

you have:

Browser ↓ Burp Proxy ↓ Website

This lets you inspect and modify authorized HTTP traffic.


11 Burp Proxy

You can see requests such as:

GET /profile HTTP/1.1 Host: lab.local Cookie: session=abc123

Then investigate how the application behaves when inputs change.

This is the foundation of manual web testing.


12 Burp Repeater

Repeater is one of the most useful Burp features.

Workflow:

Browser ↓ Request ↓ Send to Repeater ↓ Modify ↓ Send ↓ Compare response

For example:

GET /account?id=1001

You may test your authorized lab with:

GET /account?id=1002

Then compare:

Status Response size Returned data Headers Behavior

This is extremely useful for authorization testing.


13 Burp Intruder

Intruder can automate controlled input testing.

It can be useful for:

  • Parameter testing
  • Input variations
  • Fuzzing
  • Controlled authentication testing
  • Identifying unexpected behavior

Be careful with authentication-related automation because it can cause account lockouts or service load.


14 Burp Scanner

Burp can also automate vulnerability detection.

But remember what you learned in Vulnerability Assessment:

Scanner ↓ Possible finding ↓ Manual validation ↓ Confirmed vulnerability

Don't blindly report scanner output.


15 Web Application Attack Surface

When testing an application, map:

Application │ ├── Authentication │ ├── Login │ ├── Registration │ ├── Password reset │ └── MFA │ ├── User functions │ ├── Profile │ ├── Upload │ └── Settings │ ├── Business functions │ ├── Orders │ ├── Payments │ └── Discounts │ ├── APIs │ ├── REST │ └── GraphQL │ └── Administrative functions ├── Admin └── Management

This map becomes your testing plan.


16 Input Validation

Every user-controlled input should make you curious.

Inputs can come from:

URL parameters POST parameters JSON Cookies Headers File names File contents HTTP methods WebSocket messages

For example:

GET /search?q=laptop

The input is:

q=laptop

Ask:

Where does q go?

Possibilities:

q ↓ Database ↓ HTML ↓ Shell command ↓ File system ↓ Template

Different destinations create different vulnerability classes.


17 SQL Injection

One of the most famous web vulnerabilities.

Conceptually:

User Input ↓ Application ↓ SQL Query ↓ Database

If untrusted input is improperly incorporated into SQL, an attacker may influence the query.

Vulnerable concept

User input ↓ String concatenation ↓ SQL query

Safer approach

User input ↓ Parameterized query ↓ Database

Example of a safe design concept:

SELECT * FROM users WHERE id = ?

rather than constructing SQL by concatenating raw user input.


18 SQL Injection Types

You should eventually learn:

In-band SQLi Blind SQLi Boolean-based blind SQLi Time-based blind SQLi Error-based SQLi

But the important thing is understanding why injection happens.

Don't simply memorize payloads.


19 Cross-Site Scripting — XSS

XSS happens when untrusted data reaches a browser context in an unsafe way.

Conceptually:

Attacker-controlled input ↓ Web application ↓ HTML/JavaScript context ↓ Victim browser

Types:

Reflected XSS

Input is reflected immediately in a response.

Stored XSS

Input is stored by the application and later served to users.

DOM-based XSS

Client-side JavaScript creates the unsafe behavior.


20 Why XSS Matters

Depending on context and defenses, XSS can affect:

User interface Account actions Sensitive page data Application workflows

Modern browser protections and cookie attributes can reduce certain impacts, but they don't make XSS automatically harmless.


21 Command Injection

Another important class.

Conceptually:

User Input ↓ Application ↓ Operating System Command

If the application improperly places attacker-controlled input into a system command, command injection may occur.

Secure applications avoid constructing shell commands from untrusted input and use safer APIs/allowlists.


22 Path Traversal

Suppose an application accepts:

file=report.pdf

and constructs a filesystem path.

A vulnerability may occur if the user can manipulate the path to access files outside the intended directory.

Conceptually:

Web Application ↓ File parameter ↓ Filesystem

The correct defense involves:

  • canonicalization
  • strict allowlists
  • safe path handling
  • filesystem permissions

23 File Upload Vulnerabilities

File uploads are a major attack surface.

Example:

User ↓ Upload file ↓ Web application ↓ Storage

You should investigate:

Allowed extensions MIME validation Content validation Filename handling Storage location Execution permissions Access control Size limits Virus/malware scanning

A strong application should never rely solely on the filename extension supplied by the client.


24 Broken Access Control / IDOR

This is extremely important for bug bounty.

Imagine:

GET /api/orders/1001

User A owns order 1001.

You test another authorized lab account:

GET /api/orders/1002

If the server returns another user's order without proper authorization, you may have a broken access-control issue.

The vulnerability is not the number 1002.

The problem is:

The server failed to enforce authorization.


25 Horizontal vs Vertical Privilege

Horizontal privilege escalation

User A ↓ User B's data

Same privilege level, different user's resources.

Vertical privilege escalation

Normal User ↓ Admin functionality

Different privilege level.

You need to test both.


26 CSRF

Cross-Site Request Forgery abuses a victim's authenticated browser to perform an unintended action.

Conceptually:

Victim logged in ↓ Malicious/third-party page ↓ Browser sends request ↓ Application

Modern applications may use:

CSRF tokens SameSite cookies Origin/Referer checks

But you should understand how the application's particular protections work.


27 SSRF

Server-Side Request Forgery occurs when an attacker can influence the server into making a request.

Conceptually:

Attacker ↓ Web Application ↓ Server makes request ↓ Internal / unintended destination

Potentially sensitive destinations can exist inside private networks or cloud environments.

SSRF is especially important in modern cloud security.


28 Open Redirect

Suppose:

https://example.com/redirect?url=...

If the application redirects users to arbitrary external destinations without appropriate controls, it may have an open-redirect issue.

Impact varies.

It can sometimes contribute to:

Phishing Trust abuse OAuth-related attacks Attack chains

Don't automatically label every redirect as a high-severity vulnerability.


29 Security Headers

Important headers include:

Content-Security-Policy Strict-Transport-Security X-Content-Type-Options Referrer-Policy Permissions-Policy

You can inspect headers:

curl -I https://your-lab-target

Missing headers aren't automatically vulnerabilities.

You need to understand:

What protection does the header provide? Is it applicable to this application? What attack does it mitigate? What is the actual impact of its absence?

30 CORS

Cross-Origin Resource Sharing controls which origins can interact with certain browser resources.

Example:

Origin: https://example.com

Server might respond:

Access-Control-Allow-Origin: https://example.com

Potentially dangerous configurations can arise when sensitive data is exposed to untrusted origins.

You should understand:

Origin Access-Control-Allow-Origin Access-Control-Allow-Credentials Preflight requests OPTIONS

31 JWT Security

JSON Web Tokens are commonly used for API authentication.

Conceptually:

Header . Payload . Signature

Example structure:

xxxxx.yyyyy.zzzzz

The payload can contain claims such as:

sub role iat exp

Important testing areas include:

Signature validation Algorithm handling Expiration Issuer/audience validation Key management Authorization claims Token storage

A JWT being readable is not automatically a vulnerability; many JWT payloads are merely encoded, not encrypted.


32 REST API Testing

Modern applications often expose more functionality through APIs than through HTML.

Example:

GET /api/users/10

Test:

Authentication Authorization Input validation HTTP methods Rate limiting Error handling Data exposure Object-level authorization

Also inspect:

/api/v1/ /api/v2/ /api/internal/

when these are legitimately discoverable within your authorized target.


33 GraphQL

GraphQL often has a structure like:

/graphql

Instead of many REST endpoints, clients can query structured data through a GraphQL API.

You should learn:

Queries Mutations Schemas Resolvers Authorization Introspection Nested queries Resource limits

A GraphQL application can have unique authorization and resource-consumption problems.


34 WebSockets

Modern applications may use:

ws:// wss://

for real-time communication.

Examples:

Chat Notifications Live dashboards Games Trading interfaces

Testing involves examining:

Connection authentication Message authorization Input validation Origin handling Session handling

Burp Suite can help inspect WebSocket traffic.


35 Authentication Testing

A professional authentication assessment examines:

Registration ↓ Login ↓ Session creation ↓ Session management ↓ Password change ↓ Password reset ↓ Logout ↓ Account recovery

Questions:

Can an attacker enumerate accounts? Is MFA implemented correctly? Does logout invalidate the session? Are reset tokens unpredictable? Do reset tokens expire? Are old sessions invalidated after password changes?

36 Password Reset Testing

Password reset is often overlooked.

Normal workflow:

Forgot Password ↓ Email / OTP ↓ Verification ↓ New Password

You investigate whether:

Tokens are unpredictable Tokens expire Tokens are single-use Tokens are tied to the account Rate limiting exists

The key is understanding the security design, not simply trying random values.


37 Business Logic Testing

This is where human reasoning becomes extremely important.

Suppose an online store has:

Product = ₹1000 Coupon = 20% OFF

You should understand:

Can coupon be reused? Can it be applied multiple times? Can an expired coupon work? Can a user apply a coupon to an unauthorized order? Can the client alter price-related fields? Can workflow steps be skipped?

These are business-logic questions.

Automated scanners often struggle with them.


38 Race Conditions

A race condition occurs when application behavior depends on timing between concurrent operations.

Example concept:

Request A ────────┐ ├── Server Request B ────────┘

Potential areas:

Coupons Payments Account actions Inventory Password changes Transfers

Testing race conditions requires careful lab design because repeated requests can create unintended state changes.


39 Rate Limiting

Test whether sensitive operations are appropriately limited:

Login OTP Password reset API requests Expensive operations

But testing must remain within authorization and safe request limits.

You want to determine:

Is rate limiting present? How does it behave? Does it apply per account/IP/token? Does it recover correctly?

40 Error Handling

Errors can reveal information.

Example:

Normal: Invalid username/password

versus:

Database error: SQLSTATE...

Potential information leakage includes:

Stack traces Internal paths Database details Framework versions Debug information

Good applications return useful but appropriately limited error messages.


41 Source Code Review

If source code is available, your assessment becomes much more powerful.

You can trace:

Input ↓ Validation ↓ Business logic ↓ Database ↓ Output

Look for:

Unsafe SQL Hardcoded secrets Weak authorization Insecure cryptography Unsafe file operations Command execution Debug code

This is called white-box testing.


42 Black Box vs White Box vs Gray Box

Black Box

You have little internal information.

Tester ↓ Public application

White Box

You have source code/internal information.

Tester ↓ Source code ↓ Architecture ↓ Application

Gray Box

You have partial information.

Tester ↓ Limited credentials/documentation ↓ Application

Bug bounty is often closer to a black-box model.

Internal pentests may be gray-box or white-box.


43 Web Hacking Methodology

Here's the workflow I want you to memorize:

WEB TARGET │ ▼ INFORMATION GATHERING │ ▼ TECHNOLOGY IDENTIFICATION │ ▼ ATTACK SURFACE MAPPING │ ┌─────────────┼─────────────┐ ▼ ▼ ▼ AUTHENTICATION APIs INPUTS │ │ │ └─────────────┼─────────────┘ ▼ MANUAL TESTING │ ┌─────────────┼─────────────┐ ▼ ▼ ▼ ACCESS INJECTION LOGIC CONTROL FLAWS │ │ │ └─────────────┼─────────────┘ ▼ VALIDATE │ ▼ ASSESS IMPACT │ ▼ REPORT │ ▼ RETEST

🧪 Practical Web-Hacking Lab

For your learning, use:

Kali Linux │ ├── Firefox ├── Burp Suite ├── Nmap ├── ffuf/Gobuster ├── curl └── WhatWeb │ ▼ OWASP Juice Shop

You can run Juice Shop locally and practice without touching real websites.


Lab Exercise 1 — Intercept HTTP

Open your lab application through Burp.

Find:

GET / POST /login GET /profile

Study:

Headers Cookies Parameters Response Status codes

Lab Exercise 2 — Authentication

Create two test accounts:

User A User B

Map:

Login Logout Profile Password change

Understand the session behavior.


Lab Exercise 3 — Authorization

With two lab accounts:

User A → Resource A User B → Resource B

Determine whether User A can improperly access User B's resource.

You're learning Broken Access Control, not merely changing IDs.


Lab Exercise 4 — Input Analysis

Find an input:

/search?q=test

Trace:

Input ↓ Request ↓ Server ↓ Response

Ask where that value appears.


Lab Exercise 5 — API Mapping

Use Burp's HTTP history to identify:

/api/*

Create a list:

Endpoint Method Authentication Parameters Response

Lab Exercise 6 — Vulnerability Validation

Choose one intentionally vulnerable feature in Juice Shop.

Your report should contain:

Title Description Affected endpoint Steps Evidence Impact Root cause Remediation

This is much more valuable than simply completing a CTF flag.


📋 Your Web Hacking Checklist

You should eventually be comfortable with:

Web Fundamentals

  • HTTP/HTTPS
  • Requests
  • Responses
  • Methods
  • Headers
  • Cookies
  • Sessions
  • Status codes
  • Same-origin concepts

Burp Suite

  • Proxy
  • HTTP history
  • Repeater
  • Intruder
  • Decoder
  • Comparer
  • Scanner
  • WebSocket inspection

Authentication

  • Login
  • Registration
  • Session management
  • Password reset
  • MFA
  • Account recovery

Authorization

  • Horizontal access control
  • Vertical access control
  • IDOR/BOLA
  • Role manipulation

Injection

  • SQL Injection
  • XSS
  • Command Injection
  • LDAP Injection
  • Template Injection

Web vulnerabilities

  • CSRF
  • SSRF
  • Path Traversal
  • File Upload
  • Open Redirect
  • Security Misconfiguration
  • Information Disclosure

Modern Web

  • REST APIs
  • GraphQL
  • JWT
  • CORS
  • WebSockets
  • JavaScript analysis
  • Race Conditions
  • Rate Limiting
  • Business Logic

🔥 The Most Important Mindset

Don't approach a web application thinking:

“Which payload should I try?”

Approach it like this:

How does the application work? ↓ What does the user control? ↓ What does the server trust? ↓ Where does the data go? ↓ What security boundary exists? ↓ Can I cross that boundary? ↓ Can I prove it safely? ↓ What's the impact? ↓ How should it be fixed?

That mindset will take you much further than memorizing hundreds of payloads.


🧠 Your Complete Progress So Far

01. METHODOLOGY ↓ How professional security testing works 02. RECONNAISSANCE ↓ Discover what exists 03. SCANNING ↓ Discover what is reachable 04. VULNERABILITY ASSESSMENT ↓ Discover and validate weaknesses 0 WEB HACKING ↓ Understand and test applications ├── HTTP ├── Burp Suite ├── Authentication ├── Authorization ├── APIs ├── Injection ├── XSS ├── CSRF ├── SSRF ├── File Upload ├── JWT ├── CORS └── Business Logic

🎯 One important recommendation

Don't rush through this topic.

Web Hacking is large enough to become its own specialization. Your next stage after understanding these concepts should be hands-on practice with Burp Suite + OWASP Juice Shop/DVWA, where you learn each vulnerability by observing the request → modifying it → understanding the server response → proving the flaw → writing the report.

Keep learning. Keep building. Keep growing.

© 2026 Ugenz Academy