Files
metasploit-gs/modules/nops/armle/simple.rb
T

58 lines
1.1 KiB
Ruby
Raw Normal View History

##
2017-07-24 06:26:21 -07:00
# This module requires Metasploit: https://metasploit.com/download
2013-10-15 13:50:46 -05:00
# Current source: https://github.com/rapid7/metasploit-framework
##
###
#
# SingleByte
# ----------
#
# This class implements simple NOP generator for ARM (little endian)
#
###
2016-03-08 14:02:44 +01:00
class MetasploitModule < Msf::Nop
2013-08-30 16:28:54 -05:00
def initialize
super(
'Name' => 'Simple',
'Alias' => 'armle_simple',
'Description' => 'Simple NOP generator',
'Author' => 'hdm',
'License' => MSF_LICENSE,
'Arch' => ARCH_ARMLE)
2013-08-30 16:28:54 -05:00
register_advanced_options(
[
OptBool.new('RandomNops', [ false, "Generate a random NOP sled", true ])
])
2013-08-30 16:28:54 -05:00
end
2013-08-30 16:28:54 -05:00
def generate_sled(length, opts)
2013-08-30 16:28:54 -05:00
badchars = opts['BadChars'] || ''
random = opts['Random'] || datastore['RandomNops']
2013-08-30 16:28:54 -05:00
nops = [
0xe1a01001,
0xe1a02002,
0xe1a03003,
0xe1a04004,
0xe1a05005,
0xe1a06006,
0xe1a07007,
0xe1a08008,
0xe1a09009,
0xe1a0a00a,
0xe1a0b00b
]
if random
2013-08-30 16:28:54 -05:00
return ([nops[rand(nops.length)]].pack("V*") * (length/4))
end
2013-08-30 16:28:54 -05:00
return ([nops[0]].pack("V*") * (length/4))
end
2009-07-19 16:07:59 +00:00
end