Kyfx

Joom/Wp Python Script scan

Apr 3rd, 2015
430
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.94 KB | None | 0 0
  1. #!/usr/bin/env python2
  2. banner = """
  3. /$$$$$ /$$$ /$$ /$$
  4. |__ $$ /$$ $$ | $$ /$ | $$
  5. | $$ /$$$$$$ /$$$$$$ /$$$$$$/$$$$ | $$$ | $$ /$$$| $$ /$$$$$$
  6. | $$ /$$__ $$ /$$__ $$| $$_ $$_ $$ /$$ $$/$$ | $$/$$ $$ $$ /$$__ $$
  7. /$$ | $$| $$ \ $$| $$ \ $$| $$ \ $$ \ $$ | $$ $$_/ | $$$$_ $$$$| $$ \ $$
  8. | $$ | $$| $$ | $$| $$ | $$| $$ | $$ | $$ | $$\ $$ | $$$/ \ $$$| $$ | $$
  9. | $$$$$$/| $$$$$$/| $$$$$$/| $$ | $$ | $$ | $$$$/$$ | $$/ \ $$| $$$$$$$/
  10. \______/ \______/ \______/ |__/ |__/ |__/ \____/\_/ |__/ \__/| $$____/
  11. | $$
  12. | $$
  13. _ _
  14. | | | |
  15. ___| |__ ___ ___| | _____ _ __
  16. / __| '_ \ / _ \/ __| |/ / _ \ '__|
  17. | (__| | | | __/ (__| < __/ |
  18. \___|_| |_|\___|\___|_|\_\___|_|
  19. Coded By Matrix Coder & Psyco Miste
  20.  
  21. """
  22. import re, urllib2
  23. print banner
  24. # found this code on stackoverflow.com/questions/19278877
  25. def unique(seq):
  26. seen = set()
  27. return [seen.add(x) or x for x in seq if x not in seen]
  28.  
  29. def bing_all_grabber(s):
  30. lista = []
  31. page = 1
  32. while page <= 101:
  33. try:
  34. bing = "http://www.bing.com/search?q=ip%3A" + s + "+&count=50&first=" + str(page)
  35. openbing = urllib2.urlopen(bing)
  36. readbing = openbing.read()
  37. findwebs = re.findall('<h2><a href="(.*?)"', readbing)
  38. for i in range(len(findwebs)):
  39. allnoclean = findwebs[i]
  40. findall1 = re.findall('http://(.*?)/', allnoclean)
  41. for idx, item in enumerate(findall1):
  42. if 'www' not in item:
  43. findall1[idx] = 'http://www.' + item + '/'
  44. else:
  45. findall1[idx] = 'http://' + item + '/'
  46. lista.extend(findall1)
  47.  
  48. page += 50
  49. except urllib2.URLError:
  50. pass
  51.  
  52. final = unique(lista)
  53. return final
  54.  
  55. def check_wordpress(sites) :
  56. wp = []
  57. for site in sites :
  58. try :
  59. if urllib2.urlopen(site+'wp-login.php').getcode() == 200 :
  60. wp.append(site)
  61. except :
  62. pass
  63.  
  64. return wp
  65. def check_joomla(sites) :
  66. joomla = []
  67. for site in sites :
  68. try :
  69. if urllib2.urlopen(site+'administrator').getcode() == 200 :
  70. joomla.append(site)
  71. except :
  72. pass
  73.  
  74. return joomla
  75.  
  76. ip = raw_input('Enter IP >>> ')
  77. sites = bing_all_grabber(str(ip))
  78. wordpress = check_wordpress(sites)
  79. joomla = check_joomla(sites)
  80. for ss in wordpress :
  81. print ss
  82. print '[*] Found, ', len(wordpress), ' wordpress sites.'
  83. print '-'*30+'\n'
  84. for ss in joomla :
  85. print ss
  86.  
  87.  
  88. print '[*] Found, ', len(joomla), ' joomla sites.'
  89.  
  90. print '\n'
Add Comment
Please, Sign In to add comment