This detection identifies adversaries utilizing Hatman to compile Python scripts into executable binaries, a technique designed to evade static analysis and signature-based defenses by obscuring source code. SOC teams should proactively hunt for this behavior in Azure Sentinel to uncover stealthy command-and-control or payload delivery mechanisms that might otherwise bypass traditional script monitoring controls.
rule hatman_compiled_python : hatman {
condition:
filesize < 100KB and hatman_nullsub and hatman_setstatus and hatman_dividers
}
This YARA rule can be deployed in the following contexts:
Here are 4 specific false positive scenarios for the hatman_compiled_python detection rule in an enterprise environment, including suggested filters and exclusions:
Automated CI/CD Pipeline Artifacts
pyinstaller or cython) as part of the nightly deployment pipeline. This activity involves creating compiled bytecode (.pyc) and executable binaries that match the rule’s signature, even though no malicious “Hatman” malware is present.C:\Jenkins\workspace\, /var/lib/gitlab-runner/builds/) and restrict alerts to the specific service account running the build agent (e.g., svc-jenkins-build).Scheduled Data Engineering Tasks
python.exe from C:\Program Files\Python39) used by these orchestration tools.Enterprise Endpoint Management Deployments