1. Host Discovery
By starting the virtual machine, the hostâs IP address was obtained directly using the Nmap command.
/>
2. Port Discovery (Services, Components, Versions)
The command sudo -u root nmap 10.58.81.115 -n -Pn -p- --reason -sV -sC -O
was used to obtain the hostâs open ports, the services provided, the components used, and the versions of the components.
/>
Open Ports |
Services Provided |
Components Used |
Component Versions |
---|---|---|---|
22/tcp |
ssh |
OpenSSH |
7.9p1 Debian 10+deb10u2 |
80/tcp |
http |
Apache |
httpd 2.4.38 |
â |
os |
Debian Linux |
4.15 â 5.6 |
3. Vulnerability Discovery (Gaining Permissions)
Port 22/SSH Service
Component Vulnerabilities
Using the command searchsploit OpenSSH 7.
, no Nday vulnerabilities were found for the OpenSSH 7.9p1 Debian 10+deb10u2 component.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-0afae8db096ef151bf284223daa1762b.png)
Password Vulnerabilities
Using the command hydra -C /usr/share/seclists/Passwords/Default-Credentials/ssh-betterdefaultpasslist.txt 10.58.81.115 ssh
, no weak password vulnerabilities were found.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-3706348f671a088ec41309e3710778bb.png)
Port 80/HTTP Service
Component Vulnerabilities
01. Using the commands searchsploit Apache 2.4
and searchsploit Apache 2.4.38
, no Nday vulnerabilities were found for the Apache httpd 2.4.48 component.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-9fbc9a7fdcfcbc48aa88445c981ec214.png)
02. Using Wappalyzer, WahtRuns, BuiltWith, WhatWeb, and FindSomething to automatically identify website components yielded no results.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-cb14c653196d79b750a3cf05dfd358cb.png)
03. Manually identifying website components using BurpSuite yielded no results.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-030c229072488b97edee59e7998895ef.png)
URL Vulnerabilities (Directories, Files)
01. Manual Browsing
Accessing the homepage http://10.58.81.115/
revealed nothing; itâs a static page, typical CTF style.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-3d4753a4be490e0ce01297a3c9b8bee8.png)
02. Directory Scanning
02-01. Using the command dirb http://10.58.81.115 -R
to enumerate website directories and files revealed valuable directories and files such as the /joomla/
directory, /joomla/robots.txt
file, /joomla/index.php
file, and /joomla/administrator/index.php
file, indicating the use of Joomla CMS.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-7eee2c7c7fb188d822239e3e61b5db89.png)
02-02. I wanted to confirm the Joomla version first and then look for Nday vulnerabilities. However, after searching the website for a long time and examining it with Burp Suite, I couldnât find the Joomla version.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-c05b4d970355bc9cfd9398e1bbbb6ca6.png)
The official website explains how to check the Joomla version [2], but I still couldnât find it. Afterward, I discovered that the Joomla version here was high, and the official websiteâs instructions were to check after logging into the backend.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-ff70004918ab15f2d7dbee313db5e6ff.png)
At that time, I was stuck, so I used the powerful msfconsole and discovered that the version was 3.7.3-rc1
. Itâs unbelievable that the official website clearly stated that this version requires logging into the backend to check.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-d436ec92ce1ffb5824ba35b00b4464de.png)
So, I used Wireshark to capture the msfconsole packets and found that the /joomla/administrator/manifests/files/joomla.xml
file mentioned the Joomla version. Whether the Joomla official website didnât want to say it or they genuinely didnât know, that remains unknown.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-05056062fff91c236f90d0c8786ab4ee.png)
Since I knew the version, I could look for Nday vulnerabilities. Using the command searchsploit Joomla 3.7
, I only found three SQLi vulnerabilities of uncertain exploitability. After attempting to exploit them as described, I found that none were exploitable, wasting half a day.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-2e11c8fd78d5d50715e1ae7c7460b2a2.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-db3f31d290e22cd9fa36bdc1338004bd.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-d53fd57c113b3f757f57a97d50ba8d77.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-2ead048554742c1eb0b345c4eb20e6ad.png)
02-03. The directories in the /joomla/robots.txt
file were mostly found by dirb, seeming to be common directories for Joomla CMS. I verified this by checking the Joomla code on GitHub. I found that the robots.txt file included additional /bin/
and /logs/
directories, but the content was empty or nonexistent.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-c75efb18409ef2203c8fb76799d3d121.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-f77ce579f7018c5bf25706e4b59f0743.png)
02-04. The /joomla/index.php
and /joomla/administrator/index.php
files offered several potential vulnerabilities, primarily SQLi and brute-forcing. The main goal was to gain web access and then try to obtain webshell access.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-46c215fe6c8e140b628ac50d4a677539.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-bf7a4328f5e9d6330c8c057cdd9bf00d.png)
However, I didnât try SQLi further because Joomla CMS is an open-source component, and Iâd already tried all the discoverable SQLi Nday vulnerabilities. So I tried brute-forcing. I found three login interfaces and chose a simple one to brute-force.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-c4da0f70ee4f04193061ae375975c5c3.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-890d25dd124d39cb585bad111cb52229.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-37f4af9fc05aa18d06caffd210d5b668.png)
I focused on brute-forcing several guessed usernames: admin, joomla, joker, but without success.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-6ffe2f0841b09b8c22b75ab416702ed5.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-ed7d5e470a027b18d52fd617235c2f72.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-1dd39c78edd0a564e30b9882f1cc3e80.png)
I even brute-forced these usernames again for SSH, also without success.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-26cfc3651b149588575244ccb510656e.png)
At this point, I was out of options and could only brute-force more usernames and passwords. Besides using a larger dictionary, I could also gather information from the website pages to create a targeted custom password dictionary.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-20d96bd9e276afa485124bd7f1ede8a5.png)
However, brute-forcing SSH still yielded no results.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-ac5fd3959ce5de439750ad74458c3350.png)
But I finally brute-forced the Joomla backend account âjoomlaâ with password âGothamâ.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-9f214734c846f706892da1026f7f190e.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-7bd567a0d4ffdef0775cb0947a53ca19.png)
02-05-01. After gaining web access, the next step was to gain webshell access. For CMS systems, file upload vulnerabilities are a top choice. On the backend homepage, I could try the Media image upload and Templates template upload.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-bc39f702eecce92d06654fa867bb9652.png)
Media image uploads failed, even with a normal image containing webshell code.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-c09aa10dacf533c08f647c79de211d98.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-139fa18c30bd8c2cd169e4ba52438bb7.png)
I randomly clicked on Options and found upload-related settings that could be modified. I changed everything I could, but uploads still failed. However, normal files could be uploaded successfully, which was baffling.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-7d5cf15bbfa06fd623a07fbe4675658f.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-9e792a9c2aebb81532d55714f9405580.png)
02-05-02. So I tried the Templates template upload; there were two templates, Beez3 and Protostar; I chose one randomly.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-29677b4058ac2af0399121f3e49d04db.png)
The Document link leads to How to use the Template Manager [3], showing the usage of the template manager and the access path /templates/protostar/
for the template files (webshell files).
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-4dbf3bcab0f3d63711fedaaeb9bff57a.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-e4f135e40e5adc446a9e41457fbfe914.png)
I created a webshell file and accessed it to gain webshell access.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-8f0ed6cb16a776269dbda1f0a19d02fd.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-f5173a5960933467a3619404fc562918.png)
I found the Linux PHP reverse shell code on the HackTricks [4] website. After executing it via the webshell, I gained stable webshell access. It even directly escalated privileges to the root account?
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-212b6607a73a521f1ef42bfa2a3446d5.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-1610eec8a54cab5a0f4d0f7861b4a74e.png)
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-0a53e4f9a4a6e64360494d6bd1edd948.png)
03. Fuzzing
Based on the current information, fuzzing the websiteâs directories and files wasnât necessary.
04. Information Gathering
All website traffic was proxied through Burp Suite while browsing with Firefox; no sensitive information leaks were found in Burp Suite.
![](https://www.ids-sax2.com/wp-content/uploads/picture/developer-qcloudimg-com-9eb32241a2e431019369825334afae69.png)
References
[1]
GlasgowSmile-v1.1: https://www.vulnhub.com/entry/glasgow-smile-11,491/
[2]
How to check the Joomla version: https://docs.joomla.org/How_to_check_the_Joomla_version%3F
[3]
How to use the Template Manager: https://docs.joomla.org/Special:MyLanguage/J3.x:How_to_use_the_Template_Manager
[4]
HackTricks: https://book.hacktricks.xyz/