Sunset:Midnight - Walkthrough [Vulnhub]
Here's my solution for Sunset:Midnight.
The machine can be downloaded from here.
Nmap
Scanning for all TCP ports.
nmap -sC -sV -p- 192.168.1.107

We find 3 open ports.
Enumeration
Lets map the IP to host name- sunset-midnight, in the /etc/hosts file.
Lets map the IP to host name- sunset-midnight, in the /etc/hosts file.

Browsing the web and checking the source, did not give us any hint, but we find that it is built on CMS- Wordpress.

Brute forcing Mysql on port 3306.

We get the password as- robert
Accessing Mysql.


On our machine, we create a password as- admin

On target machine, we change the password for user- admin.

Now we have the credentials as-
User: admin
Password: admin
User: admin
Password: admin
We browse the /wp-login.php page and login as- admin.

Navigate to Appearance > Theme Editor, and select the theme as- Twenty Nineteen.

We select 404 Template, to place our php reverse shell payload.

Getting Access
To run the exploit we browse http://sunset-midnight/wp-content/themes/twentynineteen/404.php
And on the other hand we start the netcat listener.


We have a reverse shell.
Privilege Escalation.
We find the password for user- jose.
We find the password for user- jose.


Lets switch to user- jose and get the User Flag.
su jose
password: 645dc5a8871d2a4269d4cbe23f6ae103
su jose
password: 645dc5a8871d2a4269d4cbe23f6ae103

From Jose > Root
We check for SUID permissions.
Root Flag.

Comments
Post a Comment