Path: blob/master/modules/nops/armle/simple.rb
19612 views
##1# This module requires Metasploit: https://metasploit.com/download2# Current source: https://github.com/rapid7/metasploit-framework3##45###6#7# SingleByte8# ----------9#10# This class implements simple NOP generator for ARM (little endian)11#12###13class MetasploitModule < Msf::Nop1415def initialize16super(17'Name' => 'Simple',18'Alias' => 'armle_simple',19'Description' => 'Simple NOP generator',20'Author' => 'hdm',21'License' => MSF_LICENSE,22'Arch' => ARCH_ARMLE)2324register_advanced_options(25[26OptBool.new('RandomNops', [ false, 'Generate a random NOP sled', true ])27]28)29end3031def generate_sled(length, opts)32opts['BadChars'] || ''33random = opts['Random'] || datastore['RandomNops']3435nops = [360xe1a01001,370xe1a02002,380xe1a03003,390xe1a04004,400xe1a05005,410xe1a06006,420xe1a07007,430xe1a08008,440xe1a09009,450xe1a0a00a,460xe1a0b00b47]4849if random50return ([nops[rand(nops.length)]].pack('V*') * (length / 4))51end5253return ([nops[0]].pack('V*') * (length / 4))54end55end565758