-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdebug.js
62 lines (58 loc) · 1.5 KB
/
debug.js
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
//Debug Spammer
const https = require('http');
const options = {};
var j = {
tt:0,
rps:0
};
class DB {
static get json() {
return (typeof j == "object") ? j : {}
}
static set json(v) {
return (typeof v == "object") ? object : j;
}
static get tt() {
return j['tt'];
}
static set tt(v) {
j['tt'] = v
}
static get rps() {
return j['rps']
}
static set rps(v) {
j['rps'] = v
}
}
setInterval(function() {
DB.rps = 0
},1000)
function uptoLastTwoDecimals(num) {
return (Math.round(num * 100) / 100).toFixed(2);
}
function updateHeaders(tries , rps) {
process.title = `Webhook Spammer Debug [Total Requests: ${tries} | RPS: ${rps}]`
}
function handleHeaders(tt , rps) {
DB.tt += tt;
DB.rps += rps
updateHeaders(DB.tt , DB.rps);
}
handleHeaders(0,0)
https.createServer(options, (req, res) => {
const ip = res.socket.remoteAddress;
const port = res.socket.remotePort;
if (req.method.toLowerCase() == 'post') {
console.log(`[+] Got a Message Send Request by ${ip}`);
handleHeaders(1,1)
res.writeHead(204);
res.end(`{"this":"made by https://github.com/titan3301 >_<"}`);
} else {
console.log(`[+] Got a Fetch Request by ${ip}`)
res.writeHead(200);
res.end(`{"this":"made by https://github.com/titan3301 >_<"}`);
}
}).listen(8001 , () => {
console.log(`[+] Listening at port 8001 addr http://127.0.0.1:8001/\n`)
});