-
Notifications
You must be signed in to change notification settings - Fork 0
/
cms-riper.py
82 lines (70 loc) · 2.84 KB
/
cms-riper.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import requests
import os
from config_file import ConfigFile
import optparse
import time
config = ConfigFile("apis.ini")
API_KEY = config.get('api_per_line.api_key', parse_types=True)
'''
Hamza Elansari && Salah Ddin HK-GANG
'''
__banner__ = """
+=======================================+
|.........CMS RIPER PROJECT v 1 ........|
+---------------------------------------+
|#Author: Hamza07-w - salahddin |
|#Contact: Instagram @hamza07.py |
| hamzaelansari453@gmail.com |
|#Date: Aug 28 19:20:49 2021 |
|#This tool is made for pentesting. |
|#I take no responsibilities for the |
| use of this program ! |
+=======================================+
|.........CMS RIPER PROJECT v 1.........|
+---------------------------------------+
"""
print(__banner__)
def getArg():
parser = optparse.OptionParser()
parser.add_option("-u", "--url", dest="url", help="Website Target Url/ http://example.com")
(options, arg) = parser.parse_args()
return options
def getCMSResults(url,verbose=False):
try:
res=requests.get(f"https://whatcms.org/API/Tech?key={API_KEY}&url={url}")
except requests.exceptions.ConnectionError:
print("Unable To Connect To the Internet.")
exit(1)
if res.status_code==200:
if res.json()["result"]["code"]==101:
print("INVALID API KEY!.")
exit(1)
if res.json()["result"]["code"]==120:
tts=float(res.json()["retry_in_seconds"])
if verbose:
print(f"Maxium API Request Reached. Trying Again in {tts} seconds. ")
time.sleep(tts)
return getCMSResults(url,verbose)
if verbose:
print(res.text)
cms=None
infos = res.json()["results"]
print(f"-------{url} Technologie Informations-------\n")
try:
print(f"CMS : {infos[0]['name']} Version {infos[0]['version']}")
print(f"Programming Lang : {infos[1]['name']}")
print(f"Databases : {infos[2]['name']}")
print(f"Web Server : {infos[3]['name']}")
except:
print(f"CMS : {infos[1]['name']} Version {infos[1]['version']}")
print(f"Programming Lang : {infos[2]['name']}")
print(f"Databases : {infos[3]['name']}")
print(f"Web Server : {infos[4]['name']}")
if len(res.json()["meta"]) >0:
sinfos = res.json()["meta"]["social"]
print(f"\n-------{url} Social Media Informations-------\n")
for i in range(len(sinfos)):
print(f"{sinfos[i]['network']} ==> {sinfos[i]['url']}")
options = getArg()
input_file = options.url
getCMSResults(input_file)