OnSystem: ShellDredd #1 Hannah - Walkthrough [Vulnhub]

Here's my solution for OnSystem: ShellDredd #1 Hannah.
The machine can be downloaded from here.

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


We find 2 ports open.

Enumeration
From the nmap's output we see that the ftp, allows anonymous login.
$ ftp 192.168.1.109
Name: anonymous
Password: anonymous


We find a hidden directory- .hannah, which contains a file- id_rsa.
Lets get this file- id_rsa.


Viewing the contents of file- id_rsa, seems to be a private key.
$ cat id_rsa



We know, we found a hidden directory named as- hannah, which sounds like a name of a person. Since we have the private key, We can try the name- hannah as the username.

Getting Access
We change the permission of the file- id_rsa.
$ chmod 600 id_rsa
$ ssh -i id_rsa hannah@192.168.1.109 -p 61000

User Flag.


Privilege Escalation
Checking for SUID permissions.

Lets read the contents of file- /etc/shadow.


Tried cracking the hashes, but no result.

We edit the password for user- root, in the file- /etc/shadow.

From our machine we create a password as- pass
$ mkpasswd -m SHA-256 pass

On target machine, we edit the file- /etc/shadow.



Lets view the changes.

Switching to root.
$ su root
Password: pass


Root Flag.

 

We can also edit the file- /etc/passwd, in the same manner we have edited the /etc/shadow file.

Comments

Popular posts from this blog

Sunset:Noontide - Walkthrough [Vulnhub]

CyberSploit:2 - Walkthrough [Vulnhub]

BBS(cute):1.0.1 - Walkthrough [Vulnhub]