a3fa75fe9b9c0ca9ccdc85ae6733024cbc64c545031aad9150f03fed9335850adarkcomet: a3fa75fe — UPX-packed Delphi VCL RAT, MSRSAAPP masquerade, v5.x command prefix
Executive Summary
Classic DarkComet RAT v5.x built with Borland Delphi 7 / VCL, UPX-packed, and dressed in the family’s trademark "MSRSAAPP / Microsoft Corp." version-info masquerade. The binary carries the full DarkComet capability surface — remote shell, keylogger, webcam capture, screen grab, clipboard hijack, registry editor, FTP, SOCKS5 proxy, and DDoS floods — with the #KCMDDC5#- command prefix and #BOT# bot-control strings hardcoded in the unpacked image. Static-only analysis (CAPE skipped: no Windows guest).
What It Is
- SHA-256:
a3fa75fe9b9c0ca9ccdc85ae6733024cbc64c545031aad9150f03fed9335850a^[file.txt] - Original filename:
f168pro.exe^[triage.json] - File size: 354,816 bytes (UPX-packed) → 762,880 bytes unpacked ^[file.txt]
- Format: PE32 executable (GUI) Intel 80386, 3 sections ^[file.txt]
- Compiler / toolchain: Borland Delphi 7 (FastMM Borland Edition 2004/2005 RTL strings, TObject/TComponent/TRegistry/TThread VCL units) ^[strings.txt]
- Packer: UPX 3.x (sections
UPX0,UPX1, entry point0xCA6B0) ^[pefile.txt] - Timestamp: Sun Jan 15 16:49:40 2012 UTC ^[rabin2-info.txt]
- Signing: Unsigned ^[rabin2-info.txt]
- Version-info masquerade: "Microsoft Corp." / "Remote Service Application" / "MSRSAAPP" / "MSRSAAP.EXE" / Copyright (C) 1999 ^[exiftool.json] ^[pefile.txt]
How It Works
DarkComet is a commodity remote-access trojan sold as a builder kit; this sample is the client stub produced by the builder. It is not a dropper — the RAT logic is native Delphi, not a staged payload.
On launch the stub reads an embedded plaintext configuration block (keys such as PWD, MUTEX, SID, NETDATA, INSTALL, COMBOPATH) parsed by a Delphi INI-like reader, initializes Winsock, and attempts to connect back to a hardcoded C2 host/port or enters a listen mode. ^[r2:entry0]
The command-and-control surface is exposed through raw TCP sockets (wsock32.dll) overlaid with a simple text protocol. Bot commands begin with #BOT# (e.g., #BOT#Ping, #BOT#VisitUrl, #BOT#CloseServer, #BOT#URLDownload, #BOT#RunPrompt, #BOT#SvrUninstall, #BOT#URLUpdate). Server-side commands use the #KCMDDC5#- prefix. ^[strings.txt]
RAT capabilities observed in strings:
- Surveillance:
UntCaptureWebcam,WEBCAMLIVE,ScreenSnap,DESKTOPCAPTURE,SoundCaptureStart,ActiveOfflineKeylogger,ActiveOnlineKeylogger,#GetClipboardText^[strings.txt] - System control:
KillProcess,Suspend,Resume,Inject,HideTaskBar,ShowTaskBar,DisableTaskMgr,EnableTaskMgr,RegEdit(UntRegEdit),RemoteShell(UntRemoteShell) ^[strings.txt] - File operations:
ADownloadFile,UploadFile,SendFilesToTrash,FindFirstFileA,FindNextFileA^[strings.txt] - Network abuse:
DDOSSYNFLOOD,DDOSUDPFLOOD,DDOSHTTPFLOOD,ADDSOCKS5,SOCKS5CLOSE,PortScanAdd,FtpPutFileA^[strings.txt] - Persistence:
SOFTWARE\Microsoft\Windows\CurrentVersion\Run,startupfolder,startupreg,CleanMsConfig,CreateServiceA,StartServiceA^[strings.txt] ^[pefile.txt]
The binary imports CreateServiceA/StartServiceA/ControlService (ADVAPI32) and registry APIs, supporting both Run-key and Windows-service persistence paths. ^[pefile.txt]
Reflective DLL loading capability is suggested by BTMemoryLoadLibary error strings ("BuildImportTable failed", "VirtualAlloc failed", "IMAGE_NT_SIGNATURE is not valid"), indicating the author included a memory-loader library for plugin injection. ^[strings.txt]
Decompiled Behavior
entry0 at 0x0048c87c (r2 pdc output) shows the classic Delphi initialization sequence:
- Stack frame setup with
0x28zero pushes (RTL init). CoInitialize(-1)for COM/OLE support (used by VCL and possibly webcam DirectShow).- Calls
fcn.004882e8(likely RTL initialization / unit init chain). - Calls
fcn.0048b490which returns a config-object pointer (ebx). - Iterates over config keys —
PWD,MUTEX,SID,NETDATA,INSTALL,COMBOPATH— fetching each viafcn.0048b548and storing results in global data references (0x49138c,0x4912a8,0x49171c,0x491644,0x4912c8, etc.). ^[r2:entry0]
No anti-debug or VM checks were observed in the entry path or in cross-references to IsDebuggerPresent, CheckRemoteDebuggerPresent, or CPUID instructions.
C2 Infrastructure
- Default bind/listen:
127.0.0.1:1604— likely the builder default before operator customization. ^[strings.txt] - Protocol: Raw TCP over
wsock32.dll(socket,connect,listen,accept,send,recv,gethostbyname). - No hardcoded external C2 recovered statically. The
NETDATAconfig key would hold the operator-supplied host/port at build time. - Mutex:
TMPMUTEX(configurable viaMUTEXkey). ^[strings.txt] - Registry key / group tag:
DC2_USERS— observed as a string reference, possibly used for client grouping or as a registry storage key. ^[strings.txt]
Interesting Tidbits
- The
MSRSAAPPmasquerade is a known DarkComet template; defenders hunting for this specific InternalName have high confidence they are facing DarkComet or a builder-kit derivative. ^[exiftool.json] 127.0.0.1:1604is the default listener port in older DarkComet builder versions (v4.x–v5.x). Samples with this string and no external IP are typically unconfigured builder defaults or test builds.- The binary embeds zlib 1.2.3 (
inflate 1.2.3 Copyright 1995-2005 Mark Adler), likely used for compressing screen-capture streams or file-transfer payloads. ^[strings.txt] ACCESS DENIED (x64)string suggests the RAT is 32-bit only and emits a warning when executed on x64 systems for operations requiring WoW64 manipulation. ^[strings.txt]BTMemoryLoadLibarystrings (note the misspelling "Libary") point to a third-party reflective DLL loader, possibly BTMemoryModule or a fork, used for plugin loading without touching disk.
How To Mess With It (Homelab Replication)
DarkComet is a historic builder-kit RAT. For research purposes:
- Download the DarkComet v5.3.1 builder (abandoned by author; widely archived in malware-research repositories).
- Build a stub with default settings — observe the
MSRSAAPPversion block,TMPMUTEX, and127.0.0.1:1604defaults. - Compare the resulting PE section names (
.itext,.data,.idata,.rdata,.reloc,.rsrc) and import table to this sample. - Verification: unpack with
upx -dand grep for#KCMDDC5#-and#BOT#— should match.
What you'll learn: How builder-kit defaults create a clusterable static fingerprint even when operators customize C2 addresses.
Deployable Signatures
YARA rule
rule DarkComet_RAT_v5x
{
meta:
description = "DarkComet RAT v5.x client stub"
author = "PacketPursuit"
date = "2026-07-10"
sha256 = "a3fa75fe9b9c0ca9ccdc85ae6733024cbc64c545031aad9150f03fed9335850a"
reference = "https://malwarebazaar.abuse.ch/sample/a3fa75fe9b9c0ca9ccdc85ae6733024cbc64c545031aad9150f03fed9335850a/"
strings:
$cmd_prefix = "#KCMDDC5#-" ascii wide
$bot_ping = "#BOT#Ping" ascii wide
$bot_close = "#BOT#CloseServer" ascii wide
$mutex = "TMPMUTEX" ascii wide
$dc2 = "DC2_USERS" ascii wide
$msrsa = "MSRSAAPP" ascii wide
$btmem = "BTMemoryLoadLibary" ascii wide
$default_listen = "127.0.0.1:1604" ascii wide
condition:
uint16(0) == 0x5A4D and
4 of them
}
IOC list
| Indicator | Type | Note |
|---|---|---|
a3fa75fe9b9c0ca9ccdc85ae6733024cbc64c545031aad9150f03fed9335850a |
SHA-256 | Packed stub |
f168pro.exe |
Filename | Original submission name |
MSRSAAPP / MSRSAAP.EXE |
Version-info | DarkComet default masquerade |
127.0.0.1:1604 |
Network | Default listen/bind address:port |
TMPMUTEX |
Mutex | Default mutex name |
DC2_USERS |
Registry / Config | Client grouping key |
#KCMDDC5#- |
Protocol | Server command prefix |
#BOT#Ping, #BOT#CloseServer, etc. |
Protocol | Bot control strings |
SOFTWARE\Microsoft\Windows\CurrentVersion\Run |
Registry | Persistence path |
SOFTWARE\Microsoft\Shared Tools\MSConfig\startupfolder |
Registry | Persistence path |
SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg |
Registry | Persistence path |
Behavioral fingerprint
This 32-bit Delphi PE unpacks to ~763 KB and imports wsock32.dll for raw TCP sockets alongside VCL GUI and DirectShow (webcam) APIs. Within 30 seconds of launch it attempts to resolve NETDATA and MUTEX config values, create a mutex, and open a TCP connection or listening socket on the configured port. Network traffic is plaintext command tokens prefixed with #BOT# (outbound) or #KCMDDC5#- (inbound). File-system indicators include reads to SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg and writes to %TEMP% for downloaded files.
Detection Signatures
| ATT&CK ID | Technique | Evidence |
|---|---|---|
| T1059.003 | Windows Command Shell | UntRemoteShell, cmd.exe, ACTIVEREMOTESHELL, RemoteShell ^[strings.txt] |
| T1547.001 | Registry Run Keys | SOFTWARE\Microsoft\Windows\CurrentVersion\Run, startupfolder, startupreg ^[strings.txt] |
| T1543.003 | Create or Modify System Process: Windows Service | CreateServiceA, StartServiceA, ControlService imports ^[pefile.txt] |
| T1113 | Screen Capture | UntScreenCapture, ScreenSnap, DESKTOPCAPTURE, DESKTOPSTOP ^[strings.txt] |
| T1056.001 | Input Capture: Keylogging | ActiveOfflineKeylogger, ActiveOnlineKeylogger, KeylogOn ^[strings.txt] |
| T1125 | Video Capture | UntCaptureWebcam, WEBCAMLIVE, CAMERA, TDCWebCam ^[strings.txt] |
| T1115 | Clipboard Data | #GetClipboardText, #SendClip, :: Clipboard Change : size = ^[strings.txt] |
| T1005 | Data from Local System | GRABPASSWORDS, 0UntPasswordAndData, browser credential strings ^[strings.txt] |
| T1071.001 | Application Layer Protocol: Web | InternetOpenA, URLDownloadToFileA, #BOT#URLDownload, #BOT#VisitUrl ^[strings.txt] ^[pefile.txt] |
| T1095 | Non-Application Layer Protocol | wsock32.dll socket/connect/send/recv imports ^[pefile.txt] |
| T1213.001 | Exfiltration to Code Repository | FtpPutFileA, UntFTP, FTPHOST, FTPPASS ^[strings.txt] ^[pefile.txt] |
| T1498 | Network Denial of Service | DDOSSYNFLOOD, DDOSUDPFLOOD, DDOSHTTPFLOOD ^[strings.txt] |
| T1055 | Process Injection | WriteProcessMemory, CreateRemoteThread, VirtualAllocEx, BTMemoryLoadLibary strings ^[strings.txt] ^[pefile.txt] |
| T1564.001 | Hidden Window | Invisible, HideTaskBar, HideStartButton, HideSystemTrayIcons ^[strings.txt] |
| T1083 | File and Directory Discovery | FindFirstFileA, FindNextFileA, ADownloadFile, UPLOADFILE ^[strings.txt] |
| T1012 | Query Registry | RegQueryValueExA, RegOpenKeyExA, RegEnumValueA, Registry unit ^[strings.txt] ^[pefile.txt] |
| T1518.001 | Software Discovery | GetFileVersionInfoA, VerQueryValueA ^[pefile.txt] |
| T1497.001 | System Checks | IsWow64Process, GetVersionExA, GetSystemMetrics ^[strings.txt] ^[pefile.txt] |
References
- Artifact ID:
f517207b-28cc-4712-8897-f6325ab97576^[metadata.json] - MalwareBazaar: https://malwarebazaar.abuse.ch/sample/a3fa75fe9b9c0ca9ccdc85ae6733024cbc64c545031aad9150f03fed9335850a/
- MITRE ATT&CK — DarkComet: https://attack.mitre.org/software/S0334/
- DarkComet RAT analysis (Sophos): https://news.sophos.com/en-us/2020/08/05/darkcomet-returns/ (historical reference)
Provenance
file.txt,exiftool.json,pefile.txt,strings.txt,ssdeep.txt,tlsh.txt,yara.txt,metadata.json,triage.json— generated by triage-fast pipeline, 2026-05-26.rabin2-info.txt— radare2rabin2 -I, 2026-07-10.- Unpacked with UPX 4.2.2 (
upx -d) on 2026-07-10. - Static strings and imports extracted from unpacked image via
stringsand radare2ii/iz. - Entry-point pseudocode from radare2
pdc @ entry0. - No dynamic analysis available: CAPE skipped (no Windows guest).