Detectionmediumtest
Indirect Command Execution From Script File Via Bash.EXE
Detects execution of Microsoft bash launcher without any flags to execute the content of a bash script directly. This can be used to potentially bypass defenses and execute Linux or Windows-based binaries directly via bash.
Log Source
WindowsProcess Creation
ProductWindows← raw: windows
CategoryProcess Creation← raw: process_creation
Events generated when a new process is spawned on the system. Covers command-line arguments, parent/child relationships, and process metadata.
Detection Logic
Detection Logic5 selectors
detection:
selection:
- Image|endswith:
- ':\Windows\System32\bash.exe'
- ':\Windows\SysWOW64\bash.exe'
- OriginalFileName: 'Bash.exe'
filter_main_cli_flag:
CommandLine|contains:
# Note: we're not interested in flags being passed first
- 'bash.exe -'
- 'bash -'
filter_main_no_cli:
CommandLine: null
filter_main_empty:
CommandLine: ''
filter_main_no_flag:
CommandLine:
- 'bash.exe'
- 'bash'
condition: selection and not 1 of filter_main_*False Positives
Unknown
False positive likelihood has not been assessed. Additional context may be needed during triage.
References
12
Resolving title…
lolbas-project.github.ioResolving title…
linux.die.net3
Resolving title…
Internal ResearchMITRE ATT&CK
Tactics
Techniques
Rule Metadata
Rule ID
2d22a514-e024-4428-9dba-41505bd63a5b
Status
test
Level
medium
Type
Detection
Created
2023-08-15
Author
Path
rules/windows/process_creation/proc_creation_win_bash_file_execution.yml
Raw Tags
attack.stealthattack.t1202