Skip to content

Instantly share code, notes, and snippets.

@mnuddindev
Last active November 21, 2019 12:42
Show Gist options
  • Select an option

  • Save mnuddindev/c845c805eb3519e3ac75deff8f481337 to your computer and use it in GitHub Desktop.

Select an option

Save mnuddindev/c845c805eb3519e3ac75deff8f481337 to your computer and use it in GitHub Desktop.
import requests as r
import os
scl = open("scannedList.txt", "a+")
sl = open("list.txt").read().split("\n")
class tcolor:
yellow = '\33[33m'
red = '\33[31m'
green = '\33[32m'
def cmsdetector(host):
print (tcolor.yellow+'[ START ]'+tcolor.green+"Script Started Succesfully")
try:
test_response = r.get(host+'/').text
print (tcolor.yellow+"[ DOING ] "+tcolor.green+"Scanning For Wordpress Site")
except requests.exceptions.HTTPError:
scl.write(host+'#ConnectionError\n')
print (tcolor.yellow+"[ ERROR ] "+tcolor.red+"Connection Error")
pass
except requests.exceptions.ConnectionError:
scl.write(host+'#ConnectionError\n')
print(tcolor.yellow+"[ ERROR ] "+tcolor.red+"Connection Error")
pass
else:
if ('wp-content' in test_response):
print (tcolor.green+"[ OK ] It is a Wordpress Site")
scl.write(host+'#WPSite\n')
print(tcolor.green+"WP ====> "+host)
else:
print(tcolor.yellow+'[ NO ] '+tcolor.red+'It is not a WP site checking For others Cms')
print(tcolor.red+host)
try:
test_response = r.get(host+'/administrator/index.php').text
print(tcolor.yellow+"[ DOING ] "+tcolor.green+"Checking For Joomla Site")
except requests.exceptions.HTTPError:
scl.write(host+'#ConnectionError\n')
print (tcolor.yellow+"[ ERROR ] "+tcolor.red+"Connection Error")
pass
except requests.exceptions.ConnectionError:
scl.write(host+'#ConnectionError\n')
print(tcolor.yellow+"[ ERROR ] "+tcolor.red+"Connection Error")
pass
else:
if ('You are not authorized to access this page' in test_response) or ('Joomla is free software released under the GNU General Public License' in test_response):
print(tcolor.yellow+"[ OK ] "+tcolor.green+"It is a Joomla Site")
scl.write(host+'#JoomlaSite\n')
print(tcolor.green+"JOOMLA ====> "+host)
else:
print(tcolor.yellow+"[ NO ] "+tcolor.red+"It is not a Joomla Site Checking For Othe CMS")
print(tcolor.red+host)
try:
test_response = r.get(host+'/admin').text
print(tcolor.yellow+"[ DOING ] "+tcolor.green+"Checking For Drupal Site")
except requests.exceptions.HTTPError:
scl.write(host+'#ConnectionError\n')
print (tcolor.yellow+"[ ERROR ] "+tcolor.red+"Connection Error")
pass
except requests.exceptions.ConnectionError:
scl.write(host+'#ConnectionError\n')
print(tcolor.yellow+"[ ERROR ] "+tcolor.red+"Connection Error")
pass
else:
if ('You are not authorized to access this page' in test_response) or ('drupal' in test_response):
scl.write(host+'#DrupalSite\n')
print(tcolor.yellow+"[ OK ] "+tcolor.green+"It is a Drupal Site")
print(tcolor.green+"DRUPAL ====> "+host)
else:
print(tcolor.red+"[ UNKNOWN ] CMS not Found")
scl.write(host+'#Unknown\n')
print(tcolor.red+host)
def banner():
os.system("clear")
print(tcolor.green+"###########################################################")
print(tcolor.green+"# Tool: Cms Detector #")
print(tcolor.green+"# Author: Inad Islam #")
print(tcolor.green+"# A Mass Cms Detector Written with PYTHON #")
print(tcolor.green+"###########################################################")
def mass():
banner()
for sites in sl:
if (sites == ''):
continue
cmsdetector(sites)
mass()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment