Port 8009 is the AJP (Apache JServ Protocol) connector port for Apache Tomcat. AJP is a binary protocol between a front-end web server (Apache httpd, Nginx) and Tomcat. Ghostcat (CVE-2020-1938) allowed reading arbitrary files via AJP – never expose port 8009 beyond localhost. Modern deployments use HTTP proxying instead.
Port Number
8009
Protocol
TCP
Service
Apache JServ Protocol
Range
IANA Registered (1024–49151)
Check if AJP port is open (should be closed or filtered from external)
nmap -sV -p 8009 targetCheck if AJP connector is enabled in Tomcat config
grep -i 'AJP\|8009' /opt/tomcat/conf/server.xml | grep -v '<!--'Quick check if port 8009 accepts connections (any connection = potential Ghostcat)
python3 -c "import socket; s=socket.socket(); s.settimeout(3); s.connect(('target',8009)); print('OPEN - VULNERABLE'); s.close()"Verify AJP bind address and process (should be 127.0.0.1 or absent)
ss -tlnp sport = :8009curl --include http://localhost:8009/ # will fail – AJP is binary
nmap -sV -p 8009 target # detects AJP
server.xml: <Connector port='8009' protocol='AJP/1.3' address='127.0.0.1'/>AJP (Apache JServ Protocol) was created in the late 1990s to connect Apache httpd to Java servlet containers more efficiently than CGI or HTTP proxying. AJP/1.3 (the version used since Tomcat 3.x) is a binary protocol that avoids re-parsing HTTP headers. Port 8009 was registered with IANA. Ghostcat (CVE-2020-1938, disclosed February 2020 by Chaitin Tech) was a 20-year-old design flaw – AJP was never meant to be accessible from untrusted networks, but the default binding to 0.0.0.0 made it exploitable on any Tomcat installation.
Should I use AJP or HTTP proxying in 2024+?
HTTP proxying (mod_proxy_http, Nginx upstream). AJP was designed when HTTP/1.0 proxying was expensive – the binary format saved CPU on 1990s hardware. On modern servers, HTTP/1.1 proxying (with keep-alive) has negligible overhead compared to AJP, and avoids the entire Ghostcat attack surface. The only remaining AJP advantage: client certificate forwarding is simpler. For new deployments, disable AJP entirely.
How do I verify Ghostcat is patched?
Check Tomcat version (must be 9.0.31+/8.5.51+/7.0.100+). Even patched, AJP should NOT be externally accessible. Verify: nmap -p 8009 your-server-public-ip should return 'filtered' or 'closed'. If AJP is enabled, check server.xml for address="127.0.0.1" and secretRequired="true" (or secret="..." in older configs). Test exploit: use ajpShooter.py or YDHCUI's Ghostcat tool against your own server.