← Back to SOC feed Coverage →

Detects payload generated by exe2hex

yara HIGH Yara-Rules
backdoorcommunity
This rule was pulled from an open-source repository and enriched with AI. Validate in a test environment before deploying to production.
View original rule at Yara-Rules →
Retrieved: 2026-07-31T11:00:00Z · Confidence: medium

Hunt Hypothesis

This rule detects adversaries utilizing the exe2hex utility to convert executable files into hexadecimal strings for covert data exfiltration or command-and-control communication. A proactive hunt is essential in Azure Sentinel because this technique often bypasses traditional signature-based defenses by disguising malicious payloads as benign text, allowing attackers to move laterally undetected within the cloud environment.

YARA Rule

rule Payload_Exe2Hex : toolkit {
	meta:
		description = "Detects payload generated by exe2hex"
		author = "Florian Roth"
		reference = "https://github.com/g0tmi1k/exe2hex"
		date = "2016-01-15"
		score = 70
	strings:
		$a1 = "set /p \"=4d5a" ascii
		$a2 = "powershell -Command \"$hex=" ascii
		$b1 = "set+%2Fp+%22%3D4d5" ascii
		$b2 = "powershell+-Command+%22%24hex" ascii
		$c1 = "echo 4d 5a " ascii
		$c2 = "echo r cx >>" ascii
		$d1 = "echo+4d+5a+" ascii
		$d2 = "echo+r+cx+%3E%3E" ascii
	condition:
		all of ($a*) or all of ($b*) or all of ($c*) or all of ($d*)
}

Deployment Notes

This YARA rule can be deployed in the following contexts:

This rule contains 9 string patterns in its detection logic.

References

False Positive Guidance

Here are 5 specific false positive scenarios for the Detects payload generated by exe2hex rule, including suggested filters and exclusions:

Original source: https://github.com/Yara-Rules/rules/blob/main/malware/TOOLKIT_exe2hex_payload.yar