2010-10-20 22:33:49 +00:00
|
|
|
# $Id$
|
|
|
|
# $Revision$
|
|
|
|
# Author:
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
################## Variable Declarations ##################
|
|
|
|
|
|
|
|
@client = client
|
|
|
|
sample_option_var = nil
|
|
|
|
@exec_opts = Rex::Parser::Arguments.new(
|
2013-09-30 18:47:53 +00:00
|
|
|
"-h" => [ false, "Help menu." ],
|
|
|
|
"-o" => [ true , "Option that requieres a value"]
|
|
|
|
)
|
2010-10-20 22:33:49 +00:00
|
|
|
meter_type = client.platform
|
|
|
|
|
|
|
|
################## Function Declarations ##################
|
|
|
|
|
|
|
|
# Usage Message Function
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
def usage
|
2013-09-30 18:47:53 +00:00
|
|
|
print_line "Meterpreter Script for INSERT PURPOSE."
|
|
|
|
print_line(@exec_opts.usage)
|
|
|
|
raise Rex::Script::Completed
|
2010-10-20 22:33:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
# Wrong Meterpreter Version Message Function
|
|
|
|
#-------------------------------------------------------------------------------
|
|
|
|
def wrong_meter_version(meter = meter_type)
|
2013-09-30 18:47:53 +00:00
|
|
|
print_error("#{meter} version of Meterpreter is not supported with this Script!")
|
|
|
|
raise Rex::Script::Completed
|
2010-10-20 22:33:49 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
################## Main ##################
|
|
|
|
@exec_opts.parse(args) { |opt, idx, val|
|
2013-09-30 18:47:53 +00:00
|
|
|
case opt
|
|
|
|
when "-h"
|
|
|
|
usage
|
|
|
|
when "-o"
|
|
|
|
sample_option_var = val
|
|
|
|
end
|
2010-10-20 22:33:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
# Check for Version of Meterpreter
|
|
|
|
wrong_meter_version(meter_type) if meter_type !~ /win32|win64|java|php|linux/i # Remove none supported versions
|