Proxy Server
Table of Contents
An intermediary between a client and a server that forwards requests on the client's behalf. The destination server sees the proxy's IP, not the client's. Proxies serve many purposes — from corporate content filtering to penetration testing tooling to network pivoting.
Related: Burp Suite Pivoting pfSense
Types
Forward Proxy
Client-side — the client is configured to route traffic through it. The proxy makes requests to the internet on the client's behalf.
Client → Forward Proxy → Internet
Use cases: corporate internet filtering, anonymisation, bypassing geo-restrictions, Burp Suite intercepting browser traffic.
Reverse Proxy
Server-side — sits in front of one or more backend servers. Clients connect to the proxy; they may not know the real server exists.
Internet → Reverse Proxy → Backend Server(s)
Use cases: load balancing, TLS termination, WAF, CDN caching, hiding backend infrastructure.
Common implementations: Nginx, HAProxy, AWS ALB, Cloudflare.
Transparent Proxy
Neither client nor server is aware — traffic is intercepted at the network level (router/firewall). No client configuration required.
Use cases: corporate monitoring, ISP traffic shaping, caching.
SOCKS Proxy
Protocol-agnostic — can proxy any TCP (or UDP with SOCKS5) traffic, not just HTTP. Does not modify the traffic.
Use cases: SSH dynamic forwarding, Chisel, Tor, network pivoting.
SOCKS4: TCP only, no authentication SOCKS5: TCP + UDP, authentication support
Security Relevance
Burp Suite as an Intercepting Proxy
Burp sits between the browser and the target, intercepting and modifying HTTP/S requests and responses.
Browser → Burp (127.0.0.1:8080) → Target server
Configure browser proxy to 127.0.0.1:8080, install Burp's
CA certificate. See Burp Suite for full setup.
Proxychains — Routing Tools Through a Proxy
Routes command-line tool output through a SOCKS or HTTP proxy — essential for accessing internal networks after pivoting.
# Configure /etc/proxychains.conf # [ProxyList] # socks5 127.0.0.1 1080 # Route nmap through proxy proxychains nmap -sT -Pn 192.168.1.0/24 # Route other tools proxychains curl http://192.168.1.50 proxychains python3 exploit.py
See Pivoting for SSH dynamic forwarding, Chisel, and Ligolo setups that provide the SOCKS listener proxychains connects to.
SOCKS Proxy via SSH
# Open SOCKS5 proxy on localhost:1080 through a jump host ssh -D 1080 -N user@jumphost # Then route tools through proxychains proxychains curl http://internal-server
Proxy Evasion (Red Team)
Proxies and WAFs inspect HTTP traffic — common evasion:
— Encoding: URL-encode, double-encode, Unicode-encode payloads — Case variation: bypasses simple string-match rules — Chunked transfer encoding: splits payload across chunks — HTTP/2: some proxies inspect only HTTP/1.1 — Non-standard headers: inject payload in headers the proxy ignores — HTTPS: older transparent proxies cannot inspect without MITM setup
Proxy Detection (Blue Team)
Anomalies suggesting proxy use by an internal host:
— CONNECT method in HTTP logs (used by forward proxies for HTTPS) — Traffic to known proxy/anonymiser IP ranges (Tor exit nodes, VPN providers) — Unusual user agents matching proxy tools — All traffic from one host going to a single external IP (SOCKS proxy) — DNS requests suddenly absent (proxy may handle DNS resolution)
Configuration Examples
Nginx as Reverse Proxy
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
System-wide HTTP proxy (Linux)
export http_proxy="http://proxy.company.com:8080" export https_proxy="http://proxy.company.com:8080" export no_proxy="localhost,127.0.0.1,internal.company.com" # For apt echo 'Acquire::http::Proxy "http://proxy.company.com:8080";' \ >> /etc/apt/apt.conf
Tips
- proxychains requires
-sT(TCP connect) with nmap — SYN scans require raw sockets which cannot go through a SOCKS proxy - Burp's invisible proxy mode (Project Options → Connections) allows interception without browser proxy configuration — useful for thick clients
- A reverse proxy hiding the real backend IP is common in production — Shodan and Censys may still index the real IP from certificate transparency records
- X-Forwarded-For header is set by forward proxies to pass the original client IP — applications trusting this header without validation are vulnerable to IP spoofing