mirror of
https://github.com/aljazceru/cowrie.git
synced 2025-12-17 22:14:19 +01:00
Implement command input
git-svn-id: https://kippo.googlecode.com/svn/trunk@15 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
@@ -140,13 +140,22 @@ class command_pwd(HoneyPotCommand):
|
||||
|
||||
class command_passwd(HoneyPotCommand):
|
||||
def call(self, args):
|
||||
# Until we learn how to be interactive
|
||||
for i in [
|
||||
'Changing password for root.',
|
||||
'passwd: Authentication information cannot be recovered',
|
||||
'passwd: password unchanged',
|
||||
]:
|
||||
self.honeypot.writeln(i)
|
||||
self.honeypot.terminal.write('Enter new UNIX password: ')
|
||||
self.honeypot.next_callback = callback_passwd1
|
||||
self.honeypot.password_input = True
|
||||
|
||||
class callback_passwd1(HoneyPotCommand):
|
||||
def call(self, args):
|
||||
self.honeypot.terminal.write('Retype new UNIX password: ')
|
||||
self.honeypot.next_callback = callback_passwd2
|
||||
|
||||
class callback_passwd2(HoneyPotCommand):
|
||||
def call(self, args):
|
||||
self.honeypot.password_input = False
|
||||
self.honeypot.writeln('Sorry, passwords do not match')
|
||||
self.honeypot.writeln(
|
||||
'passwd: Authentication information cannot be recovered')
|
||||
self.honeypot.writeln('passwd: password unchanged')
|
||||
|
||||
class command_nop(HoneyPotCommand):
|
||||
def call(self, args):
|
||||
|
||||
Reference in New Issue
Block a user