Domain 2Web App AttacksCORE

Client-Server Architecture

Foundational client-server model covering components, communication patterns, attack vectors, and defensive strategies essential for web application security assessments.

Domain: Domain 2: Web Application Penetration Testing•Updated: 2026-09-01
#client-server#architecture#web-fundamentals#oscp

Client-Server Architecture

Overview

The client-server model is the fundamental architecture underlying all web communication. Understanding this model is essential for OSCP because every web application vulnerability you will encounter during the exam operates within this framework. As a penetration tester, you are typically the “client” sending crafted requests to a target “server” to discover and exploit weaknesses.

Core Concepts

The Client-Server Model

In the client-server model, two distinct entities communicate over a network:

  • Client: The entity that initiates requests. During OSCP, you act as the client using tools like Burp Suite, curl, sqlmap, or custom scripts.
  • Server: The entity that receives, processes, and responds to requests. The target web server (Apache, Nginx, IIS) is your primary adversary.

The communication follows a request-response cycle:

  1. Client sends an HTTP request to the server.
  2. Server processes the request (may query databases, run business logic).
  3. Server sends an HTTP response back to the client.
  4. Client renders or processes the response.

Key Architectural Components

Component Role Common Implementations OSCP Relevance
Client Sends requests, renders responses Burp Suite, curl, wget, Python scripts Your attack surface; you control this
Load Balancer Distributes traffic across servers HAProxy, Nginx, AWS ELB May hide backend topology; can be bypassed
Web Server Receives HTTP requests, serves content Apache, Nginx, IIS Primary target for web exploits
Application Server Executes business logic Tomcat, Node.js, Django, JBoss Where vulnerabilities often reside
Database Server Stores and retrieves persistent data MySQL, PostgreSQL, MSSQL, MongoDB Target of SQL injection, direct access
Reverse Proxy Front-end for backend services Nginx, Apache mod_proxy Can leak internal IPs, enable SSRF

Architecture Diagrams

Simple Two-Tier Architecture

┌──────────────┐         HTTP/HTTPS         ┌──────────────┐
│   CLIENT     │ ──────────────────────────> │  WEB SERVER  │
│  (Browser)   │ <────────────────────────── │  (Apache)    │
│  Attacker    │    Response (HTML/JSON)     └──────┬───────┘
└──────────────┘                                   │
                                                    │ Query
                                               ┌────▼───────┐
                                               │ DATABASE   │
                                               │ (MySQL)    │
                                               └────────────┘

Three-Tier Architecture (Common in OSCP Labs)

┌──────────────┐    HTTP    ┌──────────────┐    Internal    ┌──────────────┐
│   CLIENT     │ ─────────> │  WEB SERVER  │ ─────────────> │  APP SERVER  │
│  (Burp)      │ <───────── │  (Nginx)     │ <───────────── │  (Tomcat)    │
└──────────────┘   Response └──────────────┘                └──────┬───────┘
                                                                   │
                                                              ┌────▼───────┐
                                                              │  DATABASE  │
                                                              │ (PostgreSQL)│
                                                              └────────────┘

Communication Protocols

Protocol Port Encrypted? OSCP Use
HTTP 80 No Intercept with Burp, modify requests
HTTPS 443 Yes Burp CA cert needed for interception
FTP 21 No File transfer, anonymous access
SSH 22 Yes Post-exploitation, pivoting
RDP 3389 Partial Windows post-exploitation
SMB 445 Partial Windows file sharing, exploits

Attack Vectors

1. Direct Server Access

Concept: Bypass the load balancer or reverse proxy to directly access backend servers.

How it works:

  • Load balancers distribute traffic but backend servers may be accessible on internal networks.
  • If you discover an internal IP address (via error messages, SSRF, or DNS), you may access backend services directly.

OSCP Example:

# Discover internal IP from error message
curl http://target.com/api/data
# Response: "Connection refused to 192.168.1.50:3306"

# Directly access the database
mysql -h 192.168.1.50 -u root -p

Detection Methods:

  • Analyze error messages for internal IP addresses.
  • Use SSRF to probe internal services.
  • Check DNS records for internal hostnames.
  • Examine HTTP response headers (X-Forwarded-For, X-Real-IP).

2. Server Misconfiguration

Concept: Exploit default configurations, exposed admin panels, or unnecessary services.

Common Misconfigurations:

  • Default credentials on admin panels (/admin, /phpmyadmin, /manager/html).
  • Server-status pages left enabled (/server-status, /server-info).
  • Debug mode enabled in production (Django debug pages, PHP info).
  • Directory listing enabled (Nginx autoindex on, Apache Options Indexes).

OSCP Example:

# Check for server-status
curl http://target.com/server-status

# Check for phpMyAdmin
curl http://target.com/phpmyadmin/

# Try default credentials
# phpMyAdmin: root / (empty)
# Tomcat Manager: admin / admin
# Jenkins: admin / admin

3. Man-in-the-Middle (MitM)

Concept: Intercept and modify unencrypted traffic between client and server.

When applicable:

  • HTTP (not HTTPS) traffic on the same network segment.
  • When you can position yourself between the client and server.

OSCP Relevance:

  • Use Burp Suite as an intercepting proxy.
  • Capture login credentials sent over HTTP.
  • Modify requests to test for injection vulnerabilities.

