Indirect Command Execution From Script File Via Bash.EXE

Last updated on:

About the rule

Rule Type

Standard

Rule Description

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.

Severity

Trouble

Rule Requirement

Criteria

Action1: actionname = "Process started" AND (PROCESSNAME endswith ":\Windows\System32\bash.exe,:\Windows\SysWOW64\bash.exe" OR ORIGINALFILENAME = "Bash.exe") AND (COMMANDLINE notcontains "bash.exe -,bash -" AND isExist(COMMANDLINE) AND COMMANDLINE != "" AND COMMANDLINE != "bash.exe,bash") select Action1.HOSTNAME,Action1.MESSAGE,Action1.COMMANDLINE,Action1.FILE_NAME,Action1.PROCESSNAME,Action1.USERNAME,Action1.PARENTPROCESSNAME

Detection

Execution Mode

realtime

Log Sources

Windows

Author

Nasreddine Bencherchali (Nextron Systems)