Enumeration
Run Nmap Scan
View Website


Directory Bruteforcing (Run Gobuster)
Goto Robots.txt

Enumerating Samba
Fetch all the files inside general
Enumerating FTP
DNS Enumeration
Trying DNS Zone Transfer
Include the DNS information into our hosts file
Visit friendzone.red

Visit Uploads.friendzone.red



Exploitation


https://administrator1.friendzone.red/dashboard.php

image_id and pagename. Let’s try with the default params.

pagename.
Assuming the timestamp is a php file, if we try with dashboard.php without the php file extension.

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/reverseGenerating a TTY Shell
For some reason, I couldn’t get a tty shell using thepython -c 'import pty;pty.spawn("/bin/bash")' command. So I made a new reverse shell listener and sent a reverse shell through python.

Privilege Escalation
Finding interesting file using LinPeas

Monitor Processes
Download PSPY
https://github.com/DominicBreuker/pspy/releases/download/v1.2.1/pspy64reporter.py is running every few minute interval in root permission.
Analyzing Reporter.py
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
os.py

Listen to Reverse Shell and Exploit
reporter.py gets executed.