This rule identifies anomalous debug data artifacts that may indicate an adversary is using debugging tools to inspect or manipulate application state during execution. Proactively hunting for these indicators helps the SOC detect stealthy reconnaissance or exploitation attempts that leverage debug features to bypass standard security controls within Azure Sentinel.
rule HasDebugData : PECheck
{
meta:
author = "_pusher_"
description = "DebugData Check"
date="2016-07"
condition:
// MZ signature at offset 0 and ...
uint16(0) == 0x5A4D and
// ... PE signature at offset stored in MZ header at 0x3C
uint32(uint32(0x3C)) == 0x00004550 and
//orginal
//((uint32(uint32(0x3C)+0xA8) >0x0) and (uint32be(uint32(0x3C)+0xAC) >0x0))
//((uint16(uint32(0x3C)+0x18) & 0x200) >> 5) x64/x32
(IsPE32 or IsPE64) and
((uint32(uint32(0x3C)+0xA8+((uint16(uint32(0x3C)+0x18) & 0x200) >> 5)) >0x0) and (uint32be(uint32(0x3C)+0xAC+((uint16(uint32(0x3C)+0x18) & 0x200) >> 5)) >0x0))
}
This YARA rule can be deployed in the following contexts:
devenv.exe, dotnet.exe, java.exe, or idea64.exe (or their respective parent processes) when the target path contains /bin/Debug/ or /obj/Debug/.dotnet build -c Debug or npm run build:debug, which may generate temporary debug artifacts or invoke debug-specific compiler flags.
agent.exe, jenkins-agent.jar, runner.exe) or where the command line contains arguments like -c Debug, --debug, or NODE_ENV=development.dtagent.exe, appdynamics_agent.exe, newrelic-agent.exe) or diagnostic utilities (e.g., wireshark.exe, perfview.exe) when the target is a standard application service.