From 588ac4fd32edfa3cc652b060f63291483eec700c Mon Sep 17 00:00:00 2001 From: patrik Date: Sat, 31 Dec 2011 10:17:42 +0000 Subject: [PATCH] Disable username as password if passonly option is used [Patrik] --- nselib/brute.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nselib/brute.lua b/nselib/brute.lua index c49682bec..6a1dc9466 100644 --- a/nselib/brute.lua +++ b/nselib/brute.lua @@ -688,7 +688,10 @@ Engine = end if ( ( not(mode) or mode == 'user' or mode == 'pass' ) and self.options.useraspass ) then - table.insert( self.iterators, 1, Iterators.pw_same_as_user_iterator(usernames, "lower")) + -- if we're only guessing passwords, this doesn't make sense + if ( not(self.options.passonly) ) then + table.insert( self.iterators, 1, Iterators.pw_same_as_user_iterator(usernames, "lower")) + end end if ( ( not(mode) or mode == 'user' or mode == 'pass' ) and self.options.emptypass ) then