Implement command input

git-svn-id: https://kippo.googlecode.com/svn/trunk@15 951d7100-d841-11de-b865-b3884708a8e2
This commit is contained in:
desaster
2009-11-17 07:08:16 +00:00
parent 342c95941e
commit e00b0c3c59
3 changed files with 59 additions and 25 deletions

View File

@@ -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):