2005-06-05 06:07:18 +00:00
|
|
|
#!/usr/bin/ruby
|
|
|
|
|
2005-06-09 06:18:27 +00:00
|
|
|
$:.unshift(File.join(File.dirname(__FILE__), '..', '..', '..', '..'))
|
2005-06-05 06:07:18 +00:00
|
|
|
|
|
|
|
require 'test/unit'
|
2005-07-09 21:18:49 +00:00
|
|
|
require 'msf/core'
|
2005-06-05 06:07:18 +00:00
|
|
|
|
|
|
|
module Msf
|
|
|
|
|
|
|
|
class Exploit::Remote::Tcp::UnitTest < Test::Unit::TestCase
|
|
|
|
|
|
|
|
class Stub < Msf::Exploit::Remote
|
|
|
|
include Msf::Exploit::Remote::Tcp
|
|
|
|
end
|
|
|
|
|
|
|
|
def test_tcp
|
|
|
|
e = Stub.new
|
|
|
|
|
2005-07-13 18:06:12 +00:00
|
|
|
assert_equal(2, e.options.length, "invalid options length")
|
2005-06-05 06:07:18 +00:00
|
|
|
assert_equal(true, e.options.get('RHOST').required?, "invalid RHOST requirement")
|
|
|
|
assert_equal(true, e.options.get('RPORT').required?, "invalid RPORT requirement")
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
end
|