Pyexp:1 - Walkthrough - [Vulnhub]

Here's my solution for Pyexp:1.
The machine can be downloaded from here.

Nmap
Scanning for all TCP Ports.
$ nmap -sC -sV -p- 192.168.1.102


We find 2 ports open.

Enumeration
We brute-force mysql using hydra, with default user as- root.
$ hydra -l root -P /usr/share/wordlists/rockyou.txt 192.168.1.102 mysql

We get the password, now we can easily access mysql.

Checking for databases.


We check the tables of the database named- data.

Lets get the data.

After doing some searches we find that fernet is a kind of encryption. So we browsed asecuritysite to decrypt it.

We get the credentials.

Getting Access
Accessing SSH, with the credentials which we found after decrypting.
$ ssh lucy@192.168.1.102
Password: wJ9`”Lemdv9[FEw-


User Flag


Privilege Escaltion
We check for SUDO rights.


Lets run the python file as user- root.

Error, we look at the code and find that it uses exec function.


Now, again we run the file and enter the payload to get the reverse shell.
And on the other hand we start the netcat listener.

We get the reverse shell, now lets get the root flag.



Comments

Popular posts from this blog

Sunset:Noontide - Walkthrough [Vulnhub]

CyberSploit:2 - Walkthrough [Vulnhub]

BBS(cute):1.0.1 - Walkthrough [Vulnhub]