O'Reilly logo

Mastering Kali Linux for Advanced Penetration Testing by Robert W. Beggs

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Maintaining persistence with the Metasploit Framework

Metasploit's meterpreter contains several scripts that support persistence on a compromised system. We will examine two script options for placing a backdoor on a compromised system: metsvc and persistence.

Using the metsvc script

The metsvc script is a network service wrapper for meterpreter that allows it to either be used as a Windows service or run as a command-line application. It is typically used as a backdoor to maintain communications with a compromised system.

To use metsvc, first compromise the system and then migrate meterpreter to the explorer.exe process to obtain a more stable shell.

Execute the metsvc agent by invoking the run command, as shown in the following screenshot. As you ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required