Skip to content
Back to skills

Ajp Ghostcat

ASecurity

Ghostcat (CVE-2020-1938) Apache Tomcat AJP connector file read/inclusion — abuse the AJP protocol on port 8009 to read files under the webapp (incl. WEB-INF/web.xml, config, source) and, if the app allows uploads, escalate to RCE by including an uploaded file. Tier 1 (RCE honors the authorization gate). Use when Tomcat AJP (8009) is exposed.

  • 16 stars
  • 0 votes
  • 0 copies
  • 10 views
  • Added November 17, 2026
securitypythonrustshellcode-reviewapidatabasebackend

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned November 17, 2026

npx -y skills add AnandJogawade/Zazy-Pentest-Plugin-for-Claude --skill ajp-ghostcat --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Ajp Ghostcat?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Ajp Ghostcat
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/anandjogawade-ajp-ghostcat/badge)](https://www.skillsdirectory.com/skills/anandjogawade-ajp-ghostcat)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ajp-ghostcat
description: Ghostcat (CVE-2020-1938) Apache Tomcat AJP connector file read/inclusion — abuse the AJP protocol on port 8009 to read files under the webapp (incl. WEB-INF/web.xml, config, source) and, if the app allows uploads, escalate to RCE by including an uploaded file. Tier 1 (RCE honors the authorization gate). Use when Tomcat AJP (8009) is exposed.
---

# Ghostcat — Tomcat AJP File Read / RCE (CVE-2020-1938)

Tomcat's AJP connector (default 8009) trusts request attributes a client can set, letting an attacker specify a file to read or include from within the web application — exposing secrets and, with an upload primitive, reaching RCE.

## Trigger phrases
`ghostcat, cve-2020-1938, ajp, port 8009, tomcat ajp, ajp file read, web-inf`

## Preconditions
Apache Tomcat with the AJP connector enabled and reachable (default port 8009), before **9.0.31 / 8.5.51 / 7.0.100**. File read is always available; RCE additionally needs a way to upload a file (any extension) into the webapp.

## Method
1. **Find AJP:** `nmap -p8009 --script ajp-* host` or `nmap -sV` showing `ajp13`. AJP often left exposed behind a load balancer.
2. **File read (safe PoC):** use the AJP file-read exploit to pull a sensitive in-app file:
   ```
   python3 ghostcat.py -u TARGET -p 8009 -f WEB-INF/web.xml
   ```
   Also read `WEB-INF/classes/application.properties`, `WEB-INF/web.xml` (routes/servlets, DB creds), source `.jsp`/`.class`, `META-INF/context.xml`. Metasploit: `auxiliary/admin/http/tomcat_ghostcat`.
3. **Escalate to RCE (gated):** if the app lets you upload any file (image/avatar/doc) whose path you can predict, upload a JSP payload with a benign extension, then use AJP file *inclusion* to execute it as JSP. Prove with a token-echo JSP, then remove it.

## Modern / rare techniques
- **Config → deeper compromise:** `web.xml`/`context.xml` frequently hold DB creds, API keys, and the Tomcat manager path/creds → chain `tomcat-manager-deploy`.
- AJP exposure is a misconfig in itself (should be bound to localhost) — report even file-read-only as high severity.

## Bypass / evasion
AJP is binary, not HTTP — web WAFs usually don't inspect it; network ACLs are the control. Spoofed AJP attributes bypass HTTP-layer auth.

## Escalation / chaining
Leaked manager creds → `tomcat-manager-deploy` (WAR webshell); DB creds → `database-enumeration`; source read → `source-code-review` for more bugs; upload+include → RCE → `linux-privesc`/`windows-privesc`.

## Backend & tooling
Preferred Kali path (native / WSL+Kali / Kali-SSH / Kali-MCP / HexStrike / Metasploit-MCP). `ghostcat.py` (00theway), Metasploit `tomcat_ghostcat`, `nmap -p8009`. See `zazy-orchestrator`.

## Verification (background, before reporting)
Re-read a second known file to confirm non-coincidental content; for RCE confirm with a benign token/OAST and reproduce, then clean up. Report true positives only.

## Evidence
Open AJP port, retrieved `WEB-INF/web.xml` excerpt (redact secrets), Tomcat version, and any RCE PoC output. Remediation: upgrade Tomcat to a fixed version, disable the AJP connector if unused, bind AJP to localhost, set a `secret`/`secretRequired="true"` on the connector, network-restrict 8009.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.