Setting up a persistent connection with backdoors
We started this book with a pre-exploitation technique where we focused on information gathering. Then, we moved ahead to the exploitation phase where we learned different ways of compromising the target. Then, we learned some useful post-exploitation techniques that can be implemented after compromising the target. Now, in this recipe we will learn the ever-exploitation technique in which we will try to establish a persistent connection with our target, so that we can connect to it at our will. As the attacker, or the target machine, cannot be always available, backdooring the target can be effective for setting persistent connections.
Getting ready
Meterpreter provides us with two scripts which can perform the task of backdooring the target. They are Metsvc and Persistence. The working of both the scripts is similar.Let us deal with both these scripts one by one.
Note
Both these meterpreter scripts create files on the target system so it can...