This detection rule identifies the presence of BlackShades Remote Access Trojan (RAT), which adversaries deploy to establish persistent command-and-control channels and exfiltrate sensitive data from compromised endpoints. Proactively hunting for this specific malware in Azure Sentinel is critical because its low-severity classification may cause it to be overlooked by automated alerts, necessitating manual investigation to confirm early-stage infection before lateral expansion occurs.
rule BlackShades_3 : Trojan RAT
{
meta:
description = "BlackShades RAT"
author = "botherder https://github.com/botherder"
strings:
$mod1 = /(m)odAPI/
$mod2 = /(m)odAudio/
$mod3 = /(m)odBtKiller/
$mod4 = /(m)odCrypt/
$mod5 = /(m)odFuctions/
$mod6 = /(m)odHijack/
$mod7 = /(m)odICallBack/
$mod8 = /(m)odIInet/
$mod9 = /(m)odInfect/
$mod10 = /(m)odInjPE/
$mod11 = /(m)odLaunchWeb/
$mod12 = /(m)odOS/
$mod13 = /(m)odPWs/
$mod14 = /(m)odRegistry/
$mod15 = /(m)odScreencap/
$mod16 = /(m)odSniff/
$mod17 = /(m)odSocketMaster/
$mod18 = /(m)odSpread/
$mod19 = /(m)odSqueezer/
$mod20 = /(m)odSS/
$mod21 = /(m)odTorrentSeed/
$tmr1 = /(t)mrAlarms/
$tmr2 = /(t)mrAlive/
$tmr3 = /(t)mrAnslut/
$tmr4 = /(t)mrAudio/
$tmr5 = /(t)mrBlink/
$tmr6 = /(t)mrCheck/
$tmr7 = /(t)mrCountdown/
$tmr8 = /(t)mrCrazy/
$tmr9 = /(t)mrDOS/
$tmr10 = /(t)mrDoWork/
$tmr11 = /(t)mrFocus/
$tmr12 = /(t)mrGrabber/
$tmr13 = /(t)mrInaktivitet/
$tmr14 = /(t)mrInfoTO/
$tmr15 = /(t)mrIntervalUpdate/
$tmr16 = /(t)mrLiveLogger/
$tmr17 = /(t)mrPersistant/
$tmr18 = /(t)mrScreenshot/
$tmr19 = /(t)mrSpara/
$tmr20 = /(t)mrSprid/
$tmr21 = /(t)mrTCP/
$tmr22 = /(t)mrUDP/
$tmr23 = /(t)mrWebHide/
condition:
10 of ($mod*) or 10 of ($tmr*)
}
This YARA rule can be deployed in the following contexts:
This rule contains 44 string patterns in its detection logic.
Here are 3-5 specific false positive scenarios for the BlackShades RAT detection rule in an enterprise environment, along with suggested filters or exclusions:
Legitimate Remote Administration via RDP/SSH Scripts
powershell.exe or bash processes that inject code into the memory of the target session (similar to how BlackShades operates) and establish persistent connections using standard ports (3389, 22). The detection logic may misinterpret these legitimate injection patterns as the RAT’s payload delivery mechanism.Task Scheduler, System Center Configuration Manager, or specific CI/CD agents like Jenkins Agent) and the command line contains standard flags for remote execution (e.g., -EncodedCommand in PowerShell). Additionally, whitelist traffic originating from the internal “Admin VLAN” IP range.Endpoint Detection and Response (EDR) Self-Protection & Scanning
Image Path matches known EDR service executables (e.g., C:\Program Files\CrowdStrike\fs.exe, C:\ProgramData\Microsoft\Windows Defender\Platform\*). Also, filter out network connections where