HackLAB: Vulnix
Machine: https://www.vulnhub.com/entry/hacklab-vulnix%2C48/
Now we can Download the 7z file and solve the machine by hosting it inside a virtual box.
Tools
Gaining Access
- I used the Bridged Adapter setting so my ip is 192.168.0.8.
- At first scanned with nmap. Nmap Shows some open ports 22 ssh, 25 smtp, 79 finger, 110 POP3, 111 rpcbind etc.
- If we run finger user enumeration script of pentestermonkey with command perl finger-user-enum.pl -U /opt/metasploit-framework/embedded/framework/data/wordlists/unix_users.txt -t IP_ADRESSwe can get many usernames including user.
- If we bruteforce port 22 for ssh with hydra, we will get the password for user user is letmein. We can use command,hydra -l user -P /opt/wordlist/rockyou.txt 192.168.0.8 ssh -t 4to bruteforce ssh with hydra.
- If we login to ssh and check id we can get an user inside /etc/passwdas vulnix 2008.
- After creating a user as 2008 vulnix, we can mount /home/vulnixusing nfs.
- Generate ssh key with ssh-keygen
- Now upload ssh key to the vulnix machine
- Now we can sshto the machine, withssh vulnix@192.168.0.8.
Priviledge Escalation
- sudo -lshows- /etc/exportsis editable. So, added- /root *(rw,sync,no_root_squash)to root.
- Now rebooting the VM will add root to nfs, and we can mount root directory.
- So we got the flag inside trophy.txtiscc614640424f5bd60ce5d5264899c3be.
Author: Zishan Ahamed Thandar