Webshell Detection With Command Line Keywords
A Sigma rule for process creation on Windows, by Florian Roth (Nextron Systems), Jonhnathan Ribeiro, Anton Kutepov, oscd.community, Chad Hudson, Matt Anderson.
high 4 ATT&CK techniques 38 programs it names
What it looks for
detection:
selection_susp_change_dir:
CommandLine|contains:
- '&cd&echo'
- 'cd /d '
selection_susp_misc_discovery_binaries:
- Image|endswith:
- '\dsquery.exe'
- '\find.exe'
- '\findstr.exe'
- '\ipconfig.exe'
- '\netstat.exe'
- '\nslookup.exe'
- '\pathping.exe'
- '\quser.exe'
- '\schtasks.exe'
- '\systeminfo.exe'
- '\tasklist.exe'
- '\tracert.exe'
- '\wevtutil.exe'
- '\whoami.exe'
- OriginalFileName:
- 'dsquery.exe'
- 'find.exe'
- 'findstr.exe'
- 'ipconfig.exe'
- 'netstat.exe'
- 'nslookup.exe'
- 'pathping.exe'
- 'quser.exe'
- 'schtasks.exe'
- 'sysinfo.exe'
- 'tasklist.exe'
- 'tracert.exe'
- 'VSSADMIN.EXE'
- 'wevtutil.exe'
- 'whoami.exe'
selection_susp_misc_discovery_commands:
CommandLine|contains:
- ' Test-NetConnection '
- 'dir \'
selection_susp_net_utility:
CommandLine|contains:
- ' user '
- ' use '
- ' group '
OriginalFileName:
- 'net.exe'
- 'net1.exe'
selection_susp_ping_utility:
CommandLine|contains: ' -n '
OriginalFileName: 'ping.exe'
selection_susp_powershell_cli:
CommandLine|contains:
- ' -enc '
- ' -EncodedCommand '
- ' -w hidden '
- ' -windowstyle hidden'
- '.WebClient).Download'
Image|endswith:
- '\cmd.exe'
- '\powershell.exe'
- '\pwsh.exe'
selection_susp_wmic_utility:
CommandLine|contains: ' /node:'
OriginalFileName: 'wmic.exe'
selection_webserver_characteristics_tomcat1:
ParentImage|contains:
- '-tomcat-'
- '\tomcat'
ParentImage|endswith:
- '\java.exe'
- '\javaw.exe'
selection_webserver_characteristics_tomcat2:
CommandLine|contains:
- 'catalina.jar'
- 'CATALINA_HOME'
ParentImage|endswith:
- '\java.exe'
- '\javaw.exe'
selection_webserver_image:
ParentImage|endswith:
- '\w3wp.exe'
- '\php-cgi.exe'
- '\nginx.exe'
- '\httpd.exe'
- '\caddy.exe'
- '\ws_tomcatservice.exe'
condition: 1 of selection_webserver_* and 1 of selection_susp_*
The rule’s detection, its selections and fields in order of name. The whole rule, with its references and false positives, is on SigmaHQ, by Florian Roth (Nextron Systems), Jonhnathan Ribeiro, Anton Kutepov, oscd.community, Chad Hudson, Matt Anderson, under the Detection Rule License 1.1. CmdID evaluates it on a command line alone: a test on what a command line cannot show, such as the parent process or the user, is not met.
None of the everyday examples and documented commands on CmdID’s program pages trips it. To see whether a command line does, paste it into CmdID.
Programs and files it names
cmd.exefindstr.exeschtasks.exevssadmin.exewmic.exeipconfignetnetstatnslookuppathpingpingpowershellqusersysteminfotasklisttracertwevtutilwhoamiNETSTAT.EXEPATHPING.EXEPING.EXETRACERT.EXEdsquery.exefind.exeipconfig.exejava.exejavaw.exenet.exenet1.exenslookup.exepowershell.exequser.exesysinfo.exesysteminfo.exetasklist.exew3wp.exewevtutil.exewhoami.exe