Example #1
0
 def msg_userauth_passwd_changereq(self, packet, username, service_name):
     # User's password has expired.  Allow the user to enter a new password.
     msg, prompt, language = unpack_payload(
         PAYLOAD_MSG_USERAUTH_PASSWD_CHANGEREQ, packet)
     print safe_string(prompt)
     old_password = self.get_password('%s\'s old password> ' % username)
     while 1:
         new_password = self.get_password('%s\'s new password> ' % username)
         new_password2 = self.get_password('Retype new password> ')
         if new_password != new_password2:
             print 'Passwords did not match!  Try again.'
         else:
             break
     packet = pack_payload(
         PAYLOAD_MSG_USERAUTH_REQUEST_CHANGE_PASSWD,
         (SSH_MSG_USERAUTH_REQUEST, username, service_name, 'password', 1,
          old_password, new_password))
     self.transport.send_packet(packet)
Example #2
0
 def msg_userauth_passwd_changereq(self, packet, username, service_name):
     # User's password has expired.  Allow the user to enter a new password.
     msg, prompt, language = unpack_payload(PAYLOAD_MSG_USERAUTH_PASSWD_CHANGEREQ, packet)
     print safe_string(prompt)
     old_password = self.get_password('%s\'s old password> ' % username)
     while 1:
         new_password = self.get_password('%s\'s new password> ' % username)
         new_password2 = self.get_password('Retype new password> ')
         if new_password != new_password2:
             print 'Passwords did not match!  Try again.'
         else:
             break
     packet = pack_payload(PAYLOAD_MSG_USERAUTH_REQUEST_CHANGE_PASSWD,
                           (SSH_MSG_USERAUTH_REQUEST,
                            username,
                            service_name,
                            'password',
                            1,
                            old_password,
                            new_password))
     self.transport.send_packet(packet)
Example #3
0
 def msg_userauth_banner(self, packet):
     msg, message, language = unpack_payload(PAYLOAD_MSG_USERAUTH_BANNER, packet)
     print safe_string(message)
Example #4
0
 def msg_userauth_banner(self, packet):
     msg, message, language = unpack_payload(PAYLOAD_MSG_USERAUTH_BANNER,
                                             packet)
     print safe_string(message)