Tools:

# Burp Suite (GUI) - configure browser proxy to 127.0.0.1:8080
# mitmproxy (CLI alternative)
mitmproxy

# sslstrip for HTTPS stripping (older technique)
sslstrip -l 8080

4. Resource Exhaustion

Concept: Overwhelm server resources to cause denial of service.

Types:

  • DoS (Denial of Service): Single source flooding.
  • DDoS (Distributed DoS): Multiple sources flooding.

OSCP Note: DoS attacks are generally out of scope for OSCP exams. Focus on exploitation rather than disruption. However, understanding resource limits can help with:

  • File upload size limits (bypass with chunked encoding).
  • Rate limiting bypass (timing attacks).
  • Slowloris-style attacks (keeping connections open).

Practical Lab Exercises

Exercise 1: Map the Architecture

Objective: Identify all components in a target web application’s architecture.

Steps:

  1. Use nmap to scan for open ports and services.
  2. Identify the web server type from response headers.
  3. Find the application framework (Wappalyzer, whatweb).
  4. Discover database technology from error messages.
  5. Map the request flow using Burp Suite.
# Port scanning
nmap -sV -sC -p- target.com

# Technology detection
whatweb http://target.com

# Check response headers
curl -I http://target.com

Exercise 2: Bypass a Reverse Proxy

Objective: Access a backend server directly, bypassing the front-end proxy.

Steps:

  1. Identify the reverse proxy from response headers.
  2. Find the backend server’s IP address (error messages, SSRF).
  3. Access the backend directly using the discovered IP.
# Check for proxy headers
curl -I http://target.com
# Look for: X-Forwarded-For, X-Real-IP, Via

# If SSRF exists, probe internal services
curl http://target.com/fetch?url=http://127.0.0.1:8080/admin

Exercise 3: Exploit Server Misconfiguration

Objective: Find and exploit a misconfigured server component.

Steps:

  1. Enumerate common paths (gobuster, ffuf).
  2. Check for default credentials.
  3. Exploit the misconfiguration to gain access.
# Directory enumeration
gobuster dir -u http://target.com -w /usr/share/wordlists/dirb/common.txt

# Try default credentials on discovered admin panels
# Common defaults: admin/admin, root/root, admin/password

Tools Reference

Tool Purpose Command Example
Burp Suite Intercepting proxy, request modification Configure browser proxy to 127.0.0.1:8080
curl HTTP requests from CLI curl -v http://target.com
nmap Port scanning, service detection nmap -sV -p 80,443,8080 target
whatweb Technology identification whatweb http://target.com
gobuster Directory/file enumeration gobuster dir -u http://target -w wordlist.txt
ffuf Fast web fuzzer ffuf -u http://target/FUZZ -w wordlist.txt
Wappalyzer Browser extension for tech detection Install in Firefox/Chrome

Defensive Strategies

For Defenders

  1. Network Segmentation: Place backend services on internal networks, inaccessible from the internet.
  2. Reverse Proxies: Use Nginx or Apache as a reverse proxy to hide backend infrastructure.
  3. Firewall Rules: Restrict access to management interfaces (phpMyAdmin, Tomcat Manager).
  4. Remove Default Accounts: Disable or rename default admin accounts.
  5. Disable Unnecessary Services: Turn off server-status, server-info, and debug pages.
  6. Rate Limiting: Implement rate limiting to prevent brute-force and DoS attacks.
  7. HTTPS Enforcement: Use HSTS headers to force encrypted communication.
  8. Security Headers: Implement CSP, X-Frame-Options, X-Content-Type-Options.

Architecture Hardening Checklist

  • Backend servers not directly accessible from internet
  • Default credentials changed on all services
  • Debug mode disabled in production
  • Server version information hidden from headers
  • Directory listing disabled
  • Unnecessary HTTP methods disabled (TRACE, OPTIONS)
  • Rate limiting implemented on authentication endpoints
  • HTTPS enforced with valid certificates
  • Security headers configured
  • Regular security audits and penetration tests scheduled

Key Takeaways for OSCP

  1. Every web attack starts with understanding the architecture. Before exploiting, map the target’s components and their relationships.

  2. Error messages are goldmines. They often reveal internal IP addresses, technology stacks, file paths, and database types.

  3. Default credentials are still common. Always try common defaults on admin panels, database interfaces, and management consoles.

  4. Burp Suite is your primary client. Master intercepting, modifying, and replaying HTTP requests.

  5. The three-tier architecture is most common in OSCP labs. Expect a web server (Nginx/Apache) fronting an application server (Tomcat/Node.js/Django) connected to a database (MySQL/PostgreSQL/MSSQL).

  6. Information gathering is half the battle. The more you know about the target’s architecture, the easier exploitation becomes.

Exam Tips

  • When you encounter a web application, first identify the server type, framework, and database.
  • Check response headers for technology clues (Server, X-Powered-By, X-AspNet-Version).
  • Look for admin panels, debug pages, and API documentation.
  • Pay attention to error messages — they often contain internal IPs, file paths, and stack traces.
  • Use Burp Suite’s site map to understand the application’s structure.
  • Document your findings — the OSCP report requires detailed evidence of your methodology.