2012-04-25 12:40:20 -05:00
|
|
|
##
|
2017-07-24 06:26:21 -07:00
|
|
|
# This module requires Metasploit: https://metasploit.com/download
|
2013-10-15 13:50:46 -05:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2012-04-25 12:40:20 -05:00
|
|
|
##
|
|
|
|
|
|
2016-03-08 14:02:44 +01:00
|
|
|
class MetasploitModule < Msf::Post
|
2012-04-25 12:40:20 -05:00
|
|
|
|
2013-09-05 13:41:25 -05:00
|
|
|
def initialize(info={})
|
|
|
|
|
super( update_info( info,
|
|
|
|
|
'Name' => 'Multi Generic Operating System Session Command Execution',
|
|
|
|
|
'Description' => %q{ This module executes an arbitrary command line},
|
|
|
|
|
'License' => MSF_LICENSE,
|
|
|
|
|
'Author' => [ 'hdm' ],
|
2013-09-24 12:33:31 -05:00
|
|
|
'Platform' => %w{ linux osx unix win },
|
2013-09-05 13:41:25 -05:00
|
|
|
'SessionTypes' => [ 'shell', 'meterpreter' ]
|
|
|
|
|
))
|
|
|
|
|
register_options(
|
|
|
|
|
[
|
|
|
|
|
OptString.new( 'COMMAND', [false, 'The entire command line to execute on the session'])
|
2017-05-03 15:42:21 -05:00
|
|
|
])
|
2013-09-05 13:41:25 -05:00
|
|
|
end
|
2012-04-25 12:40:20 -05:00
|
|
|
|
2013-08-30 16:28:54 -05:00
|
|
|
def run
|
|
|
|
|
print_status("Executing #{datastore['COMMAND']} on #{session.inspect}...")
|
|
|
|
|
res = cmd_exec(datastore['COMMAND'])
|
|
|
|
|
print_status("Response: #{res}")
|
2012-05-01 17:29:27 -05:00
|
|
|
|
2013-08-30 16:28:54 -05:00
|
|
|
end
|
2012-04-25 12:40:20 -05:00
|
|
|
end
|