CmdID

CmdID / Rules / Linux

Linux Suspicious Child Process from Node.js - React2Shell

A Sigma rule for process creation on Linux, from SigmaHQ’s emerging threats rules, by Swachchhanda Shrawan Poudel (Nextron Systems), Nasreddine Bencherchali.

high 2 ATT&CK techniques 27 programs it names

What it looks for

its detection, as SigmaHQ writes it
detection:
  filter_main_default_shell_flag:
    Image|endswith: '-c'
  selection_generic_child_cli:
    CommandLine|contains:
      - '/dev/tcp/'
      - '/dev/udp/'
      - '/etc/hosts'
      - '/etc/passwd'
      - '/etc/shadow'
      - 'base64'
      - 'cat '
      - 'curl'
      - 'dig'
      - 'ifconfig'
      - 'IO::Socket::INET'
      - 'java'
      - 'less '
      - 'lua'
      - 'mkfifo '
      - 'more'
      - 'nc '
      - 'ncat'
      - 'netcat'
      - 'netstat'
      - 'nslookup'
      - 'perl'
      - 'php'
      - 'ping'
      - 'ps -ef'
      - 'ps aux'
      - 'python'
      - 'rcat'
      - 'ruby'
      - 'sh -i 2>&1'
      - '-c id'
      - 'socat'
      - 'uname'
      - 'wget'
      - 'whoami'
  selection_generic_child_img:
    - Image|endswith:
        - '/busybox'
        - '/cat'
        - '/curl'
        - '/dash'
        - '/dig'
        - '/head'
        - '/id'
        - '/ifconfig'
        - '/ip'
        - '/java'
        - '/less'
        - '/lua'
        - '/more'
        - '/nc'
        - '/ncat'
        - '/netcat'
        - '/netstat'
        - '/nslookup'
        - '/perl'
        - '/ping'
        - '/python'
        - '/python2'
        - '/ruby'
        - '/socat'
        - '/tail'
        - '/wget'
        - '/whoami'
    - Image|contains: '/python'
  selection_parent:
    ParentCommandLine|contains:
      - '--experimental-https'
      - '--experimental-next-config-strip-types'
      - '/node_modules/next'
      - 'next dev'
      - 'next start'
      - 'node_modules/.bin'
      - 'react-scripts start'
      - 'start-server.js'
    ParentImage|endswith: '/node'
  selection_specific_cli:
    Image|endswith: '-c'
  selection_specific_sh:
    Image|endswith: '/sh'
  condition: selection_parent and ( 1 of selection_generic_* or (selection_specific_sh and not filter_main_default_shell_flag) or (all of selection_specific_* and selection_generic_child_cli) )

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 Swachchhanda Shrawan Poudel (Nextron Systems), Nasreddine Bencherchali, 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

their pages here

ATT&CK

the techniques it is tagged with
T1059Command and Scripting Interpreter
T1190Exploit Public-Facing Application