The Honeypot Detection Playbook: What Attacked My Server, and the Splunk and Sentinel Rules to Catch It
I ran a deliberately vulnerable PHP server on the internet and turned everything that hit it into detections. This is the hub: the kill-chain and ATT&CK coverage map, the data sources you need, and links to twelve posts with tested queries for Splunk + CrowdStrike Falcon and Microsoft Sentinel + Defender for Endpoint.
1. Why I Built This
I put a vulnerable PHP container on a public IP the day after a new PHP bug was disclosed, logged everything into Microsoft Sentinel, and watched. The first request arrived after 33 minutes. Over the next three and a half weeks it took 133,331 SSH password guesses, about 10,500 web requests from more than 1,100 addresses, and every flavour of exploit, credential hunt and scanner you'd expect, plus a few I didn't.
The traffic itself isn't the interesting part. What matters is what a defender should do about it. So each post in this series takes one kind of attack and walks through it the same way:
- the attack step by step, with each step mapped to the kill chain and MITRE ATT&CK
- a Pyramid of Pain table: which indicators are worth your time, and which ones the attacker changes overnight
- detections for two organisations, from cheap web-layer rules up to behavioural endpoint rules
- what to do when each rule fires, and the hardening that makes it not matter
2. How to Read the Series
Every detection is written twice:
- Org A Splunk + CrowdStrike Falcon. Web logs come through the CIM
Webdata model or raw nginx, and endpoint data comes from Falcon Data Replicator events (ProcessRollup2,NetworkConnectIP4,DnsRequest). Correlation uses Enterprise Security risk-based alerting. - Org B Microsoft Sentinel + Defender for Endpoint. Web logs come through a
WebAccessparser, and endpoint data comes from Defender XDR's Advanced Hunting tables (DeviceProcessEvents,DeviceNetworkEvents,DeviceFileEvents). Correlation uses scheduled analytics rules.
Every web-layer KQL query was run against the honeypot's real logs, and the counts in each post are what came back. The honeypot had no EDR on it, so the endpoint queries are written from the payloads the attackers sent, which tell you exactly what would have run. Treat their field names as a starting point for your environment.
3. Coverage Map
Each row is an ATT&CK technique I saw used against the honeypot. The cells show which post covers it and which layer detects it.
| Kill chain | ATT&CK technique | Seen in | Web / log layer | Endpoint / network layer |
|---|---|---|---|---|
| Recon | T1595.001 Scanning IP Blocks | SSH, Non-HTTP | Protocol classification on web ports | New listening port on internet-facing host |
| Recon | T1595.002 Vulnerability Scanning | Spray, RedTail | Multi-family exploit burst; kit fingerprint | Correlated with web-server child process |
| Recon | T1595.003 Wordlist Scanning | .env/.git, AI/MCP | Secret-path wordlist; canary calibration | n/a |
| Recon | T1592.002 Gather Host Software | Spray | Slow edge-device fingerprinting | n/a |
| Credential Access | T1110.001 Password Guessing (incl. distributed) | SSH | Per-source volume; many-sources-one-username | Success after failures (UserLogon, DeviceLogonEvents) |
| Credential Access | T1552.001 Credentials in Files | .env/.git, AI/MCP, React2Shell | Secret file actually served (size check) | Agent token files read by other processes; env; cat .env from an app runtime |
| Initial Access | T1190 Exploit Public-Facing App | All web posts | Code in request; per-CVE rules; execution canaries | n/a |
| Initial Access | T1078 Valid Accounts (incl. .004 Cloud) | SSH, .env/.git | CloudTrail: GetSendQuota, CreateUser; key from new IP | AI API calls from unapproved processes |
| Execution | T1059.004 Unix Shell | RedTail, PHP2Shell, React2Shell, Legacy PHP | n/a | Web server / app runtime spawns a shell |
| Persistence | T1505.003 Web Shell | Legacy PHP, PHP2Shell | pearcmd writes; session-file include | PHP file written to /tmp or web root |
| Persistence | T1098.004 SSH Authorized Keys | SSH | n/a | authorized_keys written; chattr +i |
| Defence Evasion | T1564.001 Hidden Files | RedTail, Legacy PHP | n/a | Dot-file or temp-path executable run by the web user |
| Discovery | T1083 File and Directory Discovery | RedTail | n/a | "Where can I execute?" (findmnt noexec, find -perm, dd test) |
| Discovery | T1082 System Information Discovery | SSH, IoT | n/a | Post-login fingerprinting burst |
| Delivery | T1105 Ingress Tool Transfer | All dropper posts | Download-and-run command to a raw IP | Web tier SSH egress; hostname-beacon pipelines; IoT raw-IP downloads; Mirai-style loader routine |
| C2 | T1071 / T1095 / T1571 App Protocol, Non-App, Non-Standard Port | Non-HTTP, React2Shell, IoT | RAT check-in classification | RAT protocol on the wire; raw-IP beaconing; Node reverse shell; Mozi DHT |
| Impact | T1496 Resource Hijacking | RedTail | n/a | Mining-pool connections (hunt) |
| Impact | T1565.003 / T1491.002 Runtime Manipulation, Defacement | React2Shell | Redirect-rate anomaly per site | (Invisible to EDR: in-memory patch) |
4. The Five Rules to Build First
If you only build five rules from the whole series, build these. Each one sits near the top of the Pyramid of Pain, so it outlives any particular CVE:
- Web server or app runtime spawns a shell or downloader (RedTail E1). It catches almost every successful web RCE in the series, whatever the bug.
- SSH success after failures (SSH L3). It tested at zero results on the honeypot, and that's what you want: when it fires, it matters.
- A secret file was actually served (.env W2). It compares response size with the home page, which removed all 16 false positives a status-only rule would have raised.
- Exploit burst against a host, correlated with an endpoint hit (Spray C1). This turns daily noise into one incident with the story attached.
- Web tier egress on SSH, or to a raw IP on a high port (RedTail E2, React2Shell E2). Droppers and reverse shells both have to leave the box.
5. Data You Need
| Data | Org A Splunk | Org B Sentinel | Why |
|---|---|---|---|
| Web access logs, with POST bodies or a WAF | CIM Web; raw nginx/Apache | W3CIISLog, AzureDiagnostics (WAF), Syslog | Every web-layer rule. Check that large records aren't truncated (see PHP2Shell W4). |
| PHP / app error logs | apache:error, php:error | Syslog / custom table | PHP2Shell's startup memory errors only show here. |
| sshd logs | linux_secure | Syslog (auth) | Brute force and success-after-failure. |
| EDR process, network and file events | Falcon FDR | Defender XDR connector | Every endpoint rule. |
| Network metadata | Zeek, Palo Alto | CommonSecurityLog, ASim DNS | IoT devices and RATs, where there's no EDR. |
| Cloud audit | AWS CloudTrail add-on | AWSCloudTrail | Leaked keys being used. |
Falcon field names for Org A
The Org A queries use the field names Falcon's Event Search shows: FileName, ParentBaseFileName, GrandParentBaseFileName, ComputerName, UserName and the *_decimal process IDs. If you ingest raw Falcon Data Replicator events into Splunk, some of those don't exist yet. Add this macro, put it straight after index=crowdstrike event_simpleName=…, and move the remaining filters into a | search after it:
# macros.conf
[falcon_norm]
definition = eval FileName=coalesce(FileName, replace(ImageFileName, "^.*[\\\\/]", "")), \
TargetProcessId_decimal=coalesce(TargetProcessId_decimal, TargetProcessId), \
ContextProcessId_decimal=coalesce(ContextProcessId_decimal, ContextProcessId), \
ParentProcessId_decimal=coalesce(ParentProcessId_decimal, ParentProcessId) \
| lookup aid_master aid OUTPUTNEW ComputerName \
| lookup falcon_user_map UserSid_readable OUTPUTNEW UserName
The macro needs two lookups, built by two scheduled searches (run them hourly):
# aid_master: host name for each sensor ID, from FDR's aidmaster records
index=crowdstrike sourcetype=crowdstrike:events:aidmaster
| stats latest(ComputerName) as ComputerName by aid
| outputlookup aid_master
# falcon_user_map: user name for each SID, from FDR's user identity events
index=crowdstrike event_simpleName=UserIdentity
| stats latest(UserName) as UserName by UserSid_readable
| outputlookup falcon_user_map
Check the sourcetype names against your Falcon add-on. They differ between the FDR add-on and older Event Stream setups.
Raw FDR doesn't always carry the grandparent's name. Where a query filters on GrandParentBaseFileName, either use the Event Search field or join ProcessRollup2 to itself on aid and ParentProcessId to walk one level up.
The Org B web parser used throughout the series. Swap the source for your own and keep the column names:
let WebAccess = Syslog
| where SyslogMessage startswith "php_http: "
| extend j = parse_json(substring(SyslogMessage, 10))
| project TimeGenerated, DestHost = Computer, SrcIp = tostring(j.client), Method = tostring(j.method), Request = tostring(j.request),
Url = tostring(j.uri), Status = toint(j.status), BytesOut = toint(j.bytes_out),
UserAgent = tostring(j.user_agent), ContentType = tostring(j.content_type), Body = tostring(j.body);
6. The Posts
| Post | What you'll build |
|---|---|
| SSH brute force | Distributed-guessing detection that sees the 784 quiet sources; success-after-failure; post-login fingerprinting; authorized_keys writes |
| Non-HTTP on port 80 | Protocol-mismatch classification; RAT check-in signatures turned outward; open-proxy and odd-method posture |
| .env and .git hunting | Wordlist detection; "secret actually served"; AndroxGh0st sequence; CloudTrail rules for leaked keys |
| Legacy PHP RCE | Code-in-request; execution canaries; hostname-beacon droppers; hidden scripts in /tmp |
| RedTail cryptominer | Exploit-burst behaviour; web-server-spawns-shell; SSH egress; exec-directory discovery; hidden miner |
| IoT botnets and Mozi | Network detections for devices with no EDR; Mozi DHT; Mirai loader on servers; n8n abuse |
| React2Shell | Wrapper detection; PoC boundary; Node reverse shell; fileless redirect-hijack via traffic anomaly |
| PHP2Shell | Upload-progress abuse; session-file include; startup OOM bursts; SIEM truncation check |
| AI keys and MCP | AI-path wordlists; distributed MCP discovery; agent-token theft on endpoints; unapproved AI API use |
| Spray scanners | Canary calibration; slow fingerprinting; kit fingerprints; risk-based correlation |
| Scanner vs attackers | Safe scanner allowlisting; coverage-gap query; using your scan to test your SOC |
| Internet scanner triage | Behaviour-based trust; benign-list abuse detection; new exposure before Censys finds it |