O'Reilly logo

Metasploit Penetration Testing Cookbook - Second Edition by Abhinav Singh, Monika Agarwal

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

Analyzing an existing Meterpreter script

Now that we have learned how to build our own script, let us move ahead and analyze an existing script that performs some advanced tasks. Once you are able to read an existing script completely, you can implement the functions from them according to your need. Code reuse is an effective technique to increase the optimization of codes.

How to do it...

To view an existing script, navigate to pentest/exploits/framework3/scripts/meterpreter.

You can find all the available Meterpreter scripts in this folder. We will be analyzing the persistence.rb script, which helps in setting up a backdoor on the target user. We have discussed the usage of this script in the previous chapter. Here, we will look under the hood ...

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