Skip to content

Commit

Permalink
added test for guest sessions
Browse files Browse the repository at this point in the history
  • Loading branch information
bdamele committed Oct 18, 2013
1 parent a70a21d commit 34ca0ec
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions keimpx.py
Original file line number Diff line number Diff line change
Expand Up @@ -1724,13 +1724,30 @@ def test_bogus_domain(self, user, password, lmhash, nthash, domain):
except smb.SessionError, e:
return False

def test_guest_user(self):
try:
user = ''.join(random.choice(string.ascii_letters) for _ in range(8))
password = ''.join(random.choice(string.ascii_letters) for _ in range(8))
self.connect()
self.login(user, password, '', '', '')
self.logoff()

logger.warn('%s allows guest sessions with any credentials, skipping further login attempts' % self.__target_id)
return True
except smb.SessionError, e:
return False

def run(self):
global pool_thread
global successes

try:
logger.info('Attacking host %s' % self.__target_id)

if self.test_guest_user():
pool_thread.release()
return

for credential in credentials:
user, password, lmhash, nthash = credential.getCredentials()

Expand Down

0 comments on commit 34ca0ec

Please sign in to comment.