top of page

AI-Assisted Attack Put PHP Shells on Three Linux Servers

Writer: Inception Security
Inception Security
13 minutes ago
17 min read
Four-panel comic: a robot burglar slips in through a WEB APP window, reads a key ring and opens a back office safe, notes pass through shared walls and three back doors open, then the owner with a 13:00 stopwatch changes every lock while a helper seals the walls. Footer: Deleting the shell is not recovery.

What this means for your clients: If your company runs a website or customer portal on Linux, an attacker who breaks into that one app can reach neighboring servers and the records behind them in minutes, so ask your IT provider to watch those servers today.


One custom PHP application at an internet service provider gave an attacker a foothold, and 13 minutes later three neighboring Linux servers had PHP shells too. Microsoft reconstructed this intrusion from endpoint telemetry and ties the infrastructure to a CyberStrikeAI console. Microsoft assesses that AI assisted parts of the work. It does not say the attack ran itself.


As of 6:46 AM MST, December 2, 2026, Microsoft reports an AI-assisted intrusion at an internet service provider that went from one custom PHP application to PHP shells on three peer Linux servers within 13 minutes, and links the attacker's infrastructure to an instance of the CyberStrikeAI framework.


What happened


Microsoft Threat Intelligence watched command execution through a custom PHP application on a Linux server. The first commands checked the host, account, kernel and PHP restrictions, then used the app's own configuration and database helper to query a database on another host. About seven minutes in, the operation pulled subscriber names, addresses, telephone numbers and equipment identifiers. It reused a peer application's upload handler to place a web shell, as PHP, on three peer servers within 13 minutes, and deployed native executables there. When direct egress failed, it turned a peer into a relay whose payloads talked to local listeners, so hunts that only watch internet connections miss this step. Microsoft says this ran within a few hours, from the first recovered console contact to containment, with collection, peer expansion and relay setup overlapping.


Compromised hosts communicated with 2[.]26[.]80[.]51. At analysis time, that address and internet-money[.]xyz served a CyberStrikeAI console, which Microsoft says links the operation to a CyberStrikeAI instance the attacker controlled. Within the past month the operator replaced that console with a modified ARTEX rebranded "Hounded", a change Microsoft says does not by itself link the operation to earlier ARTEX activity.


Microsoft also describes seven other intrusions that share a task-ID naming pattern and shell command patterns, at a government organization, a retail organization, a telecommunications and payments provider, a national rail transport provider, a business school, a university and a shared hosting provider. These are not confirmed CyberStrikeAI operations or one campaign, and Microsoft found no shared infrastructure. Application paths included PHP, WebLogic, Talend, Next.js and Node.js.


CISA warned on November 30 that agentic offensive frameworks, a list that includes Cyber Strike AI, do not change the tactics attackers use, but they do raise the speed and scale of AI-assisted attacks. SecurityWeek reports CISA has seen such incidents across federal, state and critical infrastructure organizations. The Hacker News summarized Microsoft's case.


Why this matters for MSPs and small businesses


Every company with a website or customer portal on Linux has a version of that provider's PHP app: a service account that can read a database password, an upload handler another server trusts, and a flat network behind it. The defense is ordinary Linux security and web server security: keep secrets out of files the app can read, stop the web runtime from starting a shell, and alert on the patterns Microsoft published. The lesson of this AI-Assisted Attack travels beyond ISP security.


Customer records were queried within minutes, and one foothold became lateral movement to peers. Microsoft maps other cases' movement toward identity systems in MITRE ATT&CK. A shared hosting provider was one of the seven pattern cases, with signing keys and passwords pulled from backups, an MSP security problem and a small business security problem at once. Deleting a shell does not take back the credentials it already saw.


What to do today


List every Linux server that runs a web or app runtime and confirm an endpoint sensor is on it. Patch internet-facing apps, restrict admin interfaces, and block unauthorized uploads. Where the app allows it, disable PHP functions that run shell commands; disable_functions in php.ini is the usual control. Run apps under least-privileged accounts, and let database listeners accept only the hosts and accounts that need them. Move database passwords and keys out of files the app account can read, and put them in a vault. That is secrets management. Use key-based SSH, and watch authorized_keys, sudoers and crontab.


Restrict server-to-server traffic, and alert when a server starts forwarding for its peers or opens a new listener. Blocking egress alone was routed around. If you find a shell, start incident response in parallel: isolate, preserve evidence, rotate credentials, replace SSH keys, then check upload directories, deployed code, cron, authorized_keys and accounts. Deleting one shell does not establish recovery. Block Microsoft's three network indicators now.


Indicator (defanged)

Type

Microsoft context

2[.]26[.]80[.]51

IPv4

Console contact; CyberStrikeAI infrastructure at analysis time

internet-money[.]xyz

Domain

Domain associated with the console address

78[.]47[.]123[.]137

IPv4

Executable downloads, connectivity tests and relay destination

9c70b61a4c0da2dd6d8c998a52c7b60c9d4005e2e36e658e94af9f18fb4f13f1

