mirror of
https://github.com/lgandx/Responder.git
synced 2025-07-15 09:32:53 -07:00
Better handling of cleartext credentials
This commit is contained in:
parent
97aeac26d8
commit
750a2466d9
1 changed files with 15 additions and 9 deletions
20
utils.py
20
utils.py
|
@ -162,19 +162,22 @@ def SaveToDb(result):
|
||||||
result[k] = ''
|
result[k] = ''
|
||||||
|
|
||||||
if len(result['user']) < 2:
|
if len(result['user']) < 2:
|
||||||
|
print color('[*] Skipping one character username: %s' % result['user'], 3, 1)
|
||||||
|
text("[*] Skipping one character username: %s" % result['user'])
|
||||||
return
|
return
|
||||||
|
|
||||||
if len(result['cleartext']):
|
|
||||||
fname = '%s-%s-ClearText-%s.txt' % (result['module'], result['type'], result['client'])
|
|
||||||
else:
|
|
||||||
fname = '%s-%s-%s.txt' % (result['module'], result['type'], result['client'])
|
|
||||||
|
|
||||||
logfile = os.path.join(settings.Config.ResponderPATH, 'logs', fname)
|
|
||||||
|
|
||||||
cursor = sqlite3.connect(settings.Config.DatabaseFile)
|
cursor = sqlite3.connect(settings.Config.DatabaseFile)
|
||||||
cursor.text_factory = sqlite3.Binary # We add a text factory to support different charsets
|
cursor.text_factory = sqlite3.Binary # We add a text factory to support different charsets
|
||||||
|
|
||||||
|
if len(result['cleartext']):
|
||||||
|
fname = '%s-%s-ClearText-%s.txt' % (result['module'], result['type'], result['client'])
|
||||||
|
res = cursor.execute("SELECT COUNT(*) AS count FROM responder WHERE module=? AND type=? AND client=? AND LOWER(user)=LOWER(?) AND cleartext=?", (result['module'], result['type'], result['client'], result['user'], result['cleartext']))
|
||||||
|
else:
|
||||||
|
fname = '%s-%s-%s.txt' % (result['module'], result['type'], result['client'])
|
||||||
res = cursor.execute("SELECT COUNT(*) AS count FROM responder WHERE module=? AND type=? AND client=? AND LOWER(user)=LOWER(?)", (result['module'], result['type'], result['client'], result['user']))
|
res = cursor.execute("SELECT COUNT(*) AS count FROM responder WHERE module=? AND type=? AND client=? AND LOWER(user)=LOWER(?)", (result['module'], result['type'], result['client'], result['user']))
|
||||||
|
|
||||||
(count,) = res.fetchone()
|
(count,) = res.fetchone()
|
||||||
|
logfile = os.path.join(settings.Config.ResponderPATH, 'logs', fname)
|
||||||
|
|
||||||
if not count:
|
if not count:
|
||||||
with open(logfile,"a") as outf:
|
with open(logfile,"a") as outf:
|
||||||
|
@ -218,6 +221,9 @@ def SaveToDb(result):
|
||||||
if settings.Config.AutoIgnore and not result['user'].endswith('$'):
|
if settings.Config.AutoIgnore and not result['user'].endswith('$'):
|
||||||
settings.Config.AutoIgnoreList.append(result['client'])
|
settings.Config.AutoIgnoreList.append(result['client'])
|
||||||
print color('[*] Adding client %s to auto-ignore list' % result['client'], 4, 1)
|
print color('[*] Adding client %s to auto-ignore list' % result['client'], 4, 1)
|
||||||
|
elif len(result['cleartext']):
|
||||||
|
print color('[*] Skipping previously captured cleartext password for %s' % result['user'], 3, 1)
|
||||||
|
text('[*] Skipping previously captured cleartext password for %s' % result['user'])
|
||||||
else:
|
else:
|
||||||
print color('[*] Skipping previously captured hash for %s' % result['user'], 3, 1)
|
print color('[*] Skipping previously captured hash for %s' % result['user'], 3, 1)
|
||||||
text('[*] Skipping previously captured hash for %s' % result['user'])
|
text('[*] Skipping previously captured hash for %s' % result['user'])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue