2008-02-09 07:58:38 +00:00
|
|
|
##
|
2014-10-17 16:47:33 +00:00
|
|
|
# This module requires Metasploit: http://metasploit.com/download
|
2013-10-15 18:50:46 +00:00
|
|
|
# Current source: https://github.com/rapid7/metasploit-framework
|
2008-02-09 07:58:38 +00:00
|
|
|
##
|
|
|
|
|
|
|
|
|
|
|
|
require 'msf/core'
|
|
|
|
|
|
|
|
###
|
|
|
|
#
|
|
|
|
# Exec
|
|
|
|
# ----
|
|
|
|
#
|
|
|
|
# Executes an arbitrary command.
|
|
|
|
#
|
|
|
|
###
|
2008-10-02 05:23:59 +00:00
|
|
|
module Metasploit3
|
2008-02-09 07:58:38 +00:00
|
|
|
|
2015-04-12 05:21:18 +00:00
|
|
|
CachedSize = 16
|
2015-03-09 20:31:04 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Payload::Single
|
2015-04-15 04:08:57 +00:00
|
|
|
include Msf::Payload::Bsd::X86
|
2013-08-30 21:28:54 +00:00
|
|
|
include Msf::Payload::Osx
|
2008-02-09 07:58:38 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
def initialize(info = {})
|
|
|
|
super(merge_info(info,
|
2015-04-15 04:08:57 +00:00
|
|
|
'Name' => 'OS X Execute Command',
|
|
|
|
'Description' => 'Execute an arbitrary command',
|
|
|
|
'Author' => [
|
|
|
|
'snagg <snagg[at]openssl.it>',
|
|
|
|
'argp <argp[at]census-labs.com>',
|
|
|
|
'joev'
|
|
|
|
],
|
|
|
|
'License' => BSD_LICENSE,
|
|
|
|
'Platform' => 'osx',
|
|
|
|
'Arch' => ARCH_X86
|
2013-08-30 21:28:54 +00:00
|
|
|
))
|
2008-02-09 07:58:38 +00:00
|
|
|
|
2015-04-15 04:08:57 +00:00
|
|
|
register_options([
|
|
|
|
OptString.new('CMD', [ true, "The command string to execute" ]),
|
|
|
|
], self.class)
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2008-02-09 07:58:38 +00:00
|
|
|
|
2013-08-30 21:28:54 +00:00
|
|
|
#
|
|
|
|
# Dynamically builds the exec payload based on the user's options.
|
|
|
|
#
|
|
|
|
def generate_stage
|
2015-04-15 04:08:57 +00:00
|
|
|
bsd_x86_exec_payload
|
2013-08-30 21:28:54 +00:00
|
|
|
end
|
2010-04-30 08:40:19 +00:00
|
|
|
end
|