SHA-256

PHP web shell


How to hunt


Hunt the last 30 days of endpoint telemetry, and search the indicators and hash across full retention. This threat hunting uses Splunk, Elastic, CrowdStrike and Microsoft Defender; the same KQL runs in Microsoft Sentinel when those tables are connected.


Test 1: which Linux servers run a web app your endpoint tool can see


Purpose: Linux hosts running PHP, a web server, Java or Node, plus listed app servers with no process events.


Splunk


| tstats summariesonly=false count min(_time) as first_seen max(_time) as last_seen values(Processes.process_name) as runtimes values(Processes.parent_process_name) as parents values(Processes.user) as accounts from datamodel=Endpoint.Processes where earliest="-30d@d" (Processes.process_name IN ("php-fpm", "php-cgi", "php", "apache2", "httpd", "nginx", "java", "node") OR Processes.process_name="php*" OR Processes.parent_process_name IN ("php-fpm", "php-cgi", "php", "apache2", "httpd", "nginx", "java", "node") OR Processes.parent_process_name="php*" OR Processes.dest IN ("YOUR_APP_SERVER_1", "YOUR_APP_SERVER_2")) by Processes.dest
| rename Processes.* as *
| eval rt=mvappend(runtimes, parents), app=mvfilter(match(rt, "^(php|apache2|httpd|nginx|java|node)"))
| eval status=case(mvcount(app)>0, "1 Linux host running a web or app runtime",
    in(dest, "YOUR_APP_SERVER_1", "YOUR_APP_SERVER_2") AND last_seen >= relative_time(now(), "-1d"), "3 listed app server with process events and no web or app runtime")
| append [| tstats summariesonly=false count max(_time) as last_seen from datamodel=Endpoint.Processes where earliest="-30d@d" Processes.dest IN ("YOUR_APP_SERVER_1", "YOUR_APP_SERVER_2") by Processes.dest
    | rename Processes.dest as dest
    | append [| makeresults | eval dest=split("YOUR_APP_SERVER_1,YOUR_APP_SERVER_2", ",") | mvexpand dest | eval count=0 | fields dest count]
    | stats sum(count) as count max(last_seen) as last_seen by dest
    | where count=0 OR last_seen < relative_time(now(), "-1d")
    | eval status="2 listed app server with no process events in the last day: not cleared, no hunt coverage"]
| where isnotnull(status)
| convert ctime(first_seen) ctime(last_seen)
| table status dest runtimes accounts count first_seen last_seen
| sort status dest

Elastic


FROM YOUR_INDEX
| WHERE @timestamp >= NOW() - 30 days AND host.os.type == "linux" AND event.type == "start"
| EVAL runtime = process.name IN ("php-fpm", "php-cgi", "php", "apache2", "httpd", "nginx", "java", "node") OR process.name LIKE "php*"
    OR process.parent.name IN ("php-fpm", "php-cgi", "php", "apache2", "httpd", "nginx", "java", "node") OR process.parent.name LIKE "php*",
    listed = host.name IN ("YOUR_APP_SERVER_1", "YOUR_APP_SERVER_2")
| WHERE runtime OR listed
| STATS app_events = COUNT(*) WHERE runtime, first_seen = MIN(@timestamp) WHERE runtime, last_seen = MAX(@timestamp) WHERE runtime,
    last_event = MAX(@timestamp), runtimes = VALUES(process.name) WHERE runtime, accounts = VALUES(process.user.name) WHERE runtime BY host.name
| EVAL status = CASE(app_events > 0, "1 Linux host running a web or app runtime",
    last_event < NOW() - 1 day, "2 listed app server with no process events in the last day: not cleared, no hunt coverage",
    "3 listed app server with process events and no web or app runtime")
| SORT status, host.name

CrowdStrike


// Time picker: last 30 days.
// YOUR_APP_SERVER_1 and YOUR_APP_SERVER_2 name the internet-facing Linux web and app hosts you manage.
#event_simpleName=ProcessRollup2 event_platform=Lin
| case {
    ImageFileName=/(^|\/)(php[^\/]*|apache2|httpd|nginx|java|node)$/i | runtime := 1 ;
    ParentBaseFileName=/^(php.*|apache2|httpd|nginx|java|node)$/i | runtime := 1 ;
    in(field=ComputerName, values=["YOUR_APP_SERVER_1", "YOUR_APP_SERVER_2"], ignoreCase=true) | runtime := 0 }
| groupBy([ComputerName], function=[sum(runtime, as=app_events), min(@timestamp, as=first_seen), max(@timestamp, as=last_seen), collect([ImageFileName, UID])], limit=max)
| case {
    test(app_events > 0) | status := "1 Linux host running a web or app runtime" ;
    test(last_seen < now() - 86400000) | status := "2 listed app server with no process events in the last day: not cleared, no hunt coverage" ;
    * | status := "3 listed app server with process events and no web or app runtime" }
| sort([status, ComputerName], order=asc, limit=10000)

Microsoft KQL


