Vulnhub Stapler – Walkthrough

In this write-up, will be showing the steps to take root access on Stapler machine created by g0tmi1k. All the VM related details can be checked
on here.

  1. First I tried checking the IP address using netdiscover. The victim appears to be sitting at 10.0.2.9.
    The attacker machine is at 10.0.2.11

  1. Next nmap helped us in checking the open ports and the respective services running.

  1. The very first port 21 seems to be hosting a ftp server. I tried checking anonymous login and could get through without a password. The welcome banner revealed a random user’s name harry.

  1. On checking the current directory, I found a file ‘note’ which contained 2 names Elly and John.

  1. Further quickly created a user file with the collected names and employed hydra to brute-force the ftp service for guessing correct credentials. Got lucky and found a valid user/password combination.

  1. Then tried my luck with brute-forcing the ssh service using the same users.txt file but didn’t succeed.
    However when trying sshing to the remote server, another username was revealed from the login banner.

  1. Directly moved onto the last port 12380 and found ssl enabled web server running. Tried to query the robots.txt file and found 2 urls. Out of the 2, only /blogblog had something juicy.


  1. Took the help of nikto and started scanning the web server for any potential vulnerabilities. Apart from the robots.txt and the 2 urls we discovered manually, nikto revealed /phymyadmin/ directory as well.

  1. While manually browsing through the website, I got redirected to a wordpress login which forced me to use wpscan tool on this url. It revealed a bunch of valid usernames and mostly client side vulnerabilities which won’t help much.
    wpscan also revealed few urls wp-includes/, wp-content/uploads/ that had directory listing enabled.

  1. Again traversed through the directories for information and after a few minutes, found a /wp-content/plugins directory that listed available plugins being used by the application.

11. Advanced Video plugin seems interesting to me and quickly searched if it had something to offer. And yes it does.

  1. After a thorough reading I found that this python exploit can be used for arbitrary file download. The url
    http://127.0.0.1/wordpress/wp-admin/admin-ajax.php?action=ave_publishPost&title=random&short=1&term=1&thumb=%5BFILEPATH%5D was the culprit.

  2. Lets try to read our favourite /etc/passwd file using the above vulnerable url. Once the request is made, the desired file gets saved under the wp-content/uploads/ directory. And of course directory listing is enabled on the same url.

  1. Lets try reading the file using curl and quickly create a users list using cut.

  1. I can’t wait to use this list for brute-forcing the ssh service. Lets take help of hydra. Wait, we got a valid credential combination. Thanks to hydra once again.

  1. Manually trying to login with SHayslett user.

  1. Lets check the Linux kernel and exact operating system. Its a 4.4.0-21-generic linux kernel and Ubuntu 16.04 is being used. Lets go ahead and try becoming root.

  1. After a quick google search, found an exploit here. Followed the steps, compiled the program and on execution the privilege escalation failed.

  1. Again searched for exploits and finally found something useful here.
  2. To make things easier, transferred the files on the victim machine and went ahead with the compilation process. On final exection, became the Root. Voot !!!

  1. Final task is to read the flag. Lets do it.

That’s all folks. Cya.

References

  1. https://www.exploit-db.com/exploits/39772/
  2. https://www.vulnhub.com/entry/stapler-1,150/
  3. https://www.exploit-db.com/exploits/39646/
Subscribe to our Newsletter
Subscription Form
DOWNLOAD THE DATASHEET

Fill in your details and get your copy of the datasheet in few seconds

DOWNLOAD THE EBOOK

Fill in your details and get your copy of the ebook in few seconds

Ebook Download
DOWNLOAD A SAMPLE REPORT

Fill in your details and get your copy of sample report in few seconds

Download ICS Sample Report
DOWNLOAD A SAMPLE REPORT

Fill in your details and get your copy of sample report in few seconds

Download Cloud Sample Report
DOWNLOAD A SAMPLE REPORT

Fill in your details and get your copy of sample report in few seconds

Download IoT Sample Report
DOWNLOAD A SAMPLE REPORT

Fill in your details and get your copy of sample report in few seconds

Download Code Review Sample Report
DOWNLOAD A SAMPLE REPORT

Fill in your details and get your copy of sample report in few seconds

Download Red Team Assessment Sample Report
DOWNLOAD A SAMPLE REPORT

Fill in your details and get your copy of sample report in few seconds

Download AI/ML Sample Report
DOWNLOAD A SAMPLE REPORT

Fill in your details and get your copy of sample report in few seconds

Download DevSecOps Sample Report
DOWNLOAD A SAMPLE REPORT

Fill in your details and get your copy of sample report in few seconds

Download Product Security Assessment Sample Report
DOWNLOAD A SAMPLE REPORT

Fill in your details and get your copy of sample report in few seconds

Download AI/ML Sample Report
DOWNLOAD A SAMPLE REPORT

Fill in your details and get your copy of sample report in few seconds

Download IoT Sample Report

Let’s make cyberspace secure together!

Requirements

Connect Now Form

What our clients are saying!

Trusted by