2007-02-18 00:10:39 +00: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
|
2007-02-18 00:10:39 +00:00
|
|
|
##
|
|
|
|
|
|
2005-10-11 07:22:38 +00:00
|
|
|
###
|
|
|
|
|
#
|
|
|
|
|
# Exec
|
|
|
|
|
# ----
|
|
|
|
|
#
|
|
|
|
|
# Executes an arbitrary command.
|
|
|
|
|
#
|
|
|
|
|
###
|
2016-03-08 14:02:44 +01:00
|
|
|
module MetasploitModule
|
2005-10-11 07:22:38 +00:00
|
|
|
|
2015-08-13 11:10:50 -05:00
|
|
|
CachedSize = 24
|
2015-03-09 15:31:04 -05:00
|
|
|
|
2013-08-30 16:28:54 -05:00
|
|
|
include Msf::Payload::Single
|
2015-04-14 23:23:02 -05:00
|
|
|
include Msf::Payload::Bsd
|
2005-10-11 07:22:38 +00:00
|
|
|
|
2013-08-30 16:28:54 -05:00
|
|
|
def initialize(info = {})
|
|
|
|
|
super(merge_info(info,
|
2015-04-15 14:34:26 -05:00
|
|
|
'Name' => 'BSD Execute Command',
|
|
|
|
|
'Description' => 'Execute an arbitrary command',
|
|
|
|
|
'Author' => [
|
|
|
|
|
'snagg <snagg[at]openssl.it>',
|
|
|
|
|
'argp <argp[at]census-labs.com>',
|
|
|
|
|
'joev'
|
2015-04-15 19:26:53 -05:00
|
|
|
],
|
2015-04-15 14:34:26 -05:00
|
|
|
'License' => BSD_LICENSE,
|
|
|
|
|
'Platform' => 'bsd',
|
2015-04-15 19:26:53 -05:00
|
|
|
'Arch' => ARCH_X86
|
|
|
|
|
))
|
2005-10-11 07:22:38 +00:00
|
|
|
|
2013-08-30 16:28:54 -05:00
|
|
|
# Register exec options
|
2015-04-14 23:08:57 -05:00
|
|
|
register_options([
|
|
|
|
|
OptString.new('CMD', [ true, "The command string to execute" ]),
|
2017-05-03 15:42:21 -05:00
|
|
|
])
|
2013-08-30 16:28:54 -05:00
|
|
|
end
|
2005-10-11 07:22:38 +00:00
|
|
|
|
2013-08-30 16:28:54 -05:00
|
|
|
#
|
|
|
|
|
# Dynamically builds the exec payload based on the user's options.
|
|
|
|
|
#
|
2015-05-15 12:27:25 +10:00
|
|
|
def generate_stage(opts={})
|
2015-04-14 23:08:57 -05:00
|
|
|
bsd_x86_exec_payload
|
2013-08-30 16:28:54 -05:00
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
end
|