let start = ago(30d);
let appServers = dynamic(["YOUR_APP_SERVER_1", "YOUR_APP_SERVER_2"]);
let runtimes = dynamic(["php-fpm", "php-cgi", "php", "apache2", "httpd", "nginx", "java", "node"]);
let linux = DeviceInfo
    | where Timestamp >= start and OSPlatform == "Linux"
    | summarize hint.strategy=shuffle arg_max(Timestamp, OSPlatform) by DeviceId, DeviceName;
DeviceProcessEvents
| where Timestamp >= start
| join kind=inner linux on DeviceId
| extend Runtime = FileName startswith "php" or FileName in~ (runtimes) or InitiatingProcessFileName startswith "php" or InitiatingProcessFileName in~ (runtimes)
| where Runtime or DeviceName in~ (appServers)
| summarize AppEvents = countif(Runtime), FirstSeen = minif(Timestamp, Runtime), LastSeen = maxif(Timestamp, Runtime), LastEvent = max(Timestamp),
    Runtimes = make_set(FileName, 20), Accounts = make_set(AccountName, 10) by DeviceName
| extend Status = case(AppEvents > 0, "1 Linux host running a web or app runtime",
    LastEvent < ago(1d), "2 listed app server with no process events in the last day: not cleared, no hunt coverage",
    "3 listed app server with process events and no web or app runtime")
| order by Status asc, DeviceName asc

Field mapping: Splunk CIM Endpoint Processes; Elastic process and host fields; CrowdStrike ProcessRollup2; Microsoft Defender DeviceProcessEvents joined to DeviceInfo on Linux. A listed app server missing here has no sensor. False positives: developer workstations running node or php stay in the list.


Hunt 1: the web app starting shells in bursts


Purpose: shells from a web or app runtime, 20 distinct commands per host in one minute, and five labelled echo batches in 15 minutes.


Splunk


| tstats summariesonly=false count dc(Processes.process) as distinct_cmds values(Processes.parent_process_name) as parents from datamodel=Endpoint.Processes where earliest="-30d@d" (Processes.parent_process_name IN ("php-fpm", "php-cgi", "php", "apache2", "httpd", "nginx", "java", "node") OR Processes.parent_process_name="php*") by _time span=1m Processes.dest
| rename Processes.dest as dest
| where distinct_cmds>=20
| eval flag="1 20 or more distinct command lines in one minute from an app runtime"
| append [| tstats summariesonly=false count as batches dc(Processes.process) as distinct_cmds values(Processes.process) as commands from datamodel=Endpoint.Processes where earliest="-30d@d" (Processes.parent_process_name IN ("php-fpm", "php-cgi", "php", "apache2", "httpd", "nginx", "java", "node") OR Processes.parent_process_name="php*") Processes.process="*echo*" (Processes.process="*===*" OR Processes.process="*###*" OR Processes.process="*---*") by _time span=15m Processes.dest Processes.parent_process_name
    | rename Processes.* as *
    | where batches>=5
    | eval flag="1 five or more labelled echo batches in 15 minutes from an app runtime"]
| append [| tstats summariesonly=false count min(_time) as first_seen max(_time) as last_seen values(Processes.process) as commands values(Processes.user) as accounts from datamodel=Endpoint.Processes where earliest="-30d@d" Processes.process_name IN ("sh", "bash", "dash", "zsh") (Processes.parent_process_name IN ("php-fpm", "php-cgi", "php", "apache2", "httpd", "nginx", "java", "node") OR Processes.parent_process_name="php*") by Processes.dest Processes.parent_process_name Processes.process_name
    | rename Processes.* as *
    | eval flag="2 shell started by a web or app runtime"]
| table flag dest parent_process_name process_name distinct_cmds batches commands accounts count first_seen last_seen _time
| sort flag dest

Elastic


FROM YOUR_INDEX
| WHERE @timestamp >= NOW() - 30 days AND host.os.type == "linux"
    AND (process.parent.name IN ("php-fpm", "php-cgi", "php", "apache2", "httpd", "nginx", "java", "node") OR process.parent.name LIKE "php*")
| EVAL minute = DATE_TRUNC(1 minute, @timestamp), quarter = DATE_TRUNC(15 minutes, @timestamp),
    labelled = process.command_line RLIKE ".*echo[ \t]+['\"]?(===|\\#\\#\\#|---).*",
    shell = process.name IN ("sh", "bash", "dash", "zsh")
| STATS distinct_cmds = COUNT_DISTINCT(process.command_line), batches_min = COUNT(*) WHERE labelled, shells = COUNT(*) WHERE shell,
    first_seen = MIN(@timestamp), last_seen = MAX(@timestamp), commands = VALUES(process.command_line) BY host.name, process.parent.name, quarter, minute
| STATS distinct_cmds = MAX(distinct_cmds), batches = SUM(batches_min), shells = SUM(shells),
    first_seen = MIN(first_seen), last_seen = MAX(last_seen), commands = VALUES(commands) BY host.name, process.parent.name, quarter
