Add test_port_scanner_results test case
This commit is contained in:
@@ -57,7 +57,7 @@ class TC_NetworkRest < Test::Unit::TestCase
|
||||
:accept => :json
|
||||
result = JSON.parse(response.body)
|
||||
success = result['success']
|
||||
cmd_id = result['command_id']
|
||||
@@cmd_id = result['command_id']
|
||||
sleep 15.0
|
||||
end
|
||||
|
||||
@@ -67,6 +67,14 @@ class TC_NetworkRest < Test::Unit::TestCase
|
||||
|
||||
end
|
||||
|
||||
# Ensure the Port Scanner module identified the BeEF host
|
||||
def test_port_scanner_results
|
||||
rest_response = RestClient.get "#{RESTAPI_MODULES}/#{@@hb_session}/#{@@mod_port_scanner}/#{@@cmd_id}?token=#{@@token}"
|
||||
check_rest_response(rest_response)
|
||||
result = JSON.parse(rest_response.body)
|
||||
raise "Port Scanner module failed to identify any open ports" unless result.to_s =~ /Port 3000 is OPEN/
|
||||
end
|
||||
|
||||
# Tests GET /api/network/hosts handler
|
||||
def test_get_all_hosts
|
||||
rest_response = RestClient.get("#{RESTAPI_NETWORK}/hosts?token=#{@@token}")
|
||||
|
||||
Reference in New Issue
Block a user