This rule identifies the presence of PureBasic, a lightweight interpreted language often used by threat actors to create compact, obfuscated payloads or downloaders that may evade traditional static analysis. Proactively hunting for this indicator in Azure Sentinel allows the SOC to detect potential footholds or staging activities where adversaries leverage this niche toolchain to execute malicious code or establish persistence before triggering more complex behavioral alerts.
rule PureBasic : Neil Hodgson
{
meta:
author="_pusher_"
date="2016-07"
strings:
//make check for msvrt.dll
$c0 = { 55 8B EC 6A 00 68 00 10 00 00 6A ?? FF 15 ?? ?? ?? ?? A3 ?? ?? ?? ?? C7 05 ?? ?? ?? ?? 00 00 00 00 C7 05 ?? ?? ?? ?? 10 00 00 00 A1 ?? ?? ?? ?? 50 6A ?? 8B 0D ?? ?? ?? ?? 51 FF 15 ?? ?? ?? ?? A3 ?? ?? ?? ?? 5D C3 CC CC CC CC CC CC CC CC CC }
$c1 = { 68 ?? ?? 00 00 68 00 00 00 00 68 ?? ?? ?? 00 E8 ?? ?? ?? 00 83 C4 0C 68 00 00 00 00 E8 ?? ?? ?? 00 A3 ?? ?? ?? 00 68 00 00 00 00 68 00 10 00 00 68 00 00 00 00 E8 ?? ?? ?? 00 A3 }
$aa0 = "\x00MSVCRT.dll\x00" ascii
$aa1 = "\x00CRTDLL.dll\x00" ascii
condition:
(for any of ($c0,$c1) : ( $ at pe.entry_point )) and
(any of ($aa*) ) and
((pe.linker_version.major == 2) and (pe.linker_version.minor == 50 ))
}
This YARA rule can be deployed in the following contexts:
This rule contains 4 string patterns in its detection logic.
.exe files that match the YARA signature. Filter/Exclusion: Exclude files located in specific development directories (e.g., C:\Dev\PureBasicProjects\) or processes spawned by known IDEs like PBIDE.exe or CodeBlocks.exe.svchost.exe (specifically the Task Scheduler service) and the executable path resides in a known service directory (e.g., C:\Program Files\InternalTools\ or C:\Scripts\).MediaConverter.exe, LegacyPOS.exe) and where the file hash or path matches a verified allowlist of known-good binaries.C:\agent\work\, D:\Jenkins\workspace\) or processes spawned by build agents like jenkins.exe or vstsagent.exe.