2005-12-17 06:46:23 +00:00
|
|
|
#!/usr/bin/env ruby
|
2005-09-24 18:02:03 +00:00
|
|
|
|
|
|
|
$:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..'))
|
|
|
|
|
|
|
|
require 'test/unit'
|
|
|
|
require 'rex'
|
|
|
|
require 'msf/core'
|
|
|
|
require 'msf/core/exploit/seh'
|
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
|
|
|
class Exploit::Seh::UnitTest < Test::Unit::TestCase
|
|
|
|
|
|
|
|
class Stub < Msf::Exploit::Remote
|
|
|
|
include Msf::Exploit::Seh
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_seh
|
|
|
|
e = Stub.new
|
|
|
|
r = e.generate_seh_record(0x41414141,
|
|
|
|
'EvasionLevel' => EVASION_NORMAL)
|
|
|
|
|
|
|
|
assert_equal("\xeb\x06", r[0, 2])
|
|
|
|
assert_equal("\x41\x41\x41\x41", r[4, 4])
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|