DNS Request by Recently Created Executable
Description
This rule detects DNS requests initiated by recently created executables in world/user-writable directories. Malware authors may use these requests to communicate with command and control infrastructure or to exfiltrate data from the target system.
Query · eql
sequence by process.parent.entity_id with maxspan=10s
[file where event.type == "creation" and (
process.name in ("curl", "wget", "bash", "dash", "sh", "tcsh", "csh", "zsh", "ksh", "fish", "busybox", "timeout", "env") or
process.name like (".*", "python*", "perl*", "php*", "ruby*", "lua*", "node", "deno") or
process.executable like (
"./*", "/tmp/*", "/var/tmp/*", "/dev/shm/*", "/run/*", "/var/run/*", "/boot/*", "/sys/*",
"/lost+found/*", "/proc/*", "/var/mail/*", "/var/www/*", "/home/*/*", "/root/*"
)
) and
file.path like ("/tmp/*", "/var/tmp/*", "/dev/shm/*", "/home/*/*", "/root/*", "/var/www/*") and
not (
file.path like (
"/home/*/.claude/downloads/claude-*-linux-x64", "/home/*/.aimee-code/bin/aimee-code"
) or
(
process.executable like "/home/*/go/pkg/mod/golang.org/*/pkg/tool/linux_amd64/link" and
file.path like "/tmp/go-*/exe/vuln-stats"
) or
process.executable like (
"/home/*/.local/share/claude/versions/*", "/home/*/.vscode-server/cli/servers/Stable-*/server/node",
"/tmp/*/.vscode-server/.vscode-server/cli/servers/Stable-*/server/node", "/home/*/.vscode-server/bin/*/node"
)
)] as event0
[dns where event.action == "lookup_result" and startswith~(process.executable, event0.file.path) and
dns.question.name != "localhost"]