ToKeiChun

Laravel Framework and Wordpress CMS Detector

Sep 10th, 2020 (edited)
287
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.40 KB | None | 0 0
  1. # -*- coding: utf-8 -*
  2. #!/usr/bin/python
  3. #####################################
  4. ##KILL THE NET##
  5. #### PS: CHANGE Your Threads pool on line 91 to make script more faster :)
  6. ##############[LIBS]###################
  7. import requests, re, urllib2, os, sys, codecs, random              
  8. from multiprocessing.dummy import Pool                         
  9. from time import time as timer 
  10. import time                    
  11. from platform import system
  12. from colorama import Fore                              
  13. from colorama import Style                             
  14. from pprint import pprint                              
  15. from colorama import init
  16. from urlparse import urlparse
  17. import warnings
  18. import subprocess
  19. from requests.packages.urllib3.exceptions import InsecureRequestWarning
  20. warnings.simplefilter('ignore',InsecureRequestWarning)
  21. reload(sys)  
  22. sys.setdefaultencoding('utf8')
  23. init(autoreset=True)
  24. ##########################################################################################
  25. merah = '\033[31m'
  26. kuning = '\033[33m'
  27. hijau = '\033[32m'
  28. cyan = '\033[36m'
  29. CEND = '\033[0m'       
  30. #########################################################################################
  31. try:
  32.     with codecs.open(sys.argv[1], mode='r', encoding='ascii', errors='ignore') as f:
  33.         ooo = f.read().splitlines()
  34. except IndexError:
  35.     print (cyan + 'Perintah : python '+sys.argv[0]+' domainlist.txt' + CEND)
  36.     pass
  37. ooo = list((ooo))
  38. ##########################################################################################
  39. se = requests.session()
  40. Agent = {'User-Agent': 'Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:28.0) Gecko/20100101 Firefox/28.0'}
  41.  
  42. def laravel(url):
  43.     try:
  44.         path1 = se.get(url, headers=Agent, verify=False, allow_redirects=True, timeout=50)
  45.         path2 = se.get(url + '/vendor/composer/installed.json', headers=Agent, verify=False, timeout=50)
  46.         if path1.status_code == 200:
  47.             if '_session=' in path1.headers['Set-Cookie']:
  48.                 print(hijau + '#[-LARAVEL CMS-]=========> ' + '(' + url + ')' + CEND)
  49.                 open('result/laravel.txt', 'a').write(url + '\n')
  50.         elif path2.status_code == 200:
  51.             if 'https://packagist.org/downloads/' in path2.content.encode('utf-8'):
  52.                 print(hijau + '#[+LARAVEL CMS+]=========> ' + '(' + url + ')' + CEND)
  53.                 open('result/laravel.txt', 'a').write(url + '\n')
  54.         else:
  55.             pass
  56.  
  57.     except:
  58.         pass
  59.     pass
  60. def wordpress(url):
  61.     try:
  62.         path4 = se.get(url + '/wp-includes/js/tw-sack.js', headers=Agent, verify=False, timeout=50)
  63.         if path4.status_code == 200:
  64.             if 'Msxml2.XMLHTTP' in path4.content.encode('utf-8'):
  65.                 print(kuning + '#[-WORDPRESS CMS-]=========> ' + '(' + url + ')' + CEND)
  66.                 open('result/wordpress.txt', 'a').write(url + '\n')
  67.         else:
  68.             pass
  69.         pass
  70.     except:
  71.         pass
  72.     pass
  73. def checkrpns(url):
  74.     try:
  75.         kill1 = se.get(url, headers=Agent, verify=False, timeout=50)
  76.         if kill1.status_code == 200:
  77.             wordpress(url)
  78.             laravel(url)
  79.             pass
  80.         else:
  81.             print(merah + '#[-DEAD SITE-]=========> ' + '(' + url + ')' + CEND)
  82.         pass
  83.     except:
  84.         pass
  85.     pass
  86.  
  87. ##########################################################################################
  88. def Main():
  89.     try:
  90.         ThreadPool = Pool(25)
  91.         Threads = ThreadPool.map(checkrpns, ooo)
  92.         print('Job done.')
  93.     except:
  94.         pass
  95. if __name__ == '__main__':
  96.     Main()
Add Comment
Please, Sign In to add comment