Linux awk/gawk/mawk/nawk CommandLine invoking shell via system()
Flags awk/gawk/mawk/nawk command lines using BEGIN {system(...)} to spawn a shell on Linux.
- Product
- linux
- Category
- process_creation
- Author
- Li Ling, Andy Parkidomo, Robert Rakowski, Blake Hartstein (Bloomberg L.P.) (SigmaHQ), DRL 1.1
- Published
- 2024-09-02
- Updated
- 2026-07-31
ATT&CK techniques
ExecutionRecon
Resource Dev
Initial Access
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule identifies Linux process executions where awk-family binaries are started with a command line containing a BEGIN block that calls system(), and the command line also references common shell binaries. Such behavior can indicate attempts to run arbitrary shell commands from within text-processing utilities, which attackers may use for execution and further escalation. Telemetry required includes Linux process creation events with the process image path and full command line content.
Reporting behind it
- gtfobins.github.iohttps://gtfobins.github.io/gtfobins/awk/#shell
- gtfobins.github.iohttps://gtfobins.github.io/gtfobins/gawk/#shell
- gtfobins.github.iohttps://gtfobins.github.io/gtfobins/nawk/#shell
- gtfobins.github.iohttps://gtfobins.github.io/gtfobins/mawk/#shell
- github.comhttps://github.com/SigmaHQ/sigma/blob/master/rules/linux/process_creation/proc_creation_lnx_awk_shell_spawn.yml
Changelog
v3- v3Candidate ingested via manual entry.2026-07-31
- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: Linux awk/gawk/mawk/nawk CommandLine invoking shell via system()
id: 9f0aeb2c-1768-41a8-9ce3-be6b60a4df3a
status: test
description: This rule identifies Linux process executions where awk-family binaries are started with a command line containing a BEGIN block that calls system(), and the command line also references common shell binaries. Such behavior can indicate attempts to run arbitrary shell commands from within text-processing utilities, which attackers may use for execution and further escalation. Telemetry required includes Linux process creation events with the process image path and full command line content.
references:
- https://gtfobins.github.io/gtfobins/awk/#shell
- https://gtfobins.github.io/gtfobins/gawk/#shell
- https://gtfobins.github.io/gtfobins/nawk/#shell
- https://gtfobins.github.io/gtfobins/mawk/#shell
- https://github.com/SigmaHQ/sigma/blob/master/rules/linux/process_creation/proc_creation_lnx_awk_shell_spawn.yml
author: Li Ling, Andy Parkidomo, Robert Rakowski, Blake Hartstein (Bloomberg L.P.), Huntrule Team
date: 2024-09-02
tags:
- attack.execution
- attack.t1059
logsource:
category: process_creation
product: linux
detection:
selection_img:
Image|endswith:
- /awk
- /gawk
- /mawk
- /nawk
CommandLine|contains: BEGIN {system
selection_cli:
CommandLine|contains:
- /bin/bash
- /bin/dash
- /bin/fish
- /bin/sh
- /bin/zsh
condition: all of selection_*
falsepositives:
- Unknown
level: high
license: DRL-1.1
related:
- id: 8c1a5675-cb85-452f-a298-b01b22a51856
type: derived