Real-World Attack Patterns Observed in Production Logs (And How Developers Can Stop Them)
In the last few days, we analyzed real server access logs from a live application. What we found is something every developer should understand:
π Your application is being scanned and attacked β constantly.
Not by a single attacker, but by automated bots crawling the internet looking for vulnerabilities.
This blog breaks down:
- What kinds of attacks are happening
- Real examples from logs
- What developers should do to secure their systems
π What We Observed
From the logs, multiple suspicious request patterns appeared:
1. π₯ Remote Code Execution (RCE) Attempts
Example:
/hello.world?%ADd+allow_url_include=1+%ADd+auto_prepend_file=php://input
π This is a classic attempt to execute malicious PHP code remotely.
2. β οΈ PHPUnit Exploit Scanning
Examples:
/wp-content/plugins/.../phpunit/phpunit/src/Util/PHP/eval-stdin.php
π Attackers are trying to exploit old PHPUnit vulnerabilities.
π Important:
Even if you DON'T use WordPress β they still try.
3. π‘ Microsoft / Exchange / Autodiscover Probing
Examples:
/autodiscover/autodiscover.json?@zdi/Powershell
/ecp/Current/exporttool/microsoft.exchange.ediscovery.exporttool.application
π Bots assume your server might be running Exchange and try known exploits.
4. π§ͺ Random Endpoint Scanning
Examples:
/aab9
/aaa9
/html/ie.html
/SDK/webLanguage
π These are blind scans to find hidden endpoints or misconfigured apps.
5. π API Abuse Attempts
Examples:
/iams/api/v1/forgot-password/sendOtp
/iams/api/v1/slots/reserveSlot
π Attackers test APIs for:
- Rate limit issues
- OTP abuse
- Business logic flaws
6. 𧨠XSS / Injection Payloads
Example (encoded attack):
/%27%22 class="error__button...
π This is an attempt to inject HTML/JS into your frontend.
π§ Important Insight
π These attacks are automated.
π They don't care what tech stack you use.
π If your server is public, it WILL be scanned.
π‘οΈ What Developers Should Do (Practical Defense)
1. π« Disable Unused Entry Points
If you are not using:
/wp-content/phpunit/vendor
π Block them at Nginx level:
location ~* /(vendor|phpunit|wp-content) {
deny all;
return 404;
}
2. π Protect Against RCE
Never allow:
allow_url_include- dynamic file execution
π In PHP:
allow_url_include = Off
allow_url_fopen = Off
π In Django:
- Never use
eval() - Avoid unsafe
exec()
3. π§± Web Application Firewall (WAF)
Use:
- Cloudflare / AWS WAF
- ModSecurity
π Blocks:
- SQL Injection
- XSS
- Known exploit patterns
4. π¦ Rate Limiting (Very Important for APIs)
Example (Django):
from rest_framework.throttling import UserRateThrottle
π Protect endpoints like:
- OTP
- Login
- Payment APIs
5. π Input Validation Everywhere
Never trust user input.
β Validate:
- Query params
- Headers
- JSON body
β Use:
- Django serializers
- Laravel validation rules
6. π Hide Server Information
Remove headers like:
ServerX-Powered-By
π In Nginx:
server_tokens off;
7. π« Custom 404 & Error Handling
Default error pages leak info.
π Always use custom responses:
- Generic message
- No stack trace
8. π Secure Sensitive Endpoints
For APIs like:
/forgot-password
/reserveSlot
π Add:
- CAPTCHA
- OTP cooldown
- IP-based throttling
9. π Monitor Logs Continuously
Logs are your best defense.
Track:
- Repeated 404s
- Suspicious paths
- High-frequency hits
π Integrate:
- Fail2Ban
- ELK Stack
- Custom dashboards
10. π¨ Block Bots Automatically
Use Fail2Ban or scripts:
π Example logic:
- 10 suspicious hits β block IP
β‘ Final Takeaway
π Security is NOT optional
π Attackers donβt target YOU β they target EVERYONE
π Your job as a developer is to reduce attack surface