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/bsd/x86/exec.rb
Views: 11779
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
20
21
def initialize(info = {})
22
super(merge_info(info,
23
'Name' => 'BSD Execute Command',
24
'Description' => 'Execute an arbitrary command',
25
'Author' => [
26
'snagg <snagg[at]openssl.it>',
27
'argp <argp[at]census-labs.com>',
28
'joev'
29
],
30
'License' => BSD_LICENSE,
31
'Platform' => 'bsd',
32
'Arch' => ARCH_X86
33
))
34
35
# Register exec options
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