Ensure that username is only used as password once

This commit is contained in:
root@NIH-PenTest-L02 2023-06-16 11:25:49 -04:00
parent 6dc9c4a55e
commit 76df6b2d44

View file

@ -51,11 +51,16 @@ portrule = shortport.port_or_service({50000,60000}, {"drda","ibm-db2"}, "tcp", {
local function new_usrpwd_iterator (usernames, passwords)
local function next_username_password ()
local useraspass = stdnse.get_script_args('drda-brute.useraspass') or false
for username in usernames do
local namenotused = true
for password in passwords do
if ( username == password ) then
namenotused = false
end
coroutine.yield(username, password)
end
if useraspass then
if (useraspass and namenotused) then
coroutine.yield(username, username)
end
passwords("reset")