mirror of
https://github.com/aljazceru/cowrie.git
synced 2025-12-17 14:04:28 +01:00
don't let user set password to '*'
This commit is contained in:
@@ -169,7 +169,7 @@ class command_passwd(HoneyPotCommand):
|
|||||||
def finish(self, line):
|
def finish(self, line):
|
||||||
self.honeypot.password_input = False
|
self.honeypot.password_input = False
|
||||||
|
|
||||||
if line != self.passwd:
|
if line != self.passwd or self.passwd == '*':
|
||||||
self.writeln('Sorry, passwords do not match')
|
self.writeln('Sorry, passwords do not match')
|
||||||
self.exit()
|
self.exit()
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ class UserDB:
|
|||||||
'''note that it allows multiple passwords for a single username'''
|
'''note that it allows multiple passwords for a single username'''
|
||||||
|
|
||||||
for (login, uid, passwd) in self.userdb:
|
for (login, uid, passwd) in self.userdb:
|
||||||
if login == thelogin and (passwd == thepasswd or passwd == '*'):
|
if login == thelogin and passwd in (thepasswd, '*'):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user