1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-28 18:39:03 +00:00

Removes duplicate credential structure in favor of NSE library creds. Patch submitted by nnposter fixes #58

This commit is contained in:
paulino
2015-04-16 18:51:45 +00:00
parent 80a14ef0f6
commit 4a95d8f9b2
3 changed files with 24 additions and 36 deletions

View File

@@ -16,8 +16,8 @@ Performs brute force password auditing against http basic authentication.
-- nmap --script http-brute -p 80 <host>
--
-- This script uses the unpwdb and brute libraries to perform password
-- guessing. Any successful guesses are stored in the nmap registry, under
-- the nmap.registry.credentials.http key for other scripts to use.
-- guessing. Any successful guesses are stored in the nmap registry, using
-- the creds library, for other scripts to use.
--
-- @output
-- PORT STATE SERVICE REASON
@@ -90,13 +90,6 @@ Driver = {
-- but gave me a number of false positives last time I tried.
-- We decided to change it to ~= 4xx.
if ( response.status < 400 or response.status > 499 ) then
if ( not( nmap.registry['credentials'] ) ) then
nmap.registry['credentials'] = {}
end
if ( not( nmap.registry.credentials['http'] ) ) then
nmap.registry.credentials['http'] = {}
end
table.insert( nmap.registry.credentials.http, { username = username, password = password } )
return true, creds.Account:new( username, password, creds.State.VALID)
end
return false, brute.Error:new( "Incorrect password" )