Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/payloads/singles/bsd/x86/exec.rb
21547 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
19
20
def initialize(info = {})
21
super(
22
merge_info(
23
info,
24
'Name' => 'BSD 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' => 'bsd',
33
'Arch' => ARCH_X86
34
)
35
)
36
37
# Register exec options
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