Skip to main content

Enumeration

Run Nmap Scan

View Website

Untitled Untitled The default url is different from http website. Here we can assume that the use of http and https are different.

Directory Bruteforcing (Run Gobuster)

The result of http and https are different!

Goto Robots.txt

Untitled

Enumerating Samba

Fetch all the files inside general

After fetching “general” folder, we found the creds information. While, there was nothing inside “Development” folder

Enumerating FTP

Both “anonymous” and “admin” login failed.

DNS Enumeration

Trying DNS Zone Transfer

Include the DNS information into our hosts file

Visit friendzone.red

Untitled

Visit Uploads.friendzone.red

Untitled Untitled Untitled I uploaded README.txt, but I couldn’t find the file. Guess it’s just a fake website.

Exploitation

Untitled Let’s use the credential we got from the smb enumeration.
Untitled Manually redirect the url to https://administrator1.friendzone.red/dashboard.php Untitled Here it requires a param of image_id and pagename. Let’s try with the default params. Untitled Bottom the website, we can see the timestamp which we gave inside the pagename. Assuming the timestamp is a php file, if we try with dashboard.php without the php file extension. Untitled The website is now recursive. We can conclude that the website has a LFI vulnerability.

Generating a PHP Reverse Shell

Uploading our reverse shell to the victim system using samba.

Listen to Reverse Shell and Exploit

Try the URL to execute the reverse shell file. https://administrator1.friendzone.red/dashboard.php?image_id=a.jpg&pagename=/etc/Development/reverse

Generating a TTY Shell

For some reason, I couldn’t get a tty shell using the python -c 'import pty;pty.spawn("/bin/bash")' command. So I made a new reverse shell listener and sent a reverse shell through python.
Untitled

Privilege Escalation

Finding interesting file using LinPeas

Untitled

Monitor Processes

Download PSPY

https://github.com/DominicBreuker/pspy/releases/download/v1.2.1/pspy64
After waiting for few minute, we found that reporter.py is running every few minute interval in root permission.

Analyzing Reporter.py

Here reporter.py is importing an os library which we have a writing permission to.

Creating a os.py that sends a reverse shell to the attacker

Insert the code below to the end of the os.py
Untitled

Listen to Reverse Shell and Exploit

Wait until the reporter.py gets executed.