Apache Jserv Protocol (AJP) - Port 8009
Basic info
What is AJP?
AJP Architecture
βββββββββββββββββββ AJP/1.3 βββββββββββββββββββ
β Web Server β βββββββββββββββββββββββ> β Tomcat β
β (Apache/Nginx) β Binary Protocol (8009) βServlet Containerβ
βββββββββββββββββββ <βββββββββββββββββββββββ βββββββββββββββββββ
HTTP/HTTPS Java Apps
(80/443) JSP/Servlets
β β
V V
Static Content Dynamic ContentProtocol Versions
How AJP Works
Common Use Cases
Default Port
Reconnaissance & Enumeration
Port Scanning
Nmap Script Enumeration
Banner Grabbing
Service Identification
Shodan Queries
Ghostcat Vulnerability (CVE-2020-1938)
Overview
How Ghostcat Works
Vulnerability Detection
Exploitation
Files to Target
From File Read to RCE
AJP Proxy Exploitation
Overview
Method 1: Nginx Reverse Proxy
Method 2: Nginx Docker (Easier)
Method 3: Apache AJP Proxy
Method 4: Using ajp-spray
Post-Proxy Exploitation
Tomcat Manager Access
WAR File Upload for RCE
Advanced Techniques
AJP Request Smuggling
AJP Attributes Injection
Exploiting AJP Secret Mismatch
AJP Connection Hijacking
Common Misconfigurations
1. Exposed to Internet
2. No Secret Authentication
3. Weak or Default Secrets
4. Tomcat Manager with Weak Credentials
5. Allowing PUT/DELETE Methods
Defense & Hardening
Secure AJP Configuration
Network-Level Protection
Update to Patched Versions
Secure Tomcat Manager
Monitoring & Detection
Regular Security Audits
Tools & Scripts
Essential Tools
Custom Python AJP Client
Automated Exploitation Script
Cheat Sheet
Quick Reference
Important Files to Target
Common Ports
Conclusion
Additional Resources
Last updated