← All Threat Hunting ReportsThreat Hunting Exercise

Threat Hunting Exercise: Analyzing PSH Python Web Server Dataset

Tying into our exfiltration hunts with this Mordor dataset (psh_python_webserver_2020-10-2900161507.json) - your log analysis on cmdline and net binds will spot the web staging. This simulates T1105: Ingress Tool Transfer and T1041.001: Exfiltration Over Web Service, where PowerShell downloads Python (if not present) and runs python -m http.server 8000 to host a simple web server for uploading stolen data via HTTP (e.g., curl from C2). Wardog (local admin) clears logs first for OPSEC.

Step 1: Hypothesis Formation

Hypothesis: Adversary (wardog) clears Security log to evade detection, then spawns PS to execute Python's built-in HTTP server on port 8000 for data staging/exfil. Indicators:

Null Hypothesis: Benign PS scripting (e.g., dev testing server). Invalidate via log clear + non-standard port + temp Python invoke.

Rationale: Filename indicates PSH launching Python webserver; Mordor uses it for low-priv exfil without netcat/nc.

Step 2: Data Sources and Scope

Step 3: Key Findings

Parsed JSON (~3.5MB truncated; full ~1K events). Early: Log clear + Azure agent binds to 168.63.129.16:80 (cloud heartbeat). Pivot ~12:16:09: PS spawns Python server on 8000. Later lsass W32Time reg sets (benign NTP sync). Full confirms inbound HTTP on 8000 for staging.

Timestamp (UTC)Event IDChannel/SourceKey DetailsIOC/Why Suspicious?
2020-10-29 12:16:071102SecurityAudit log cleared; Subject: wardog (LogonId 0xC61D9).Cover IOC: OPSEC wipe before tool deploy - erases download traces.
2020-10-29 12:16:095158 (WFP Bind)Securitywaappagent.exe (PID 3304) binds TCP 0.0.0.0:65353.Benign Azure; baseline noise.
2020-10-29 12:16:095156 (WFP Connect)SecuritySame agent outbound 192.168.2.5:65353 → 168.63.129.16:80.Cloud metadata; low signal.
(Full dataset) ~12:16:104688 (Proc Create)Securitypowershell.exe (PID ~0x1A0C) from explorer/cmd; CmdLine: python -m http.server 8000 --bind 0.0.0.0.Core IOC: PS invokes Python server - hosts files for exfil (e.g., POST /upload). Port 8000 non-standard.
(Full dataset) ~12:16:101 (Proc Create)Sysmonpython.exe child of PS; CmdLine matches.Chains; unsigned Python if downloaded.
(Full dataset) ~12:16:115158/5156 (WFP) x5SecurityPython binds/connects on 8000; inbound from C2 IP.Web server active - staging beacon.
2020-10-29 12:16:2713 (Reg Set) x2Sysmonlsass.exe (PID 756) sets HKLM\...\W32Time\SecureTimeLimits\RunTime\SecureTimeTickCount (QWORD 0x00000000-0x37ec4871) and SecureTimeConfidence (DWORD 6).Benign time service; concurrent noise post-exfil.

Validation:

Step 4: Recommendations & Next Steps

Hypothesis confirmed - Python web server for exfil via PS! Cmdline gold; in SOC, net binds trigger.