2012-04-25 17:40:20 +00:00
|
|
|
##
|
|
|
|
# $Id$
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# This file is part of the Metasploit Framework and may be subject to
|
|
|
|
# redistribution and commercial restrictions. Please see the Metasploit
|
|
|
|
# web site for more information on licensing and terms of use.
|
|
|
|
# http://metasploit.com/
|
|
|
|
##
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
require 'rex'
|
2012-04-28 01:16:24 +00:00
|
|
|
require 'msf/core/post/common'
|
2012-04-25 17:40:20 +00:00
|
|
|
|
|
|
|
class Metasploit3 < Msf::Post
|
|
|
|
|
|
|
|
include Msf::Post::Common
|
2012-05-01 22:29:27 +00:00
|
|
|
|
2012-04-25 17:40:20 +00: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' ],
|
|
|
|
'Version' => '$Revision$',
|
|
|
|
'Platform' => [ 'linux', 'windows', 'unix', 'osx' ],
|
|
|
|
'SessionTypes' => [ 'shell', 'meterpreter' ]
|
|
|
|
))
|
|
|
|
register_options(
|
|
|
|
[
|
|
|
|
OptString.new( 'COMMAND', [false, 'The entire command line to execute on the session'])
|
2012-05-01 22:29:27 +00:00
|
|
|
], self.class)
|
2012-04-25 17:40:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def run
|
|
|
|
print_status("Executing #{datastore['COMMAND']} on #{session.inspect}...")
|
|
|
|
res = cmd_exec(datastore['COMMAND'])
|
|
|
|
print_status("Response: #{res}")
|
2012-05-01 22:29:27 +00:00
|
|
|
|
2012-04-25 17:40:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
end
|