-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
602 lines (501 loc) · 21.3 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
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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" type="image/svg+xml" href="static/icon.png">
<title>Fingerprinter Dashboard</title>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<!-- Custom Styles -->
<style>
body {
background-color: #121212;
color: #ffd700;
font-family: 'Consolas', monospace;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
min-height: 100vh;
transition: background-color 0.3s, color 0.3s;
}
.loader-container {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
margin-top: 20px;
background-color: #121212;
opacity: 1;
transition: opacity 1s;
}
.progress {
width: 50%;
margin: 20px 0;
border: 1px solid #ffd700;
}
.progress-bar {
background-color: #ffd700;
height: 100%;
transition: width 1s;
}
.dashboard {
display: none;
flex-wrap: wrap;
justify-content: center;
opacity: 0;
transition: opacity 1s;
}
.dashboard-card {
width: 300px;
margin: 20px;
}
.unique-id {
margin: 20px 0;
max-width: 300px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
position: relative;
}
.unique-id::before {
content: '';
position: absolute;
left: 0;
right: 100%;
bottom: 0;
height: 2px;
background-color: transparent;
transition: right 0.3s, background-color 0.3s;
}
.unique-id:hover::before {
right: 0;
background-color: #ffd700;
}
.unique-id-content {
color: #fff;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
transition: color 0.3s;
}
.unique-id:hover {
transform: scale(1.05);
}
.unique-id-label {
color: #ffd700;
font-weight: bold;
margin-bottom: 5px;
transition: color 0.3s;
}
.app-title {
font-size: 2em;
margin-bottom: 20px;
color: #ffd700;
cursor: pointer;
transition: color 0.3s;
text-align: center;
}
.app-title:hover {
color: #54c1e6;
}
#ghostDeviceInfoContainer {
max-height: 250px;
overflow-y: auto;
margin: 10px;
padding: 10px;
background-color: #212121;
border: 1px solid #ffd700;
border-radius: 5px;
color: #ffd700;
width: 350px;
position: relative;
}
#ipDataContainer {
width: auto;
max-width: 100%;
background-color: #212121;
padding: 10px;
border: 1px solid #ffd700;
border-radius: 5px;
color: #ffd700;
}
#ghostDeviceInfoContainer::-webkit-scrollbar,
#ipDataContainer::-webkit-scrollbar {
width: 8px;
}
#ghostDeviceInfoContainer::-webkit-scrollbar-thumb,
#ipDataContainer::-webkit-scrollbar-thumb {
background-color: #ffd700;
border-radius: 4px;
}
#ghostDeviceInfoContainer .copy-button {
background-color: #ffd700;
color: #212121;
padding: 5px 10px;
border: none;
border-radius: 3px;
cursor: pointer;
font-size: 0.8em;
transition: background-color 0.3s, color 0.3s;
}
#ghostDeviceInfoContainer .copy-button:hover {
background-color: #54c1e6;
color: #212121;
}
.copy-button-container {
position: absolute;
top: 0;
right: 0;
margin-top: 10px;
margin-right: 10px;
}
#ghostDeviceInfoContainer::-webkit-scrollbar,
#ipDataContainer::-webkit-scrollbar {
width: 8px;
}
#ghostDeviceInfoContainer::-webkit-scrollbar-thumb,
#ipDataContainer::-webkit-scrollbar-thumb {
background-color: #ffd700;
border-radius: 4px;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.alert-success {
background-color: #54c1e6;
color: #fff;
}
.alert-danger {
background-color: #dc3545;
color: #fff;
}
.project-info {
max-width: 600px;
text-align: center;
font-size: 1.2em;
line-height: 1.5;
color: #ffd700;
margin-bottom: 20px;
}
.comparison-info {
max-width: 600px;
text-align: center;
font-size: 0.8em;
line-height: 1.5;
color: white;
margin: 20px auto;
padding: 10px;
border: 2px solid #ffd700;
border-radius: 5px;
overflow: hidden;
position: relative;
}
.comparison-info h6 {
color: #ffd700;
}
</style>
<!-- Google Fonts -->
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto&display=swap">
</head>
<body>
<!-- App Title -->
<div class="app-title">
<img src="static/icon.png" class="icon" alt="Fingerprinter Icon" style="width: 50%; max-width: 50px; height: auto;">
FINGERPRINTER
</div>
<!-- Project Information -->
<div class="project-info">
<h5>Understand and protect your online identity against various tracking techniques.</h5>
<p>This interactive dashboard presents a variety of identifiers created through different methods, offering detailed insights into your browser's unique digital profile.</p>
</div>
<!-- Browser Fingerprint Comparison Instructions -->
<div class="comparison-info">
<h6>Compare Fingerprints</h6>
<p>Evaluate your browser's privacy level by checking if the identifier changes each time you open the browser, after clearing data, or in incognito mode.
If you consistently get a unique identifier each time (🟢), it's a positive indicator for privacy. However, if the identifier remains constant (🔴), it's a potential risk to your privacy, making you more easily trackable.</p>
</div>
<!-- Loader -->
<div class="loader-container">
<div class="progress">
<div class="progress-bar progress-bar-striped progress-bar-animated bg-warning" role="progressbar"
style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<!-- Display Unique IDs -->
<div class="dashboard">
<!-- Unique IDs -->
<div class="dashboard-card">
<div class="unique-id">
<label for="thumbmarkFingerprint" class="unique-id-label">ThumbmarkJS unique ID:</label>
<p id="thumbmarkFingerprint" class="unique-id-content">Loading...</p>
</div>
<div class="unique-id">
<label for="fingerprintJSVisitorId" class="unique-id-label">FingerprintJS unique ID:</label>
<p id="fingerprintJSVisitorId" class="unique-id-content">Loading...</p>
</div>
<div class="unique-id">
<label for="clientJSFingerprint" class="unique-id-label">ClientJS unique ID:</label>
<p id="clientJSFingerprint" class="unique-id-content">Loading...</p>
</div>
<div class="unique-id">
<label for="imprintFingerprint" class="unique-id-label">ImprintJS unique ID:</label>
<p id="imprintFingerprint" class="unique-id-content">Loading...</p>
</div>
<div class="unique-id">
<label for="detectIncognitoJSFingerprint" class="unique-id-label">detectIncognitoJS:</label>
<p id="detectIncognitoJSFingerprint" class="unique-id-content">Loading...</p>
</div>
<div class="unique-id">
<label for="opfsFingerprint" class="unique-id-label">OPFSJS unique ID:</label>
<p id="opfsFingerprint" class="unique-id-content">Loading...</p>
</div>
<div class="unique-id">
<label for="canvasFingerprint" class="unique-id-label">CanvasPrintJS unique ID:</label>
<p id="canvasFingerprint" class="unique-id-content">Loading...</p>
</div>
</div>
<!-- IP Data Container -->
<div class="dashboard-card">
<div id="ipDataContainer" class="unique-id">
<label for="ipData" class="unique-id-label">IP Data:</label>
<p id="ipData" class="unique-id-content">Loading...</p>
</div>
</div>
<!-- Notification Bar -->
<div id="notification" class="position-fixed bottom-0 end-0 p-3" style="z-index: 5">
<!-- Notification will be dynamically added here -->
</div>
<!-- GhostDevice Information -->
<div class="dashboard-card">
<div id="ghostDeviceInfoContainer" class="unique-id">
<label for="ghostDeviceInfo" class="unique-id-label">GhostDevice Information:</label>
<p id="ghostDeviceInfo" class="unique-id-content">Loading...</p>
<!-- Move the Copy Button Container inside the ghostDeviceInfoContainer -->
<div class="copy-button-container">
<button class="copy-button" onclick="copyToClipboard()">Copy</button>
</div>
</div>
</div>
</div>
<!-- Scripts -->
<script>
// Simulate loading delay for the loader
setTimeout(() => {
// The loader will be hidden when all fingerprinting methods are complete
document.querySelector('.loader-container').style.opacity = '0';
setTimeout(() => {
document.querySelector('.loader-container').style.display = 'none';
document.querySelector('.dashboard').style.display = 'flex';
document.querySelector('.dashboard').style.opacity = '1';
}, 500); // Delay for smoother transition
}, 3000); // Simulated delay of 3 seconds
// Simulate progress bar increment
let progress = 0;
const progressBar = document.querySelector('.progress-bar');
const intervalId = setInterval(() => {
progress += 20;
progressBar.style.width = `${progress}%`;
if (progress >= 100) {
clearInterval(intervalId);
}
}, 500); // Adjust the interval (in milliseconds) as needed
// Number of fingerprinting methods
const totalMethods = 7; // Update this if you add or remove methods
// Counter for completed methods
let completedMethods = 0;
</script>
<!-- Your JavaScript for Fingerprinting Methods -->
<script src="static/Thumbmark.js"></script>
<script src="static/client.min.js"></script>
<script src="static/imprint.min.js"></script>
<script src="static/detectIncognito.min.js"></script>
<script src="static/opfs.min.js"></script>
<script src="static/canvasprint.js"></script>
<script src="static/ghostip.js"></script>
<script src="static/ghostdevice.js"></script>
<!-- Load the locally hosted FingerprintJS library -->
<script>
(async () => {
try {
const FingerprintJS = await import('./static/fingerprintjsv4.js');
const fp = await FingerprintJS.load();
// Get the visitor identifier when you need it.
const result = await fp.get();
const visitorId = result.visitorId;
// Update the element only if it exists
const visitorIdDisplay = document.getElementById('fingerprintJSVisitorId');
if (visitorIdDisplay) {
visitorIdDisplay.innerText = visitorId || 'Not available';
}
updateProgressBar();
} catch (error) {
console.error('Fingerprinting error:', error);
updateProgressBar();
}
})();
</script>
<script>
// ThumbmarkJS Fingerprint
ThumbmarkJS.getFingerprint().then(function (fp) {
document.getElementById('thumbmarkFingerprint').innerText = fp || 'Not available';
updateProgressBar();
}).catch(handleError);
// ClientJS Device/Browser Fingerprint
var client = new ClientJS();
var clientFingerprint = client.getFingerprint();
document.getElementById('clientJSFingerprint').innerText = clientFingerprint || 'Not available';
updateProgressBar();
// ImprintJS Fingerprint
var browserTests = [
"availableScreenResolution", "canvas", "colorDepth", "cookies", "cpuClass", "deviceDpi", "doNotTrack",
"indexedDb", "installedFonts", "language", "localStorage", "pixelRatio", "platform", "plugins",
"processorCores", "screenResolution", "sessionStorage", "timezoneOffset", "touchSupport", "userAgent"
];
imprint.test(browserTests).then(function (result) {
document.getElementById('imprintFingerprint').innerText = result || 'Not available';
updateProgressBar();
}).catch(handleError);
// detectIncognitoJS Device/Browser Fingerprint
detectIncognito().then((result) => {
document.getElementById('detectIncognitoJSFingerprint').innerText =
(result.browserName || 'Not available') + ', ' + (result.isPrivate || 'Not available');
updateProgressBar();
}).catch(handleError);
// OPFS Fingerprint
fingerprint().then((result) => {
document.getElementById('opfsFingerprint').innerText = JSON.stringify(result.fingerprints.persistentFp) || 'Not available';
updateProgressBar();
}).catch(handleError);
// Canvas Fingerprint
var canvasprint = new Canvasprint().get();
document.getElementById('canvasFingerprint').innerText = canvasprint || 'Not available';
updateProgressBar();
// ghostip IP Data
ghostip.getIPData().then(ipData => {
const ipDataElement = document.getElementById('ipData');
if (ipData && ipData.ip) {
// Format IP data for display
const formattedData = `
<strong>IP:</strong> ${ipData.ip}<br>
<strong>Country:</strong> ${ipData.country || 'Not available'}<br>
<strong>Region:</strong> ${ipData.region || 'Not available'}<br>
<strong>City:</strong> ${ipData.city || 'Not available'}
`;
ipDataElement.innerHTML = formattedData;
} else {
ipDataElement.innerText = 'IP Data Not available';
}
updateProgressBar();
}).catch(handleError);
// ghostdevice Information
ghostDeviceInfo.getDeviceInfo().then(deviceInfo => {
const ghostDeviceInfoElement = document.getElementById('ghostDeviceInfo');
if (deviceInfo && Object.keys(deviceInfo).length > 0) {
ghostDeviceInfoElement.innerText = JSON.stringify(deviceInfo, null, 2);
} else {
ghostDeviceInfoElement.innerText = 'Not available';
}
updateProgressBar();
}).catch(() => {
const ghostDeviceInfoElement = document.getElementById('ghostDeviceInfo');
ghostDeviceInfoElement.innerText = 'Not available';
updateProgressBar();
});
function showNotification(message, type = 'success') {
const notificationContainer = document.getElementById('notification');
// Clear existing notifications
notificationContainer.innerHTML = '';
// Map notification types to Bootstrap alert classes
const alertClasses = {
'success': 'alert-success',
'error': 'alert-danger'
};
// Create alert element
const alertElement = document.createElement('div');
alertElement.classList.add('alert', alertClasses[type], 'alert', 'fade', 'show');
alertElement.innerHTML = `
<strong>${type === 'success' ? 'Success!' : 'Error!'}</strong> ${message}
`;
// Append alert to container
notificationContainer.appendChild(alertElement);
// Automatically close the notification after 5 seconds (adjust as needed)
setTimeout(() => {
alertElement.classList.remove('show');
alertElement.classList.add('hide');
}, 3000);
// If it's an error notification, you might want to log it to the console as well
if (type === 'error') {
console.error(message);
}
}
function copyToClipboard() {
const ghostDeviceInfoElement = document.getElementById('ghostDeviceInfo');
const tempTextArea = document.createElement('textarea');
// Use innerText instead of value to preserve formatting
tempTextArea.innerText = ghostDeviceInfoElement.innerText;
document.body.appendChild(tempTextArea);
tempTextArea.select();
try {
// Use execCommand only for desktop browsers
const successful = document.execCommand('copy');
const message = successful ? 'Copied to clipboard!' : 'Copy to clipboard failed';
showNotification(message, successful ? 'success' : 'danger');
} catch (err) {
console.error('Unable to copy to clipboard', err);
} finally {
document.body.removeChild(tempTextArea);
}
}
function handleError(error) {
console.error('An error occurred:', error);
updateProgressBar();
}
function containsNotAvailable(element) {
return element.innerText.trim().toLowerCase() === 'not available';
}
function updateProgressBar() {
// Increment the completed methods counter
completedMethods++;
// Check if all methods are completed
if (completedMethods === totalMethods) {
// Hide the loader after a delay for smoother transition
setTimeout(() => {
document.querySelector('.loader-container').style.opacity = '0';
setTimeout(() => {
document.querySelector('.loader-container').style.display = 'none';
document.querySelector('.dashboard').style.display = 'flex';
document.querySelector('.dashboard').style.opacity = '1';
}, 500); // Delay for smoother transition
}, 500);
}
// Update the progress bar width
const progress = (completedMethods / totalMethods) * 100;
document.querySelector('.progress-bar').style.width = `${progress}%`;
// Check for errors
const errorElements = document.querySelectorAll('.unique-id-content');
let hasErrors = false;
Array.from(errorElements).forEach((element) => {
if (element.innerText.trim().toLowerCase() === 'error') {
hasErrors = true;
}
});
if (hasErrors) {
// All methods resulted in errors, hide the loader and display an error message
document.querySelector('.loader-container').style.display = 'none';
alert('An error occurred while fetching fingerprint data.');
}
}
</script>
</body>
</html>