Jump to content
Aerosol

Troll Challenge

Recommended Posts

Posted

092914_1523_TrollChalle1.png

Just found an interesting vulnerable machine named Troll. It sounds like the machine will troll the attacker. We booted up the machine in Virtual Box and fired an Nmap scan on it.

The scan result: was of three ports FTP, SSH, and HTTP. We did a script-based Nmap scan by using -A argument, so we had some more details of those open ports. As can be seen below, in port no. 21, FTP is allowed to login as Anonymous user and it also contains a lol.pcap file in it, and port no. 80 HTTP service has a secret directory.

092914_1523_TrollChalle2.png

So we started from the HTTP service. We opened up the target address in the browser and what did we see? A troll image.

092914_1523_TrollChalle3.jpg

Ok… cool! So let’s open the secret folder, maybe we found something interesting in this directory. What? Another troll.

092914_1523_TrollChalle4.jpg

So there is nothing juicy in the application, so we moved in to the FTP service as we knew Anonymous login is allowed and there is a lol.pcap file available, so let’s grab that file.

092914_1523_TrollChalle5.jpg

We used ls command for checking if there are any files or not, and found the lol.pcap file.

092914_1523_TrollChalle6.jpg

Used Get command to download the file.

092914_1523_TrollChalle7.jpg

Then we opened the capture packet file from Wireshark and started to check all TCP connections by following TCP streams, and we found that a file named secret_stuff.txt has been transferred.

092914_1523_TrollChalle8.jpg

File transfer has been done, meaning it was on FTP protocol, so we applied a filter by using ftp-data for filtering all connections. As can be seen below, we found only three connections.

092914_1523_TrollChalle9.jpg

In one of the connections, we found a message that “you almost found the sup3rs3cretdirlol”. A directory is what the message denotes.

092914_1523_TrollChalle10.jpg

We opened the directory and we found another file over there called roflmao.

092914_1523_TrollChalle11.jpg

Just downloaded the roflmao file, let’s see if there is any troll in this file. Executed the bin file and there was “Find address 0x0856BF”. Now where to find it?

092914_1523_TrollChalle12.jpg

We opened the address in the browser and that was a directory with two directories: good_luck and this_folder_contains_the _password.

092914_1523_TrollChalle13.jpg

We opened the good_luck folder and found a which_one_lol.txt file. The file contains usernames, probably for the SSH.

092914_1523_TrollChalle14.jpg

Then we again checked the second directory and that was the obvious one, pass.txt.

092914_1523_TrollChalle15.jpg

We opened the password file and found the password Good_job_:)

092914_1523_TrollChalle16.jpg

Now what to do? We have usernames and a password, it is quite easy to brute force. We fired up the Hydra brute forcer. As can be seen below, we put that username list in user.txt file and put the password as Good_job_:)

092914_1523_TrollChalle17.jpg

We started the attack and we weren’t able to log in with this password. We tried to figure out what is wrong with the credentials. After some time, we noticed that the folder that contains the Pass.txt name was the folder that contains the password, so what if we use the password as Pass.txt. Again we configured the Hydra, this time the password is Pass.txt.

092914_1523_TrollChalle18.jpg

We started the attack and Boom! Logged in. Found the username was overflow and password was Pass.txt.

092914_1523_TrollChalle19.jpg

Successfully logged in via SSH.

092914_1523_TrollChalle20.jpg

Our next step was to find all worldwritables files in the system, so we used find / -perm -2 -type f 2>/dev/null

092914_1523_TrollChalle21.jpg

Found lots of files, but one file was unexpected: a Python file with writeable permissions. The file was located at /lib/log/cleaner.py.

092914_1523_TrollChalle22.jpg

Opened the cleaner.py file:

092914_1523_TrollChalle23.jpg

Now we just changed the function and added our own functions by adding these two lines: os.system(‘cp /bin/sh /tmp/sh’) os.system(‘chmod 4777 /tmp/sh’)

In the first function, we copied bin/sh to tmp/sh and in the second function, we provided the executable permissions.

092914_1523_TrollChalle24.jpg

After saving the Python file, we exited the SSH session and re-logged in to the system and changed the directory to /tmp/sh and executed the whoami command for identifying the user, and it was root.

092914_1523_TrollChalle25.jpg

Now we are in the root directory, we opened the proof.txt and it’s done.

092914_1523_TrollChalle26.jpg

Trolling over!

References: http://vulnhub.com/entry/tr0ll-1,100/

Source

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...