1. The Incident Briefing & Monitoring Alert
You are on the day shift in the Security Operations Center when the monitoring dashboard flashes red. A high-priority alert appears in the Web Application Firewall (WAF) console reporting anomalous HTTP POST traffic on crm.trypatchme.thm, followed by an unauthorized file write anomaly in the public upload directory.
To triage this intrusion responsibly, we established a dual-source correlation methodology:
- Web Server Access Logs: Parsing perimeter HTTP requests, identifying the attacker's source IP, measuring credential stuffing volumes, and isolating uploaded files.
- Endpoint Detection & Response (EDR) Console: Tracking process execution lineage, identifying anomalous parent-child forks, and triggering host containment actions.
2. Perimeter Log Analysis: Unmasking the Threat Actor
We began the forensic investigation by filtering the raw Apache access log (access-combined-crm.log) for authentication requests targeting /CRM/login.php.
🚨 Triaged Evidence — Ingress & Login Counts
Attacker Source IP: 34.67.91.83
Failed Authentication Attempts (HTTP 401): 35 requests
Compromised / Successful Logins (HTTP 200): 18 requests
3. Malicious Upload & Tooling Fingerprint
Once valid session cookies were obtained via the brute-force attack, the threat actor targeted the CRM portal's file upload interface. Searching for multipart upload requests revealed the script name and automated tooling client:
invoice.php) & Python User-Agent
Field Notes Page 04
The uploaded file was named invoice.php, masquerading as a routine billing document. The attacker first invoked the web shell script at 2025-11-06 14:27:34 UTC.
4. Payload Deobfuscation & MITRE ATT&CK Mapping
The threat actor initiated remote command execution (RCE) by issuing HTTP POST requests to /CRM/portal/uploads/invoice.php?q=ZDJodllXMXA&auth=31337. Deobfuscating the Base64 parameter revealed the initial reconnaissance command:
Server Software Component: Web Shell
Adversaries backdoor web servers by uploading executable scripts (e.g. invoice.php) to maintain persistent access.
Unix Shell Command Execution
Commands executed via /usr/sbin/php-fpm7.4 under low-privilege service account www-data.
5. Reverse Shell & Credential Discovery
Following initial reconnaissance, the threat actor staged an interactive reverse shell using a double-encoded Bash payload:
115.58.148.86:8080
Field Notes Page 06
Through EDR telemetry, we observed the attacker targeting core configuration files to extract database credentials:
- Sensitive File Read:
/etc/trycrm/config.json - Production Database Harvested:
trycrm_production
6. EDR Alert Correlation & Threat Containment
Correlating the endpoint detections in our EDR console enabled structured containment across 4 alert tiers:
- Detection 1 (Suspicious File Write): Quarantined
/var/www/html/CRM/portal/uploads/invoice.php(Backdoor:PHP/Generic). - Detection 2 (Parent-Child Anomaly): Killed unauthorized
php-fpm -> bashprocess tree. - Detection 3 (Unusual User Behavior): Revoked compromised CRM active session tokens.
- Detection 4 (Hands-On-Keyboard Root Activity): Blacklisted egress IP
115.58.148.86at the perimeter firewall.
7. Key Engineering Takeaways for Enterprise Systems
- Execution Gating on Upload Directories: Configure Nginx/Apache to forbid script execution in all writable directories (
location ^~ /uploads/ { deny all; }). - WAF Deep Packet Inspection: Enforce WAF inspection rules that block Base64-encoded strings containing Unix binary invocations (`whoami`, `bash`, `nc`).
- Restricted Shell Spawning: Lock down web server runtime users (
www-data,nginx) by assigning/sbin/nologinshell and disablingproc_open/execinphp.ini. - Immediate Credential Rotation: Whenever configuration files such as
config.jsonor.envare accessed during an intrusion, all associated database credentials and API secrets must be rotated immediately.