TL;DR
You’re seeing a lot of strange-looking HTTP requests hitting your server. This is likely a denial-of-service (DoS) or distributed denial-of-service (DDoS) attack, or possibly a bot scanning for vulnerabilities. We’ll cover how to identify the problem and take steps to mitigate it.
1. Confirm the Problem
- Check Server Logs: Look at your web server logs (e.g., Apache access logs, Nginx access logs, IIS logs). Focus on recent entries.
- Identify Patterns: Are there common characteristics in the malformed requests?
- Source IPs: Are they all coming from a few addresses or many different ones?
- User-Agent Strings: Do they use unusual or missing User-Agents?
- Requested URLs: Are they targeting specific pages, or random paths?
- HTTP Methods: Are they using standard methods (GET, POST) or something else?
- Request Size: Are the requests unusually large?
- Monitor Server Resources: Use tools like
top(Linux), Task Manager (Windows), or a server monitoring system to check CPU usage, memory consumption, and network bandwidth. Spikes in these areas indicate stress on your server.
2. Initial Mitigation Steps
- Rate Limiting: Implement rate limiting at your web server or firewall level. This restricts the number of requests from a single IP address within a given timeframe.
# Example Nginx rate limiting configuration limit_req_zone $binary_remote_addr zone=mylimit:10m rate=5r/s; server { ... location / { limit_req zone=mylimit burst=20 nodelay; ... } } - Firewall Rules: Block suspicious IP addresses. If you identify a small number of attacking IPs, add them to your firewall’s blocklist.
# Example iptables rule (Linux) iptables -A INPUT -s [Attacker IP Address] -j DROP - Web Application Firewall (WAF): If you have a WAF, ensure it’s enabled and configured to detect and block malicious requests. Many WAFs have built-in rules for common attack patterns.
3. Deeper Investigation
- Packet Capture: Use tools like
tcpdump(Linux) or Wireshark to capture network traffic and analyze the requests in detail.# Example tcpdump command tcpdump -i eth0 -s 0 -w capture.pcap port 80 or port 443 - Log Analysis Tools: Use log analysis tools (e.g., Splunk, ELK Stack) to search for patterns and anomalies in your logs more efficiently.
- Check for Known Vulnerabilities: If the requests target specific URLs, investigate whether those pages have known vulnerabilities that could be exploited.
4. Advanced Mitigation (DDoS Attacks)
- Cloud-Based DDoS Protection: Consider using a cloud-based DDoS protection service (e.g., Cloudflare, Akamai). These services can absorb large volumes of traffic and filter out malicious requests before they reach your server.
- Blackhole Routing: As a last resort, you can blackhole the attacking IP addresses at your network provider level. This completely blocks all traffic from those IPs but may also block legitimate users if the attacker is spoofing addresses.
5. Ongoing Security
- Keep Software Updated: Regularly update your web server, operating system, and any other software to patch security vulnerabilities.
- Strong Passwords & Authentication: Use strong passwords for all accounts and enable multi-factor authentication where possible.
- Regular Security Audits: Conduct regular security audits to identify potential weaknesses in your systems.

