Path: blob/master/modules/nops/aarch64/simple.rb
19664 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 AARCH6411#12###13class MetasploitModule < Msf::Nop1415def initialize16super(17'Name' => 'Simple',18'Alias' => 'armle_simple',19'Description' => 'Simple NOP generator',20'License' => MSF_LICENSE,21'Author' => ['timwr'],22'Arch' => ARCH_AARCH64)23register_advanced_options(24[25OptBool.new('RandomNops', [ false, 'Generate a random NOP sled', true ])26]27)28end2930def generate_sled(length, opts)31random = opts['Random'] || datastore['RandomNops']32nops = [330xd503201f, # nop340xaa0103e1, # mov x1, x1350xaa0203e2, # mov x2, x2360x2a0303e3, # mov w3, w3370x2a0403e4, # mov w4, w438]39if random40return ([nops[rand(nops.length)]].pack('V*') * (length / 4))41end4243return ([nops[0]].pack('V*') * (length / 4))44end45end464748