1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-29 10:59:02 +00:00

Added support for comments in the credential_iterator [Patrik]

This commit is contained in:
patrik
2011-07-25 17:59:05 +00:00
parent a8df084c1f
commit 5e954c65a9

View File

@@ -589,7 +589,7 @@ Engine =
-- if delay was speciefied, do sleep
if ( self.options.delay > 0 ) then stdnse.sleep( self.options.delay ) end
end
condvar "broadcast"
condvar "signal"
end,
--- Starts the brute-force
@@ -822,10 +822,12 @@ Iterators = {
local function next_credential ()
local c = {}
for line in f:lines() do
local trim = function(s) return s:match('^()%s*$') and '' or s:match('^%s*(.*%S)') end
line = trim(line)
local user, pass = line:match("^([^%/]*)%/(.*)$")
coroutine.yield( user, pass )
if ( not(line:match("^#!comment:")) ) then
local trim = function(s) return s:match('^()%s*$') and '' or s:match('^%s*(.*%S)') end
line = trim(line)
local user, pass = line:match("^([^%/]*)%/(.*)$")
coroutine.yield( user, pass )
end
end
f:close()
while true do coroutine.yield( nil, nil ) end