30 lines
806 B
Ruby
30 lines
806 B
Ruby
#!/usr/bin/ruby
|
|
|
|
$:.unshift(File.join('..', '..', '..', '..', File.dirname(__FILE__)))
|
|
|
|
require 'test/unit'
|
|
require 'Msf/Core'
|
|
|
|
module Msf
|
|
|
|
class Exploit::Remote::DCERPC::UnitTest < Test::Unit::TestCase
|
|
|
|
class Stub < Msf::Exploit::Remote
|
|
include Msf::Exploit::Remote::DCERPC
|
|
end
|
|
|
|
def test_tcp
|
|
e = Stub.new
|
|
|
|
assert_equal(4, e.options.length, "invalid options length")
|
|
assert_equal(true, e.options.get('RHOST').required?, "invalid RHOST requirement")
|
|
assert_equal(true, e.options.get('RPORT').required?, "invalid RPORT requirement")
|
|
assert_equal(135, e.options.get('RPORT').default, "invalid RPORT default")
|
|
assert_equal(false, e.options.get('LHOST').required?, "invalid LHOST requirement")
|
|
assert_equal(false, e.options.get('LPORT').required?, "invalid LPORT requirement")
|
|
end
|
|
|
|
end
|
|
|
|
end
|