Allow using a single URI and/or a list of URIs

bug/bundler_fix
Spencer McIntyre 2014-03-20 09:54:02 -04:00
parent a8d919feb0
commit 74398c4b6e
1 changed files with 8 additions and 5 deletions

View File

@ -36,9 +36,12 @@ class Metasploit3 < Msf::Auxiliary
if datastore['TARGET_URI'] if datastore['TARGET_URI']
test_path = normalize_uri(datastore['TARGET_URI']) test_path = normalize_uri(datastore['TARGET_URI'])
result = check_url(test_path) result = check_url(test_path)
handle_result(test_path, result) if result if result
return handle_result(test_path, result)
elsif datastore['TARGET_URIS_FILE'] return
end
end
if datastore['TARGET_URIS_FILE'] and datastore['TARGET_URIS_FILE'].length > 0
File.open(datastore['TARGET_URIS_FILE'], 'rb').each_line do |line| File.open(datastore['TARGET_URIS_FILE'], 'rb').each_line do |line|
test_uri = line.chomp test_uri = line.chomp
test_path = normalize_uri(test_uri) test_path = normalize_uri(test_uri)
@ -48,8 +51,8 @@ class Metasploit3 < Msf::Auxiliary
return return
end end
end end
else elsif not datastore['TARGET_URI']
fail_with "Either TARGET_URI or TARGET_URIS_FILE must be specified." fail_with(Failure::BadConfig, "Either TARGET_URI or TARGET_URIS_FILE must be specified.")
end end
end end