support for preferred nop

git-svn-id: file:///home/svn/incoming/trunk@3399 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Matt Miller 2006-01-17 01:11:26 +00:00
parent b9bdd96f97
commit ba0b13292b
2 changed files with 12 additions and 1 deletions

View File

@ -196,7 +196,17 @@ class EncodedPayload
# Now construct the actual sled
if (self.nop_sled_size > 0)
pinst.compatible_nops.each { |nopname, nopmod|
nops = pinst.compatible_nops
# If the caller had a preferred nop, try to find it and prefix it
if ((reqs['Nop']) and
(preferred = framework.encoders[reqs['Nop']]))
encoders.unshift([reqs['Nop'], preferred ])
elsif (reqs['Nop'])
wlog("#{pinst.refname}: Failed to find preferred nop #{reqs['Nop']}")
end
nops.each { |nopname, nopmod|
# Create an instance of the nop module
self.nop = nopmod.new

View File

@ -368,6 +368,7 @@ class Exploit < Msf::Module
reqs['MaxNops'] = payload_max_nops
reqs['MinNops'] = payload_min_nops
reqs['Encoder'] = datastore['Encoder']
reqs['Nop'] = datastore['Nop']
reqs['EncoderType'] = payload_encoder_type
reqs['EncoderOptions'] = payload_encoder_options