LoFP LoFP / legitimate os functions called by vendor applications, baseline the environment and filter before enabling. recommend throttle by dest/process_name

Techniques

Sample rules

Windows Suspicious Child Process Spawned From WebServer

Description

This analytic detects selected system, scripting, discovery, and administration utilities spawned by Windows web or application server processes. Parent processes include common web server and application server services; Java and JavaW parents are included when their command lines identify known server frameworks or applications. Unexpected child process activity may indicate that an exposed application or web server has been abused to run commands on the host. Review the parent command line, child process, user, and surrounding activity to determine whether the behavior is authorized.

Detection logic


| tstats `security_content_summariesonly`
  count max(_time) as lastTime
        min(_time) as firstTime

FROM datamodel=Endpoint.Processes WHERE

Processes.parent_process_name IN (
    "apache*.exe",
    "beasvc.exe",
    "caddy.exe",
    "coldfusion.exe",
    "frankenphp.exe",
    "http*.exe",
    "iisexpress.exe",
    "java.exe",
    "javaw.exe",
    "jbosssvc.exe",
    "jrun.exe",
    "lighttpd.exe",
    "lsphp*.exe",
    "nginx*.exe",
    "openresty.exe",
    "php*.exe",
    "roadrunner.exe",
    "tomcat*.exe",
    "traefik.exe",
    "UMWorkerProcess.exe",
    "w3wp.exe",
    "wildfly-service.exe",
    "ws_TomcatService.exe"
)
NOT Processes.parent_process_name IN ("phpstorm*")

Processes.process_name IN (
    "adfind.exe", "arp.exe", "at.exe", "bitsadmin.exe", "certreq.exe", "certutil.exe", "cmdkey.exe",
    "cscript.exe", "curl.exe", "dnscmd.exe", "dsget.exe", "dsquery.exe", "find.exe", "findstr.exe",
    "fsutil.exe", "getmac.exe", "hostname.exe", "ipconfig.exe", "klist.exe", "mshta.exe",
    "nbtstat.exe", "net.exe", "net1.exe", "netdom.exe", "netsh.exe", "netstat.exe", "nltest.exe",
    "nslookup.exe", "ntdsutil.exe", "pathping.exe", "perl.exe", "ping.exe", "python.exe",
    "qprocess.exe", "query.exe", "quser.exe", "qwinsta.exe", "reg.exe", "regsvr32.exe", "route.exe",
    "rundll32.exe", "sc.exe", "schtasks.exe", "scrcons.exe", "setspn.exe", "systeminfo.exe",
    "tasklist.exe", "tracert.exe", "vssadmin.exe", "wevtutil.exe", "wget.exe", "whoami.exe",
    "wmic.exe", "wscript.exe", "wusa.exe"
)

BY Processes.action Processes.dest Processes.original_file_name
   Processes.parent_process Processes.parent_process_exec Processes.parent_process_guid
   Processes.parent_process_id Processes.parent_process_name Processes.parent_process_path
   Processes.process Processes.process_exec Processes.process_guid
   Processes.process_hash Processes.process_id Processes.process_integrity_level
   Processes.process_name Processes.process_path Processes.user
   Processes.user_id Processes.vendor_product


| `drop_dm_object_name("Processes")`

```Keep Java and JavaW parents only when their command line identifies a known web or application server.```


| where (
    NOT match(parent_process_name, "(?i)^javaw?(\.exe)?$")
    OR match(parent_process, "(?i)(org\.apache\.catalina\.startup\.Bootstrap
|-Dcatalina\.base=
|org\.eclipse\.jetty\.start\.Main
|-Djetty\.home=
|org\.jboss\.modules\.Main
|-Djboss\.home\.dir=
|weblogic\.Server
|-Dweblogic\.Name=
|weblogic-launcher\.jar
|com\.ibm\.ws\.runtime\.WsServer
|com\.ibm\.ws\.kernel\.boot\.cmdline\.Bootstrap
|com\.sun\.enterprise\.glassfish\.bootstrap\.ASMain
|com\.caucho\.server\.resin\.Resin)")
    OR match(parent_process, "(?i)(org\.springframework\.boot\.loader\.
|quarkus-run\.jar
|io\.quarkus\.runner\.GeneratedMain
|io\.micronaut\.runtime\.Micronaut
|io\.dropwizard\.cli\.ServerCommand
|play\.core\.server\.ProdServerStart
|io\.helidon\.microprofile\.server\.Main
|io\.helidon\.webserver
|io\.vertx\.core\.Launcher)")
    OR match(parent_process, "(?i)(org\.keycloak
|org\.apereo\.cas
|org\.elasticsearch\.bootstrap\.Elasticsearch
|com\.atlassian\.jira\.startup\.Launcher
|BitbucketServerLauncher
|com\.google\.gerrit\.pgm\.Daemon
|-Dsolr\.solr\.home=
|jenkins\.war)")
)


| where NOT (
    process_name="tasklist.exe"
    AND match(
        lower(process),
        "^\"?tasklist(\.exe)?\"? +/fi +\"pid eq [0-9]+\" *$"
    )
)


| where NOT (
    (
        match(parent_process_path, "(?i)^C:\\\\Program Files\\\\Datacard\\\\AppContainer\\\\bin\\\\tomcat.*\.exe$")
        AND process_name="reg.exe"
        AND match(
            process,
            "(?i)^reg query \"HKEY_LOCAL_MACHINE\\\\(SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\Print\\\\Printers
|SYSTEM\\\\CurrentControlSet\\\\Control\\\\Print\\\\Monitors)"
        )
    )
    OR
    (
        match(parent_process_path, "(?i)^E:\\\\Program Files\\\\AeroScout\\\\MobileView\\\\services\\\\.*\\\\tomcat9\.exe$")
        AND process_name="sc.exe"
        AND match(process, "(?i)^sc qc (mv_[a-z-]+
|mobileviewhttpserver)( [0-9]+)?$")
    )
)

| `security_content_ctime(firstTime)`

| `security_content_ctime(lastTime)`

| `windows_suspicious_child_process_spawned_from_webserver_filter`