Slingway Inc., a leading toy company, has recently noticed suspicious activity on its e-commerce web server and potential modifications to its database. To investigate the suspicious activity, they’ve hired you as a SOC Analyst to look into the web server logs and uncover any instances of malicious activity.
To aid in your investigation, you’ve received an Elastic Stack instance containing logs from the suspected attack. Below, you’ll find credentials to access the Kibana dashboard. Slingway’s IT staff mentioned that the suspicious activity started on July 26, 2023.
By investigating and answering the questions below, we can create a timeline of events to lead the incident response activity. This will also allow us to present concise and confident findings that answer questions such as:
Web Shell Exploitation and Database Breach via Directory Enumeration
Web Server Compromise, Credential Access, Data Exfiltration
Elastic Stack (Kibana) – HTTP logs
The attacker exploited exposed paths, brute-forced admin credentials, uploaded a web shell, and extracted sensitive database contents including credit card records.
Nmap and Gobuster used to enumerate and find exposed admin-login.php
Brute-force with Hydra, successful login using stolen credentials
PHP web shell uploaded via admin panel
Not explicitly present; attacker already had web admin access
Standard headers and user-agents used to appear normal
LFI and phpMyAdmin exploration via path traversal
Admin credentials brute-forced and DB creds extracted via LFI
Downloaded customer credit card database
Database tampering and flag insertion (cardholder name overwrite)
T1190
Exploit Public-Facing Application
Brute-forced login via admin-login.php
T1087.002
File and Directory Discovery (Web)
Directory enumeration with Gobuster
T1059.003
Web Shell
Executed commands via uploaded PHP shell
T1003.003
Credential Dumping via LFI
Extracted DB credentials from phpMyAdmin config file
T1119
Automated Collection
Exported customer_credit_cards database
T1041
Exfiltration Over Web Service
Downloaded DB dump over HTTP
T1491.001
Defacement: Database Content Injection
Overwrote credit card names with injected flag
Reference: [MITRE ATT&CK Navigator] ( https://attack.mitre.org/ )
To kick off, I set the timeline to July 26, 2023 as mentioned in the brief.
Next, I inspected the transaction.remote_address field to identify suspicious request volume.
Out of 3028 total requests, 2565 came from the same internal IP — clearly the main source of activity.
10.0.2.15
After filtering for the attacker’s IP and sorting the logs by @timestamp from oldest to newest, I checked the early entries.
Right after the first few requests, the logs show the Nmap Scripting Engine as the User-Agent — a common signature for reconnaissance.
Nmap Scripting Engine
I looked through the logs for suspicious User-Agent values, especially during high volumes of 404 responses — typical of directory brute forcing.
The User-Agent string clearly identifies Gobuster, a well-known directory enumeration tool.
Mozilla/5.0 (Gobuster)
Since failed resource lookups return status code 404, I filtered by response.status:404 and counted the results.
The total came out to 1867 — consistent with aggressive directory scanning.
1867
I filtered for successful hits (response.status: 200) made with the Gobuster User-Agent.
Among the discovered directories, one revealed a flag stored as a plain string.
a76637b62ea99acda12f5859313f539a
We don’t have any login page in the response status 200
To find login-related pages, I searched for URLs containing the word “login”, while excluding 404 responses to focus only on valid hits.
The result: admin-login.php — discovered during enumeration.
admin-login.php
We already noticed before that under Gobuster there was Hydra, clearly used to brute force it, but lets look for it.
A spike in “401” Unauthorized responses hinted at a brute-force attempt. Filtering for response.status: 401 and checking request.headers.User-Agent confirmed it:
The tool used was Hydra, a classic for login brute-forcing.
Mozilla/4.0 (Hydra)
To isolate the successful login, I filtered for response.status: 200 along with User-Agent: Hydra, since failed attempts earlier returned 401.
Among those few successful hits, I inspected the request.headers.Authorization field.
The base64-encoded value decodes cleanly to the valid credential pair:
admin:thx1138
I filtered for requests under /admin/* with http.request.method: POST, since file uploads are typically POST requests.
Out of all admin subdirectory actions, only one stood out — a POST to upload.php. Inspecting the request body revealed the flag.
THM{ecb012e53a58818cbd17a924769ec447}
From Q9, we know the uploaded web shell was named easy-simple-php-webshell.php.
I filtered for requests to that file and sorted by @timestamp (oldest first) to reconstruct the sequence.
The first command sent through the shell was a classic — to confirm access:
whom
While reviewing /admin/* paths, I noticed suspicious path traversal attempts using ../../ — typical of Local File Inclusion (LFI).
One of these LFI requests successfully accessed a sensitive config file related to phpMyAdmin.
etc/phpmyadmin/config-db.php
From the LFI activity in the previous step, we already know the attacker targeted phpMyAdmin. The path used appears repeatedly in logs related to database interaction.
/phpmyadmin
I filtered for requests under /phpmyadmin/* and looked for signs of export activity.
Scrolling through the logs revealed a clear export request pointing to a specific database.
customer_credit_cards
After spotting the export request, I filtered by http.method: POST to catch follow-up write actions. Two relevant requests stood out:
– import.php
– tbl_replace.php
Looking into the body of import.php, I found a nearly readable payload that appeared to insert a value into the cardholder_name field across multiple entries.
I decoded the content manually (or with CyberChef) and confirmed that the attacker inserted a single string repeatedly — likely as a planted flag.
c6aa3215a7d519eeb40a660f3b76e64c
The attacker performed a full web exploitation chain — starting with recon and directory brute-force, followed by admin panel access via Hydra, web shell upload, and database manipulation.
They exfiltrated sensitive data and inserted a flag into the database, highlighting the critical impact of weak authentication and misconfigured web services.
Apparently we have to tell you this: yes, cookies are used. They're not edible, and no, you can't escape them — but you can pick what gets tracked. Yay for EU law!