-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcmsdetector.py
More file actions
186 lines (169 loc) Β· 5.6 KB
/
Copy pathcmsdetector.py
File metadata and controls
186 lines (169 loc) Β· 5.6 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/usr/bin/python3
# -*- coding: utf-8 -*-
import requests
import re
from urllib.parse import urlparse
import sys
from colorama import init, Fore, Style
init(autoreset=True)
#############################################################################################
### CMS Detector
#############################################################################################
# ==================== CMS SIGNATURES ====================
CMS_SIGNATURES = {
"WordPress": [
r'/wp-content/', r'/wp-includes/', r'wp-.*\.php',
r'meta name="generator" content="WordPress',
r'content="WordPress'
],
"Joomla": [
r'/administrator/', r'/components/com_',
r'meta name="generator" content="Joomla!',
r'Joomla!'
],
"Drupal": [
r'/sites/default/files/', r'Drupal.settings',
r'meta name="Generator" content="Drupal',
r'Drupal'
],
"Shopify": [
r'cdn.shopify.com', r'Shopify.theme',
r'checkout.shopify.com'
],
"Magento": [
r'/skin/frontend/', r'/js/mage/',
r'meta name="generator" content="Magento'
],
"PrestaShop": [
r'/img/.*prestashop', r'PrestaShop',
r'meta name="generator" content="PrestaShop'
],
"Wix": [
r'wix.com', r'Wix.com'
],
"Squarespace": [
r'squarespace.com', r'Squarespace'
],
"Ghost": [
r'ghost-platform', r'Ghost'
],
"Blogger": [
r'blogspot.com', r'blogger'
],
"Webflow": [
r'webflow.com', r'data-wf-', r'cdn.prod.website-files.com',
r'meta content="Webflow" name="generator',
r'<!-- This site was created in Webflow'
],
"Weebly": [
r'weebly.com', r'weebly-site.com',
r'meta name="generator" content="Weebly'
],
"TYPO3": [
r'typo3', r'/typo3temp/', r'/typo3conf/',
r'TYPO3', r'meta name="generator" content="TYPO3'
],
"Bitrix": [
r'bitrix', r'/bitrix/', r'BX_',
r'Bitrix', r'meta name="generator" content="Bitrix'
],
"OpenCart": [
r'opencart', r'/catalog/view/theme/', r'OpenCart'
],
"BigCommerce": [
r'bigcommerce.com', r'static.bigcommerce.com',
r'BigCommerce'
],
"WooCommerce": [
r'woocommerce', r'/wp-content/plugins/woocommerce/'
],
"Craft_CMS": [
r'craftcms', r'Craft CMS', r'data-craft'
],
"Umbraco": [
r'umbraco', r'/umbraco/', r'Umbraco'
],
"Concrete_CMS": [
r'concrete', r'concrete5', r'Concrete CMS'
],
"HubSpot": [
r'hubspot', r'hs-scripts.com', r'HubSpot'
],
"GoDaddy": [
r'godaddysites.com', r'GoDaddy'
],
"Duda": [
r'duda.co', r'Duda'
],
"Tilda": [
r'tilda.ws', r'Tilda'
],
"Strapi": [
r'strapi', r'Strapi'
],
"Contentful": [
r'contentful', r'Contentful'
],
"Sanity": [
r'sanity.io', r'Sanity'
],
"Sitecore": [
r'sitecore', r'Sitecore'
],
"Kentico": [r'kentico', r'Kentico'],
"Magnolia": [r'magnolia', r'Magnolia CMS'],
"Liferay": [r'liferay', r'Liferay'],
"Alfresco": [r'alfresco', r'Alfresco'],
"Backbone": [r'backbone', r'Backbone.js'],
}
def get_domain(url):
if not url.startswith(('http://', 'https://')):
url = 'https://' + url
return url
def detect_cms(url):
try:
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 '
'(KHTML, like Gecko) Chrome/128.0 Safari/537.36'
}
response = requests.get(url, headers=headers, timeout=15, allow_redirects=True)
content = response.text.lower()
final_url = response.url
print(Fore.CYAN + f"\nπ Analyzing: {final_url}")
print(Fore.CYAN + f"Status Code: {response.status_code}\n")
detected = []
for cms, signatures in CMS_SIGNATURES.items():
for sig in signatures:
if re.search(sig.lower(), content):
detected.append(cms)
break
if 'wordpress' in content or '/wp-' in content:
detected.append("WordPress")
if 'wp-content' in content:
detected.append("WordPress")
detected = list(dict.fromkeys(detected))
if detected:
print(Fore.GREEN + f"β
CMS Detected: {', '.join(detected)}")
return detected[0]
else:
print(Fore.YELLOW + "β οΈ Could not detect CMS (Unknown or custom)")
return "Unknown"
except requests.exceptions.RequestException as e:
print(Fore.RED + f"β Connection Error: {e}")
return None
except Exception as e:
print(Fore.RED + f"β Error: {e}")
return None
# ===================== MAIN =====================
if __name__ == "__main__":
print(Fore.MAGENTA + Style.BRIGHT + """
ββββββββββββββββββββββββββββββββββββββββββββββββ
β CMS Detector v1.0 β
β Powered by SourceCode347 β
ββββββββββββββββββββββββββββββββββββββββββββββββ
""")
if len(sys.argv) > 1:
target = sys.argv[1]
else:
target = input(Fore.WHITE + "π Enter website URL: ").strip()
detect_cms(get_domain(target))