-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathindex.html
157 lines (135 loc) · 5.19 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>WordPress Scanner</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f1f1f1;
color: #333;
}
h1 {
color: #4CAF50;
}
label {
font-weight: bold;
}
input[type="text"] {
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
}
button {
padding: 10px 20px;
background-color: #4CAF50;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
button:hover {
background-color: #45a049;
}
pre {
padding: 10px;
margin-top: 10px;
background-color: #fff;
border: 1px solid #ccc;
border-radius: 4px;
white-space: pre-wrap;
}
p.message {
color: #888;
font-size: 14px;
text-align: center;
margin-top: 20px;
}
</style>
</head>
<body>
<h1>WordPress Scanner</h1>
<label for="website-url">Website URL (with https://):</label>
<input type="text" id="website-url" required>
<button onclick="scanWordPress()">Scan</button>
<pre id="output"></pre>
<p class="message">
Check the Python code to use the full version of the WordPress Scanner.
</p>
<script>
function scanWordPress() {
const websiteUrl = document.getElementById("website-url").value;
const outputElement = document.getElementById("output");
outputElement.innerHTML = "Scanning...";
const url = websiteUrl + "/wp-json";
const headers = { "user-agent": navigator.userAgent };
fetch(url, { headers })
.then((response) => response.json())
.then((data) => {
const siteName = data.name;
const siteDesc = data.description;
const plugins = [...new Set(data.namespaces.map((plugin) => plugin.split("/")[0]))];
let wpVersion = "Not Found!";
const metatags = document.getElementsByTagName("meta");
for (const tag of metatags) {
console.log(tag)
if (tag.getAttribute("name") === "generator" && tag.getAttribute("content").includes("WordPress")) {
wpVersion = tag.getAttribute("content").replace("WordPress ", "");
break;
}
}
outputElement.innerHTML = `
Website status: Up
WordPress Detection: Yes
WordPress version: ${wpVersion}
Website name: ${siteName}
Website description: ${siteDesc}
Enumerating Plugins: ${plugins.join(", ")}
`;
adminPanelFinder(websiteUrl, outputElement);
userFinder(websiteUrl, outputElement);
})
.catch((error) => {
outputElement.innerHTML = "Website status: Error!";
});
}
function adminPanelFinder(websiteUrl, outputElement) {
const urlA = websiteUrl + "/wp-login.php?action=lostpassword&error=invalidkey";
const headers = { "user-agent": navigator.userAgent };
fetch(urlA, { headers })
.then((response) => response.text())
.then((data) => {
const pagesoup = new DOMParser().parseFromString(data, "text/html");
const ptag = pagesoup.querySelectorAll("p#nav a");
if (ptag.length > 0) {
for (const atag of ptag) {
if (atag.textContent.includes("Log in")) {
const adminUrl = atag.href;
outputElement.innerHTML += `\nAdmin panel found - ${adminUrl}`;
return;
}
}
}
outputElement.innerHTML += "\nAdmin panel not found";
})
.catch((error) => {});
}
function userFinder(websiteUrl, outputElement) {
const url = websiteUrl + "/wp-json/wp/v2/users";
const headers = { "user-agent": navigator.userAgent };
fetch(url, { headers })
.then((response) => response.json())
.then((data) => {
outputElement.innerHTML += "\n\nEnumerating usernames:";
data.forEach((info) => {
outputElement.innerHTML += `\n[*] Username Found: ${info.slug}`;
});
})
.catch((error) => {
outputElement.innerHTML += "\n\nUsernames Not Found";
});
}
</script>
</body>
</html>