-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
312 lines (260 loc) · 9.98 KB
/
index.html
File metadata and controls
312 lines (260 loc) · 9.98 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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IP Abuse Lookup</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@100;200;300;400;500;600;700;900&display=swap" rel="stylesheet">
<style>
/* General Reset */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Poppins', Arial, sans-serif;
background-color: #f4f4f9;
color: #333;
line-height: 1.6;
padding: 20px;
}
h1 {
color: #333;
font-size: 2.5rem;
text-align: center;
margin-bottom: 20px;
}
h2 {
color: #007bff;
font-size: 1.2rem;
text-align: center;
margin-bottom: 30px;
font-weight: 500;
border-bottom: 2px solid #007bff;
padding-bottom: 10px;
}
/* Search Container */
.search-container {
display: flex;
justify-content: center;
gap: 15px;
margin-bottom: 30px;
}
input[type="text"] {
padding: 12px 15px;
border-radius: 5px;
border: 1px solid #ccc;
width: 100%;
max-width: 350px;
font-size: 1rem;
}
button {
padding: 12px 20px;
border-radius: 5px;
border: none;
background-color: #007bff;
color: #fff;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.3s;
}
button:hover {
background-color: #0056b3;
}
/* Result Section */
.result {
margin-top: 20px;
padding: 20px;
background-color: #fff;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
display: none;
}
.result p {
margin-bottom: 15px;
font-size: 1rem;
}
.result .warning {
color: red;
}
.result .moderate {
color: orange;
}
.result .good {
color: green;
}
/* Footer Styling */
.footer {
background-color: #f8f8f8;
padding: 20px;
text-align: center;
color: #555;
margin-top: 50px;
border-top: 2px solid #ddd;
}
.footer p {
margin-bottom: 10px;
font-size: 1rem;
}
.footer ul {
list-style-type: none;
padding: 0;
margin-bottom: 20px;
}
.footer li {
font-size: 1rem;
color: #007bff;
}
a {
color: #007bff;
text-decoration: none;
font-weight: bold;
transition: text-decoration 0.2s;
}
a:hover {
text-decoration: underline;
}
/* Responsive Design */
@media (max-width: 768px) {
.search-container {
flex-direction: column;
align-items: center;
}
input[type="text"] {
width: 100%;
max-width: 300px;
}
button {
width: 100%;
max-width: 300px;
}
.footer {
font-size: 0.9rem;
}
h1 {
font-size: 2rem;
}
h2 {
font-size: 1rem;
}
}
</style>
</head>
<body>
<h1>Abusive VPN Lookup</h1>
<h2>Quickly check if an IP Address belongs to a known exit node of VPN networks used for Wikipedia abuse and its current block status. Powered by <a href="https://en.wikipedia.org/wiki/User:MolecularBot" target="_blank">MolecularBot's</a> testing and analysis.</h2>
<div class="search-container">
<input type="text" id="ipInput" placeholder="Enter IP address..." />
<button onclick="lookupIP()">Lookup</button>
<button onclick="generateStatistics()">Generate Statistics</button> <!-- Added button for statistics -->
</div>
<div id="result" class="result"></div>
<div id="statistics" class="result" style="display: none;"></div> <!-- Div for statistics -->
<div class="footer">
<p><strong>Current Networks Checked by the Tool:</strong></p>
<ul>
<li><a href="https://www.vpngate.net/en/" target="_blak">VPNGate</a></li>
</ul>
<p>If you'd like to request a new network to be added, please visit <a href="https://en.wikipedia.org/wiki/User_talk:MolecularPilot" target="_blank">User talk:MolecularPilot</a>.</p>
</div>
<script>
async function lookupIP() {
const ipInput = document.getElementById('ipInput').value.trim();
const resultDiv = document.getElementById('result');
if (!ipInput) {
alert("Please enter an IP address");
return;
}
try {
const response = await fetch('https://en.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&titles=User:MolecularBot/IPData.json&rvprop=content&origin=*');
const data = await response.json();
const pages = data.query.pages;
const pageKey = Object.keys(pages)[0];
const content = pages[pageKey].revisions[0]['*'];
const jsonData = JSON.parse(content);
const ipData = jsonData.find(item => item.ip === ipInput);
const blockResponse = await fetch(`https://en.wikipedia.org/w/api.php?action=query&list=blocks&bkprop=expiry&bkip=${ipInput}&format=json&origin=*`);
const blockData = await blockResponse.json();
const isBlocked = blockData.query.blocks && blockData.query.blocks.length > 0;
const globalBlockResponse = await fetch(`https://meta.wikimedia.org/w/api.php?action=query&list=blocks&bkprop=expiry&bkip=${ipInput}&format=json&origin=*`);
const globalBlockData = await globalBlockResponse.json();
const isGlobalBlocked = globalBlockData.query.blocks && globalBlockData.query.blocks.length > 0;
const currentTime = Math.floor(Date.now() / 1000);
resultDiv.style.display = 'block';
if (ipData) {
const daysSinceSighting = Math.floor((currentTime - ipData['last-sighting']) / (60 * 60 * 24));
const sightingSeverity = ipData.sightings >= 10 ? 'warning' : ipData.sightings >= 5 ? 'moderate' : 'good';
const lastSightingSeverity = daysSinceSighting < 7 ? 'warning' : daysSinceSighting < 30 ? 'moderate' : 'good';
resultDiv.innerHTML = `
<p><strong>IP Address:</strong> ${ipData.ip}</p>
<p><strong>Status:</strong> ${ipData.type}</p>
<p class="${lastSightingSeverity}"><strong>Last Sighting:</strong> ${daysSinceSighting != 0 ? `${daysSinceSighting} day${daysSinceSighting != 1 ? "s" : ""} ago` : "Today"}</p>
<p class="${sightingSeverity}"><strong>Reported Sightings:</strong> ${ipData.sightings} time${ipData.sightings != 1 ? "s" : ""} on abusive networks</p>
<p><strong>Blocked on English Wikipedia:</strong> ${isBlocked ? 'Yes' : 'No'}</p>
<p><strong>Globally Blocked from Wikimedia:</strong> ${isGlobalBlocked ? 'Yes' : 'No'}</p>
<p><a href="https://en.wikipedia.org/wiki/Special:Contributions/${ipInput}" target="_blank">View Contributions</a></p>
`;
} else {
resultDiv.innerHTML = `<p>IP is not a known exit node of a VPN network used by Wikipedia abusers: ${ipInput} </p>`;
}
} catch (error) {
console.error('Error fetching IP data:', error);
resultDiv.style.display = 'block';
resultDiv.innerHTML = `<p>Error retrieving data. Please try again later.</p>`;
}
}
async function generateStatistics() {
try {
const response = await fetch('https://en.wikipedia.org/w/api.php?action=query&format=json&prop=revisions&titles=User:MolecularBot/IPData.json&rvprop=content&origin=*');
const data = await response.json();
const pages = data.query.pages;
const pageKey = Object.keys(pages)[0];
const content = pages[pageKey].revisions[0]['*'];
const jsonData = JSON.parse(content);
let totalIPs = jsonData.length;
let blockedOnEnwiki = 0;
let blockedOnWikimedia = 0;
const statisticsDiv = document.getElementById('statistics');
statisticsDiv.style.display = 'block';
statisticsDiv.innerHTML = `<p>Starting statistics generation...</p>`; // Initial message
for (let i = 0; i < jsonData.length; i++) {
const ipData = jsonData[i];
const blockResponse = await fetch(`https://en.wikipedia.org/w/api.php?action=query&list=blocks&bkprop=expiry&bkip=${ipData.ip}&format=json&origin=*`);
const blockData = await blockResponse.json();
const isBlocked = blockData.query.blocks && blockData.query.blocks.length > 0;
if (isBlocked) {
blockedOnEnwiki++;
}
const globalBlockResponse = await fetch(`https://meta.wikimedia.org/w/api.php?action=query&list=blocks&bkprop=expiry&bkip=${ipData.ip}&format=json&origin=*`);
const globalBlockData = await globalBlockResponse.json();
const isGlobalBlocked = globalBlockData.query.blocks && globalBlockData.query.blocks.length > 0;
if (isGlobalBlocked) {
blockedOnWikimedia++;
}
// Calculate and update the progress every iteration
const currentCount = i + 1;
const enwikiPercentage = ((blockedOnEnwiki / currentCount) * 100).toFixed(2);
const wikimediaPercentage = ((blockedOnWikimedia / currentCount) * 100).toFixed(2);
const progressPercentage = ((currentCount / totalIPs) * 100).toFixed(2);
// Update the statistics div with real-time progress
statisticsDiv.innerHTML = `
<p><strong>Progress:</strong> ${progressPercentage}% (${currentCount}/${totalIPs} IPs checked)</p>
<p><strong>Blocked on English Wikipedia:</strong> ${blockedOnEnwiki} (${enwikiPercentage}%)</p>
<p><strong>Globally Blocked on Wikimedia:</strong> ${blockedOnWikimedia} (${wikimediaPercentage}%)</p>
`;
}
// Final result after loop finishes
statisticsDiv.innerHTML += `<p><strong>Statistics generation completed!</strong></p>`;
} catch (error) {
console.error('Error generating statistics:', error);
const statisticsDiv = document.getElementById('statistics');
statisticsDiv.style.display = 'block';
statisticsDiv.innerHTML = `<p>Error generating statistics. Please try again later.</p>`;
}
}
</script>
</body>
</html>