Post

DC 8

Description ⤵️

💡 DC-8 is another purposely built vulnerable lab with the intent of gaining experience in the world of penetration testing.
This challenge is a bit of a hybrid between being an actual challenge, and being a “proof of concept” as to whether two-factor authentication installed and configured on Linux can prevent the Linux server from being exploited.
The “proof of concept” portion of this challenge eventuated as a result of a question being asked about two-factor authentication and Linux on Twitter, and also due to a suggestion by @theart42.
The ultimate goal of this challenge is to bypass two-factor authentication, get root and to read the one and only flag.
You probably would not even know that two-factor authentication was installed and configured unless you attempt to login via SSH, but it is definitely there and doing it is job.
Linux skills and familiarity with the Linux command line are a must, as is some experience with basic penetration testing tools.
For beginners, Google can be of great assistance, but you can always tweet me at @DCAU7 for assistance to get you going again. But take note: I would not give you the answer, instead, I’ll give you an idea about how to move forward.

Let’s find the IP Address first »

162-1.png

1
IP : 10.0.2.14

Port Scan Results ➡️

162-2.png

1
2
3
OPEN PORTS >
22   SSH
80   HTTP

Web Enumeration ⤵️

162-3.png

Again Drupal →

Lets look into the directory traversal files →

162-4.png

so it contains pgsql so lets try sqli →

162-5.png

as I got to know that there is a database name d7db so lets see what it got →

162-6.png

with sqlmap I got these much tables on d7db database →

162-7.png

Lets check the users.csv files →

1
2
3
admin,$S$D2tRcYRyqVFNSc0NvYUrYeQbLQg5koMKtihYTIDC9QQqJi3ICg5z

john,$S$DqupvJbxVmqjr6cYePnx2A891ln7lsuku/3if/oRVZJaz5mKC2vF

Lets use john the ripper to crack this →

so the password.hash contains the hash of john →

162-8.png

1
turtle

162-9.png

Now Lets perform these steps to achive reverse shell →

Contact Us > WEBFORM > Form Settings → upload php reverse shell code → Save Configurations.

ADD something before the PHP code like any string .

162-10.png

162-11.png


SHELL ➡️

Now after getting the shell lets try SUIDS and GUIDS files →

162-12.png

Now lets exploit exim4

162-13.png

162-14.png

this exim code got 2 commands 1 for setuid and the 2nd one for netcat and that I used it →

162-15.png

162-16.png

162-17.png


If you have any questions or suggestions, please leave a comment below. Thank You !

This post is licensed under CC BY 4.0 by the author.