Overview
HTTP Slowloris is a low-bandwidth, high-impact denial of service attack that keeps HTTP connections open for as long as possible by sending partial HTTP requests. Unlike volumetric attacks, Slowloris requires minimal bandwidth and can take down a server with just a few hundred concurrent connections.This attack exploits how web servers handle concurrent connections, not bandwidth.
How it works
The Slowloris attack operates by:- Connection Establishment: Opens raw TCP or TLS connection to the target server
- Partial Request: Sends incomplete HTTP headers:
- Slow Drip: Sends headers one at a time with delays between each
- Keep-Alive Headers: Periodically sends
X-a: b\r\nto keep connection alive - Never Complete: Intentionally never sends the final
\r\n\r\nto complete the request - Connection Pool Exhaustion: Server keeps connections open waiting for complete headers
- Concurrent Threads: Multiple threads each maintain slow connections
Attack flow
When to use
Slowloris is effective for:- Connection limit testing: Test server’s maximum concurrent connection handling
- Timeout configuration validation: Verify proper timeout settings
- Resource exhaustion scenarios: Simulate attacks that exhaust file descriptors/sockets
- Load balancer testing: Test if load balancers properly detect and close slow connections
- Low-bandwidth attack simulation: Demonstrate that DDoS doesn’t always mean high traffic
Usage
Basic Slowloris attack:Parameters
Target URL including protocol (http:// or https://)
Attack duration in seconds. Longer durations are more effective.
Delay between header packets in milliseconds. Higher = slower drip = longer connections.
Not used in Slowloris (kept for API consistency)
Number of concurrent slow connections (0 = number of CPU cores). Higher is more effective.
Show detailed logs for each slow connection established
Allow running without proxies. Note: Your IP will be exposed.
Expected behavior
Console output
Standard mode:Connection behavior
- Initial connection: Quick TCP/TLS handshake
- Header drip rate: One header per
--delaymilliseconds - Keep-alive interval:
X-a: bheader sent every--delaymilliseconds after initial headers - Connection lifetime: Remains open until server timeout or attack stops
- Resource usage: Minimal bandwidth, moderate memory per connection
Technical implementation
Implementation details frominternal/attacks/http/slowloris.go:20-87:
- Raw socket usage: Opens TCP/TLS connections directly (not via HTTP client)
- Protocol detection: Uses
tcpscheme for HTTP,tlsscheme for HTTPS - Port handling: Defaults to 80 (HTTP) or 443 (HTTPS) if not specified
- Proxy support: Routes through SOCKS/HTTP proxies when available
- Goroutine per connection: Each connection runs in separate goroutine
- Buffered writer: Uses
bufio.Writerfor controlled header sending - Context awareness: Respects cancellation for graceful shutdown
Header sequence
Optimization strategies
Maximizing connection count
Maximizing connection count
- Increase
--threadsto 500-1000 for maximum concurrent connections - Use
--delay 5000(5 seconds) to keep connections open longer - Longer
--durationensures connections stay active - More proxies = more unique source IPs = harder to block
Balancing stealth vs impact
Balancing stealth vs impact
- Lower
--threads(50-100) for stealthier attacks - Higher
--delay(10000ms+) for slower, harder-to-detect drip - Use residential proxies to avoid data center IP blocking
- Combine with other traffic for camouflage
Resource management
Resource management
- Each thread maintains one slow connection at a time
- Memory usage: ~4-8KB per active connection
- CPU usage: Minimal (mostly idle waiting)
- Network: ~100 bytes per second per connection
Server-side detection
Server-side detection
- Monitor for incomplete HTTP requests
- Track connection duration averages
- Alert on high count of ESTABLISHED connections
- Implement aggressive timeouts for header completion
Mitigation techniques
If you’re defending against Slowloris:Implement request timeouts
Configure aggressive timeouts for incomplete HTTP requests (5-10 seconds).
Use reverse proxy
Deploy nginx, HAProxy, or similar to buffer requests before reaching application servers.
Server-specific vulnerabilities
Vulnerable servers:
- Apache HTTP Server (without
mod_reqtimeout) - Basic Python/Node.js HTTP servers
- Misconfigured IIS servers
- nginx (proper timeout config)
- Apache with
mod_reqtimeout - HAProxy / Cloudflare / CDNs with DDoS protection
Real-world example
Testing connection limit on Apache server:Related attack methods
HTTP Flood
High-volume HTTP request attack
HTTP Bypass
Stealth HTTP attack with browser mimicry
TCP Flood
Layer 4 TCP connection flood