The Metasploit project contains some of the best security tools available, including the open source Metasploit Framework. Both pen test devices Hackers use it to find and exploit vulnerabilities, as well as to prepare counter-attacks and develop malware. payloads or create reports.
The tool, which is maintained by Quick 7, even offers Full Documentation where you can learn the basics to get started with it.
However, Metasploit is not just another hacking tool. It is a complete platform with command lines and units that you can use to attack a target. It offers many different features, web interfaces, and free trials. But here we will focus on Metasploit FrameworkIt is the free and open source version.
Test Environment Setup
The idea in Metasploit is to attack another machine, so you’ll need another machine to run your tests. Most beginners use a Kali Linux virtual machine and their own machine as a destination.
Although it may seem convenient, it is not recommended to use such a configuration. It is better to use multiple virtual machines; For example, one for the attacker and one for the victim. In this way, you can practice and disable different operating systems. Antivirus software AND the firewall without danger.
For convenience, we will use kali linux but you can use nightly installers if you prefer. Metasploit Framework is available on all major operating systems, including macOS, Windows, and Linux distributions.
If you’re ready to install Kali, the easy way is to create a virtual machine file. Once done, connect to a new Kali session and look for Metasploit Framework in the menu to launch the console. Alternatively, you can open the terminal and type msfconsole.
As a general rule, it is strongly recommended to keep your system up-to-date to get the latest version of exploits and other software. To do this, open the Kali terminal and type appropriate update.
Main concepts and features of Metasploit
To get the most out of the Metasploit Framework, there are more advanced (not necessarily more complex) concepts that you need to understand.
In addition to loopholes and payloads, Metasploit provides helpers, which are pre-built modules to make your work easier.
For example, the command Use the wizard / scanner / ftp / easy_file_sharing_ftp
Allows you to exploit a vulnerability to traverse the directory found in FTP Server for Easy File Sharing 3.6.0 Update. File scanners use Being Command to efficiently identify vulnerabilities to exploit.
Also, the utilities are relatively organized by categories (subfolders), which can be useful to help speed up work procedures.
Encoders allow you to obfuscate your payloads to avoid detection. For example, the command uses the encoder /x64/xor uses an 8-byte key and takes advantage of x64 relative addressing.
Once you’ve created your first few payloads, there are more advanced settings you may want to look at, such as evasion options, which can be found with the show evasion command.
It doesn’t always default to all payloads, but if circumventions are available, you can use them to bypass typical detection mechanisms, such as antivirus software, Endpoint Detection and Response (EDR) programs, or firewalls.
Nops is another type of module provided by Metasploit. It can be displayed with the command Use nop/tty/generic.
These generators produce a ‘random byte string that you can use to override the standard IDS and IPS NOP signature sled’.
Metasploit can help implement root privilege escalation modules, install keyloggers, or run Power Shell Scripts after gaining unauthorized access.
These post-exploitation techniques are very helpful in speeding up operations during penetration testing. eg Use post /osx/capture/keylog_recorder They can be used to record keystrokes and other keyboard events.
When searching for other vulnerabilities or modules, use grep to speed up the process and select only the relevant results. It is useful for all types of units, not just auxiliary scanners.
metro It is an advanced payload that is one of the most used payloads in Metasploit. It is often used in development to simulate attacks and has special features that allow switching to another process or taking screenshots inside the target device.
Msfvenom is a combination of payload generation and encoding that replaced msfpayload and msfencode in 2015. The syntax is uncomplicated and you can use it directly in Kali Linux by typing the command or just msfpc in the terminal (outside the MSF unit). Also, you are not limited to one output format (for example, you can create .exe and other types of files).
What attackers can do with minimal effort
Metasploit is a powerful tool that pen testers (and hackers) can use to:
- Carry out all types of surveys and censuses
- Gain unauthorized access (eg Menu Icons)
- Impersonation of users
- secret data theft
- take pictures
- Copy the login page of the victim’s frequently visited website and redirect it to a rogue server (for example, by modifying the hosts file)
- install keyloggers