| EVAL flag = CASE(distinct_cmds >= 20, "1 20 or more distinct command lines in one minute from an app runtime",
    batches >= 5, "1 five or more labelled echo batches in 15 minutes from an app runtime",
    shells > 0, "2 shell started by a web or app runtime",
    NULL)
| WHERE flag IS NOT NULL
| SORT flag, host.name

CrowdStrike


// Time picker: last 30 days.
// Labelled batches and one-minute bursts follow Microsoft's thresholds.
#event_simpleName=ProcessRollup2 event_platform=Lin
| ParentBaseFileName=/^(php.*|apache2|httpd|nginx|java|node)$/i
| case { CommandLine=/echo\s+['"]?(===|###|---)/ | labelled := 1 ; * | labelled := 0 }
| case { ImageFileName=/(^|\/)(sh|bash|dash|zsh)$/ | shell := 1 ; * | shell := 0 }
| minute := @timestamp - (@timestamp % 60000)
| quarter := @timestamp - (@timestamp % 900000)
| groupBy([ComputerName, ParentBaseFileName, quarter, minute], function=[count(CommandLine, distinct=true, as=distinct_cmds), sum(labelled, as=batches_min), sum(shell, as=shells), collect([CommandLine])], limit=max)
| groupBy([ComputerName, ParentBaseFileName, quarter], function=[max(distinct_cmds, as=distinct_cmds), sum(batches_min, as=batches), sum(shells, as=shells), collect([CommandLine])], limit=max)
| case {
    test(distinct_cmds >= 20) | flag := "1 20 or more distinct command lines in one minute from an app runtime" ;
    test(batches >= 5) | flag := "1 five or more labelled echo batches in 15 minutes from an app runtime" ;
    test(shells > 0) | flag := "2 shell started by a web or app runtime" }
| sort([flag, ComputerName], order=asc, limit=10000)

Microsoft KQL


let start = ago(30d);
let runtimes = dynamic(["java", "node", "httpd", "apache2", "nginx"]);
let labelled = DeviceProcessEvents
    | where Timestamp >= start and FileName in~ ("sh", "bash", "dash", "zsh")
    | where InitiatingProcessFileName startswith "php" or InitiatingProcessFileName in~ (runtimes)
        or InitiatingProcessParentFileName startswith "php" or InitiatingProcessParentFileName in~ (runtimes)
    | where ProcessCommandLine matches regex @"echo\s+['""]?(===|###|---)"
    | summarize Batches = count(), DistinctCommands = dcount(ProcessCommandLine), FirstSeen = min(Timestamp), LastSeen = max(Timestamp) by DeviceName, InitiatingProcessFileName, Bucket = bin(Timestamp, 15m)
    | where Batches >= 5
    | extend Flag = "1 five or more labelled echo batches in 15 minutes from an app runtime";
let bursts = DeviceProcessEvents
    | where Timestamp >= start
    | where InitiatingProcessFileName startswith "php" or InitiatingProcessFileName in~ ("java", "node")
        or InitiatingProcessParentFileName startswith "php" or InitiatingProcessParentFileName in~ ("java", "node")
    | summarize DistinctCommands = dcount(ProcessCommandLine), Events = count() by DeviceName, Bucket = bin(Timestamp, 1m)
    | where DistinctCommands >= 20
    | extend Flag = "1 20 or more distinct command lines in one minute from an app runtime";
let shells = DeviceProcessEvents
    | where Timestamp >= start and FileName in~ ("sh", "bash", "dash", "zsh")
    | where InitiatingProcessFileName startswith "php" or InitiatingProcessFileName in~ (runtimes)
        or InitiatingProcessParentFileName startswith "php" or InitiatingProcessParentFileName in~ (runtimes)
    | summarize Events = count(), FirstSeen = min(Timestamp), LastSeen = max(Timestamp), Commands = make_set(ProcessCommandLine, 20) by DeviceName, InitiatingProcessFileName
    | extend Flag = "2 shell started by a web or app runtime";
union labelled, bursts, shells
| order by Flag asc, DeviceName asc

Field mapping: Splunk CIM Endpoint Processes; Elastic process fields; CrowdStrike ProcessRollup2; Microsoft Defender DeviceProcessEvents, including InitiatingProcessParentFileName. False positives: deploy scripts and CMS updaters start shells; treat a burst or labelled batch as the signal.


Hunt 2: the web app reading secrets and keys


Purpose: PHP, Java, Node, sh or bash reading Microsoft's secret-file list, plus /etc/shadow and sudo -n -l.


Splunk


| tstats summariesonly=false count min(_time) as first_seen max(_time) as last_seen values(Processes.process) as commands values(Processes.user) as accounts from datamodel=Endpoint.Processes where earliest="-30d@d" (Processes.parent_process_name IN ("php-fpm", "php-cgi", "php", "apache2", "httpd", "nginx", "java", "node", "sh", "bash") OR Processes.parent_process_name="php*") by Processes.dest Processes.parent_process_name Processes.process_name Processes.process
| rename Processes.* as *
| eval reader=if(match(process, "(^| )(cat|grep|find|head|tar)( |$)"), 1, 0)
| eval secret=if(match(process, "(\\.env|db\\.inc|credentials\\.php|wp-config\\.php|SerializedSystemIni\\.dat|authorized_keys|id_rsa|\\.netrc|DB_PASSWORD|mysql\\.sql-auth\\.json|proftpdpasswd)"), 1, 0)
| eval flag=case(match(process, "/etc/shadow") OR match(process, "sudo -n -l"), "1 app context read /etc/shadow or ran sudo -n -l",
    reader==1 AND secret==1, "1 app context read a credential, key or config file")
| where isnotnull(flag)
| stats sum(count) as events min(first_seen) as first_seen max(last_seen) as last_seen values(commands) as commands values(accounts) as accounts values(process_name) as process_name by flag dest parent_process_name
| convert ctime(first_seen) ctime(last_seen)
| sort flag dest

Elastic


FROM YOUR_INDEX
| WHERE @timestamp >= NOW() - 30 days AND host.os.type == "linux"
    AND (process.parent.name IN ("php-fpm", "php-cgi", "php", "apache2", "httpd", "nginx", "java", "node", "sh", "bash") OR process.parent.name LIKE "php*")
| EVAL cmd = process.command_line,
    flag = CASE(
      cmd LIKE "*/etc/shadow*" OR cmd LIKE "*sudo -n -l*", "1 app context read /etc/shadow or ran sudo -n -l",
      (cmd LIKE "*cat *" OR cmd LIKE "*grep *" OR cmd LIKE "*find *" OR cmd LIKE "*head *" OR cmd LIKE "*tar *")
        AND (cmd LIKE "*.env*" OR cmd LIKE "*db.inc*" OR cmd LIKE "*credentials.php*" OR cmd LIKE "*wp-config.php*"
          OR cmd LIKE "*SerializedSystemIni.dat*" OR cmd LIKE "*authorized_keys*" OR cmd LIKE "*id_rsa*" OR cmd LIKE "*.netrc*"
          OR cmd LIKE "*DB_PASSWORD*" OR cmd LIKE "*mysql.sql-auth.json*" OR cmd LIKE "*proftpdpasswd*"),
      "1 app context read a credential, key or config file",
      NULL)
| WHERE flag IS NOT NULL
| STATS events = COUNT(*), first_seen = MIN(@timestamp), last_seen = MAX(@timestamp), commands = VALUES(process.command_line),
    accounts = VALUES(process.user.name), children = VALUES(process.name) BY flag, host.name, process.parent.name
| SORT flag, host.name

CrowdStrike


// Time picker: last 30 days.
#event_simpleName=ProcessRollup2 event_platform=Lin
| ParentBaseFileName=/^(php.*|apache2|httpd|nginx|java|node|sh|bash)$/i
| case {
    CommandLine=/\/etc\/shadow|sudo -n -l/ | flag := "1 app context read /etc/shadow or ran sudo -n -l" ;
    CommandLine=/(^|\s)(cat|grep|find|head|tar)(\s|$)/
      CommandLine=/\.env|db\.inc|credentials\.php|wp-config\.php|SerializedSystemIni\.dat|authorized_keys|id_rsa|\.netrc|DB_PASSWORD|mysql\.sql-auth\.json|proftpdpasswd/
      | flag := "1 app context read a credential, key or config file" }
| groupBy([flag, ComputerName, ParentBaseFileName], function=[count(as=events), min(@timestamp, as=first_seen), max(@timestamp, as=last_seen), collect([CommandLine, ImageFileName, UID])], limit=max)
| sort([flag, ComputerName], order=asc, limit=10000)

Microsoft KQL


let start = ago(30d);
let parents = dynamic(["java", "node", "sh", "bash"]);
DeviceProcessEvents
| where Timestamp >= start
| where InitiatingProcessFileName startswith "php" or InitiatingProcessFileName in~ (parents)
| extend Flag = case(
    ProcessCommandLine contains "/etc/shadow" or ProcessCommandLine contains "sudo -n -l", "1 app context read /etc/shadow or ran sudo -n -l",
    ProcessCommandLine has_any (".env", "db.inc", "credentials.php", "wp-config.php", "SerializedSystemIni.dat", "authorized_keys", "id_rsa", ".netrc", "DB_PASSWORD", "mysql.sql-auth.json", "proftpdpasswd")
        and ProcessCommandLine has_any ("cat ", "grep ", "find ", "head ", "tar "),
    "1 app context read a credential, key or config file",
    "")
| where isnotempty(Flag)
| summarize Events = count(), FirstSeen = min(Timestamp), LastSeen = max(Timestamp), Commands = make_set(ProcessCommandLine, 20), Accounts = make_set(AccountName, 10) by Flag, DeviceName, InitiatingProcessFileName
| order by Flag asc, DeviceName asc

Field mapping: Splunk CIM Endpoint Processes; Elastic process.command_line; CrowdStrike ProcessRollup2; Microsoft Defender DeviceProcessEvents. False positives: backup and configuration-management jobs; exclude by parent and account, not by file name.


Hunt 3: PHP shells and relays spreading to the servers next door


Purpose: PHP written across servers in an hour, Microsoft's hash or a zz-prefixed PHP file, its addresses, new listeners or internal peers, and curl to ntfy.sh.


Splunk


| tstats summariesonly=false count min(_time) as first_seen max(_time) as last_seen values(Filesystem.file_path) as paths values(Filesystem.user) as users values(Filesystem.file_hash) as file_hashes from datamodel=Endpoint.Filesystem where earliest=0 (Filesystem.file_hash="9c70b61a4c0da2dd6d8c998a52c7b60c9d4005e2e36e658e94af9f18fb4f13f1" OR Filesystem.file_name="zz*.php" OR (Filesystem.file_name="*.php" AND (Filesystem.file_path="YOUR_WEB_ROOT_1*" OR Filesystem.file_path="YOUR_WEB_ROOT_2*") AND Filesystem.action IN ("created", "modified"))) by _time span=1h Filesystem.dest Filesystem.file_name
| rename Filesystem.* as *
| eval flag=case(isnotnull(mvfind(file_hashes, "^9c70b61a4c0da2dd6d8c998a52c7b60c9d4005e2e36e658e94af9f18fb4f13f1$")), "1 file matches the Microsoft PHP web shell hash",
    match(file_name, "^zz.*\\.php$"), "1 zz-prefixed PHP file written",
    true(), "2 PHP written in a web root or upload folder")
| stats sum(count) as events min(first_seen) as first_seen max(last_seen) as last_seen dc(dest) as hosts values(dest) as dests values(paths) as paths values(users) as users by flag _time
| eval flag=if(flag=="2 PHP written in a web root or upload folder" AND hosts>=2, "1 PHP written in web roots on more than one server in an hour", flag)
| where flag!="2 PHP written in a web root or upload folder" OR hosts>=2
| append [| tstats summariesonly=false count as events min(_time) as first_seen max(_time) as last_seen values(All_Traffic.dest_ip) as dests values(All_Traffic.dest_port) as ports from datamodel=Network_Traffic.All_Traffic where earliest=0 All_Traffic.src_ip IN ("YOUR_APP_SERVER_IP_1", "YOUR_APP_SERVER_IP_2") (All_Traffic.dest_ip IN ("2.26.80.51", "78.47.123.137") OR All_Traffic.dest="*internet-money.xyz*") by All_Traffic.src_ip
    | rename All_Traffic.src_ip as dest
    | eval flag="1 app server contacted a Microsoft indicator address or domain"]
| append [| tstats summariesonly=false count min(_time) as first_seen max(_time) as last_seen values(All_Traffic.dest_port) as ports from datamodel=Network_Traffic.All_Traffic where earliest="-30d@d" All_Traffic.src_ip IN ("YOUR_APP_SERVER_IP_1", "YOUR_APP_SERVER_IP_2") by _time span=1h All_Traffic.src_ip All_Traffic.dest_ip
    | rename All_Traffic.src_ip as dest All_Traffic.dest_ip as dest_ip
    | where cidrmatch("YOUR_APP_SUBNET_1", dest_ip) OR cidrmatch("YOUR_APP_SUBNET_2", dest_ip)
    | stats sum(count) as events min(first_seen) as first_seen max(last_seen) as last_seen dc(dest_ip) as peers values(dest_ip) as dests values(ports) as ports by _time dest
    | where peers>=5
    | eval flag="2 app server connected to 5 or more internal peers in an hour"]
| append [| tstats summariesonly=false count as events min(_time) as first_seen max(_time) as last_seen values(Processes.process) as commands from datamodel=Endpoint.Processes where earliest="-30d@d" Processes.process_name="curl" Processes.process="*ntfy.sh*" Processes.process="*--data-binary @*" by Processes.dest
    | rename Processes.dest as dest
    | eval flag="1 curl posted a file to ntfy.sh"]
| append [| tstats summariesonly=false count as events min(_time) as first_seen max(_time) as last_seen values(Ports.dest_port) as ports values(Ports.user) as users from datamodel=Endpoint.Ports where earliest="-30d@d" Ports.state="listening" Ports.dest IN ("YOUR_APP_SERVER_1", "YOUR_APP_SERVER_2") by Ports.dest
    | rename Ports.dest as dest
    | eval flag="2 app server opened a listening port"]
| table flag dest dests hosts paths ports users commands events first_seen last_seen
| sort flag dest

Elastic


FROM YOUR_INDEX
| WHERE host.name IN ("YOUR_APP_SERVER_1", "YOUR_APP_SERVER_2")
    AND (
      (event.category == "file" AND event.type IN ("creation", "change") AND (file.hash.sha256 == "9c70b61a4c0da2dd6d8c998a52c7b60c9d4005e2e36e658e94af9f18fb4f13f1" OR file.name LIKE "zz*.php" OR (file.extension == "php" AND (file.path LIKE "YOUR_WEB_ROOT_1*" OR file.path LIKE "YOUR_WEB_ROOT_2*"))))
      OR (event.category == "network" AND (destination.ip IN (TO_IP("2.26.80.51"), TO_IP("78.47.123.137")) OR destination.domain == "internet-money.xyz" OR CIDR_MATCH(destination.ip, "YOUR_APP_SUBNET_1", "YOUR_APP_SUBNET_2")))
      OR (process.name == "curl" AND process.command_line LIKE "*ntfy.sh*" AND process.command_line LIKE "*--data-binary @*")
    )
| EVAL hour = DATE_TRUNC(1 hour, @timestamp),
    flag = CASE(
      file.hash.sha256 == "9c70b61a4c0da2dd6d8c998a52c7b60c9d4005e2e36e658e94af9f18fb4f13f1", "1 file matches the Microsoft PHP web shell hash",
      file.name LIKE "zz*.php", "1 zz-prefixed PHP file written",
      destination.ip IN (TO_IP("2.26.80.51"), TO_IP("78.47.123.137")) OR destination.domain == "internet-money.xyz", "1 app server contacted a Microsoft indicator address or domain",
      process.name == "curl" AND process.command_line LIKE "*ntfy.sh*" AND process.command_line LIKE "*--data-binary @*", "1 curl posted a file to ntfy.sh",
      event.category == "file", "2 PHP written in a web root or upload folder",
      "2 app server connected to an internal peer")
| STATS events = COUNT(*), first_seen = MIN(@timestamp), last_seen = MAX(@timestamp), hosts = COUNT_DISTINCT(host.name),
    servers = VALUES(host.name), paths = VALUES(file.path), dests = VALUES(TO_STRING(destination.ip)), ports = VALUES(destination.port), commands = VALUES(process.command_line) BY flag, hour
| EVAL flag = CASE(flag == "2 PHP written in a web root or upload folder" AND hosts >= 2, "1 PHP written in web roots on more than one server in an hour",
    flag == "2 app server connected to an internal peer" AND dests IS NOT NULL, flag,
    flag)
| WHERE flag LIKE "1 *" OR (flag == "2 app server connected to an internal peer")
| SORT flag, first_seen

CrowdStrike


// Time picker: full retention for the hash and indicators, 30 days for behavior. File rows need a FileVantage policy on YOUR_WEB_ROOTS, or Linux script-write events.
// ntfy.sh is a legitimate notification service; the signal is curl posting a file from an app server.
#event_simpleName=/^(ProcessRollup2|NetworkConnectIP4|NetworkListenIP4|FileIntegrityMonitorRuleMatched|NewScriptWritten|WebScriptFileWritten)$/ event_platform=Lin
| case { ObjectName=* | path := ObjectName ; TargetFileName=* | path := TargetFileName ; * }
| case {
    SHA256="9c70b61a4c0da2dd6d8c998a52c7b60c9d4005e2e36e658e94af9f18fb4f13f1" or FileHash="9c70b61a4c0da2dd6d8c998a52c7b60c9d4005e2e36e658e94af9f18fb4f13f1" | flag := "1 file matches the Microsoft PHP web shell hash" ;
    path=/\/zz[^\/]*\.php$/i or FileName=/^zz.*\.php$/i | flag := "1 zz-prefixed PHP file written" ;
    path=/YOUR_WEB_ROOT_1|YOUR_WEB_ROOT_2/i | path=/\.php$/i | flag := "2 PHP written in a web root or upload folder" ;
    RemoteAddressIP4=/^(2\.26\.80\.51|78\.47\.123\.137)$/ or DomainName=/internet-money\.xyz$/i | in(field=ComputerName, values=["YOUR_APP_SERVER_1", "YOUR_APP_SERVER_2"], ignoreCase=true) | flag := "1 app server contacted a Microsoft indicator address or domain" ;
    #event_simpleName=NetworkListenIP4 | in(field=ComputerName, values=["YOUR_APP_SERVER_1", "YOUR_APP_SERVER_2"], ignoreCase=true) | flag := "2 app server opened a listening port" | detail := LocalPort ;
    #event_simpleName=NetworkConnectIP4 | in(field=ComputerName, values=["YOUR_APP_SERVER_1", "YOUR_APP_SERVER_2"], ignoreCase=true) | cidr(RemoteAddressIP4, subnet=["YOUR_APP_SUBNET_1", "YOUR_APP_SUBNET_2"]) | flag := "2 app server connected to an internal peer" | detail := RemoteAddressIP4 ;
    #event_simpleName=ProcessRollup2 | ImageFileName=/(^|\/)curl$/ | CommandLine=/ntfy\.sh/i | CommandLine=/--data-binary @/ | flag := "1 curl posted a file to ntfy.sh" }
| hour := @timestamp - (@timestamp % 3600000)
| groupBy([flag, hour], function=[count(as=events), count(ComputerName, distinct=true, as=hosts), min(@timestamp, as=first_seen), max(@timestamp, as=last_seen), collect([ComputerName, path, FileName, ImageFileName, RemoteAddressIP4, LocalPort, CommandLine])], limit=max)
| case {
    flag="2 PHP written in a web root or upload folder" | test(hosts >= 2) | flag := "1 PHP written in web roots on more than one server in an hour" ;
    flag="2 PHP written in a web root or upload folder" | dropEvent() ;
    * }
| sort([flag], order=asc, limit=10000)

Microsoft KQL


// Runs in Microsoft Defender advanced hunting.
let start = ago(30d);
let hash = "9c70b61a4c0da2dd6d8c998a52c7b60c9d4005e2e36e658e94af9f18fb4f13f1";
let roots = dynamic(["YOUR_WEB_ROOT_1", "YOUR_WEB_ROOT_2"]);
let appServers = dynamic(["YOUR_APP_SERVER_1", "YOUR_APP_SERVER_2"]);
let peers = dynamic(["YOUR_APP_SUBNET_1", "YOUR_APP_SUBNET_2"]);
let files = DeviceFileEvents
    | where SHA256 == hash or FileName matches regex @"^zz.*\.php$" or (FileName endswith ".php" and ActionType in ("FileCreated", "FileModified") and FolderPath has_any (roots))
    | extend Flag = case(SHA256 == hash, "1 file matches the Microsoft PHP web shell hash",
        FileName matches regex @"^zz.*\.php$", "1 zz-prefixed PHP file written",
        "2 PHP written in a web root or upload folder")
    | summarize Events = count(), FirstSeen = min(Timestamp), LastSeen = max(Timestamp), Paths = make_set(FolderPath, 20), Writers = make_set(InitiatingProcessFileName, 10), Devices = make_set(DeviceName, 20), Hosts = dcount(DeviceName) by Flag, Bucket = bin(Timestamp, 1h)
    | extend Flag = iff(Flag startswith "2" and Hosts >= 2, "1 PHP written in web roots on more than one server in an hour", Flag)
    | where Flag startswith "1";
let net = DeviceNetworkEvents
    | where DeviceName in~ (appServers) and (Timestamp >= start or RemoteIP in ("2.26.80.51", "78.47.123.137") or RemoteUrl has "internet-money.xyz")
    | extend Flag = case(RemoteIP in ("2.26.80.51", "78.47.123.137") or RemoteUrl has "internet-money.xyz", "1 app server contacted a Microsoft indicator address or domain",
        InitiatingProcessFileName =~ "curl" and RemoteUrl contains "ntfy.sh" and InitiatingProcessCommandLine contains "--data-binary @", "1 curl posted a file to ntfy.sh",
        ActionType == "ListeningConnectionCreated", "2 app server opened a listening port",
        ipv4_is_in_any_range(RemoteIP, peers), "2 app server connected to an internal peer", "")
    | where isnotempty(Flag)
    | summarize Events = count(), FirstSeen = min(Timestamp), LastSeen = max(Timestamp), Remotes = make_set(RemoteIP, 20), Ports = make_set(iff(Flag has "listening", LocalPort, RemotePort), 20) by Flag, DeviceName;
union files, net
| order by Flag asc

Field mapping: Splunk CIM Filesystem, Network_Traffic, Processes and Ports; Elastic file and destination fields; CrowdStrike FileVantage, NetworkConnectIP4 and NetworkListenIP4; Microsoft Defender DeviceFileEvents and DeviceNetworkEvents. ntfy.sh is a legitimate notification service. False positives: cluster deployments that write PHP at once.


Reading the results before you escalate


A listed app server missing from Test 1, or marked not cleared, has no sensor: put one on it first. A Hunt 1 hit, especially a burst or a labelled batch, means possible compromise of that app: pull the command list, then run Hunt 2 and Hunt 3 for that host and every server it can reach. A Hunt 2 hit is credential theft unless a backup or configuration-management parent ran it: rotate those secrets and SSH keys now. Only a Hunt 3 hash, zz-prefixed PHP file, Microsoft address, PHP across servers or the relay pattern of an internal proxy means every involved server is compromised. Other Hunt 3 rows, including a listening port, are leads. Isolate, rotate, and check upload folders, deployed code, cron, authorized_keys and accounts on each. Deleting the shell is not recovery.


One next step


Today, list every Linux server that runs a web app, confirm each has an endpoint sensor, and turn Hunt 1 into a scheduled alert. That is detection engineering: the moves were old, and the clock was short. For the Microsoft 365 side of the same identity risk, start with a free Inception Foresight M365 Assessment at inceptionsecurity.com/m365assessment.


Follow us on LinkedIn (Inception Security) and X (@inceptionsec).


bg-map-white.png

INCEPTION SECURITY™

A cybersecurity company with in depth knowledge of the threat landscape and security controls.

NAVIGATION

GET IN TOUCH

© 2025 All Rights Reserved by INCEPTION SECURITY™ .

bottom of page