Hands-On Red Team Tactics
上QQ阅读APP看书,第一时间看更新

Exploits

When Metasploit starts up, it shows the count of the publicly available exploits that are already available in the framework An exploit can be considered as the piece of code that takes advantage of a vulnerability and gives us the desired output.

To view all the available exploits, we use the following command:

show exploits

The preceding command will show a list of all the available exploits in the Metasploit Framework, along with path, disclosure date, its ranking, and even description. Using the exploit is similar to using an auxiliary. Let's look at an example of an RCE exploit that was found on the HP Data Protector.

Metasploit allows us to search the modules as well, using the following command:

search < module name>  

To use one of the modules, we type the following:

use exploit/windows/misc/hp_dataprotector_cmd_exec 

Once the exploit is loaded, we see the following options:

We set the IP of the RHOST using the set command:

 set RHOST <IP Here>

And then we run it:

Running this exploit requires Metasploit to be run as root, as port 445 is considered a privileged port to which this exploit is bound.