Land #6099, make_nops doesn't take into account all the compatible encoders
commit
b76192dbcb
|
@ -342,14 +342,18 @@ class EncodedPayload
|
||||||
self.nop_sled = nop.generate_sled(self.nop_sled_size,
|
self.nop_sled = nop.generate_sled(self.nop_sled_size,
|
||||||
'BadChars' => reqs['BadChars'],
|
'BadChars' => reqs['BadChars'],
|
||||||
'SaveRegisters' => save_regs)
|
'SaveRegisters' => save_regs)
|
||||||
|
|
||||||
|
if nop_sled && nop_sled.length == nop_sled_size
|
||||||
|
break
|
||||||
|
else
|
||||||
|
dlog("#{pinst.refname}: Nop generator #{nop.refname} failed to generate sled for payload", 'core', LEV_1)
|
||||||
|
end
|
||||||
rescue
|
rescue
|
||||||
dlog("#{pinst.refname}: Nop generator #{nop.refname} failed to generate sled for payload: #{$!}",
|
dlog("#{pinst.refname}: Nop generator #{nop.refname} failed to generate sled for payload: #{$!}",
|
||||||
'core', LEV_1)
|
'core', LEV_1)
|
||||||
|
|
||||||
self.nop = nil
|
self.nop = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (self.nop_sled == nil)
|
if (self.nop_sled == nil)
|
||||||
|
|
|
@ -1034,12 +1034,16 @@ class Exploit < Msf::Module
|
||||||
nop_sled = nop.generate_sled(count,
|
nop_sled = nop.generate_sled(count,
|
||||||
'BadChars' => payload_badchars || '',
|
'BadChars' => payload_badchars || '',
|
||||||
'SaveRegisters' => save_regs)
|
'SaveRegisters' => save_regs)
|
||||||
|
|
||||||
|
if nop_sled && nop_sled.length == count
|
||||||
|
break
|
||||||
|
else
|
||||||
|
wlog("#{self.refname}: Nop generator #{nop.refname} failed to generate sled for exploit", 'core', LEV_0)
|
||||||
|
end
|
||||||
rescue
|
rescue
|
||||||
wlog("#{self.refname}: Nop generator #{nop.refname} failed to generate sled for exploit: #{$!}",
|
wlog("#{self.refname}: Nop generator #{nop.refname} failed to generate sled for exploit: #{$!}",
|
||||||
'core', LEV_0)
|
'core', LEV_0)
|
||||||
end
|
end
|
||||||
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nop_sled
|
nop_sled
|
||||||
|
|
Loading…
Reference in New Issue