NullByte:1 - Walkthrough [Vulnhub]

Here's my solution for NullByte:1
The Machine can be downloaded from here.

Nmap
Scanning for all TCP ports.
$ nmap -sC -sV -p- 192.168.1.142

We find 4 ports open.

Enumeration
Browsing the web and checking the source did not reveal any hint.

 

 

But we observe there is an image, lets download this image and check if we can get any information.

$ wget http://192.168.1.142/main.gif
$ exiftool main.gif

$ strings main.gif

We find- kzMb5nVYJw as a hint, which is a directory.

Browsing http://192.168.1.142/kzMb5nVYJw/ and checking the source give us the hint- that the key is simple.

 

Using hydra to brute force.
$ hydra -P /usr/share/wordlists/rockyou.txt 192.168.1.142 http-form-post "/kzMb5nVYJw/:key=^PASS^:invalid key" -la

 

We get the password as- elite

After entering the key, we are landed to /kzMb5nVYJw/index.php

Here we enter a random name- root, and we observe the URL, the parameter- usrtosearch= is vulnerable to SQL Injection.

We use sqlmap, to enumerate databases.
$ sqlmap -u "http://192.168.1.142/kzMb5nVYJw/420search.php?usrtosearch=root" --dbs

We dump the database- seth.
$ sqlmap -u "http://192.168.1.142/kzMb5nVYJw/420search.php?usrtosearch=root" -D seth --dump

  

Seems like the password for user- ramses, in encoded in base64.
Lets decode it.

Now the value seems to be md5 encrypted, we browse CrackStation to decryt.

We get the value as- omega.

Getting Access
We have the credential as-
User: ramses
Password: omega

Accessing ssh with the credentials on port 777.
$ ssh ramses@192.168.1.142 -p 777

Privilege Escalation
We check for SUID permission.

We run the file, and we observe the output is same as the- ps command.

Root Flag.

 

Comments

Popular posts from this blog

Sunset:Noontide - Walkthrough [Vulnhub]

CyberSploit:2 - Walkthrough [Vulnhub]

BBS(cute):1.0.1 - Walkthrough [Vulnhub]