ddos-guard-bypass/test.js
2022-08-01 02:59:00 -04:00

29 lines
1.1 KiB
JavaScript

/*
This test is not an endorsement of hshop.erista.me,
it is simply a site that uses DDOS-Guard.
If you have a less legally-questionable site,
please make an issue to let me know!
*/
const dg = require("./index");
const axios = require("axios");
// To remove additional logging, make remove the "true" argument from line 16!
(async function() {
let ddgu = await dg.bypass(`https://ddos-guard.net/en`, true);
console.log("Result:", ddgu);
console.log("Requesting page...");
let resp = await axios({
url: `https://ddos-guard.net/en`,
headers: ddgu.headers,
validateStatus: function() {return true;},
throwHttpErrors: false
});
if (resp.status == 200 && resp.data.split("<title>")[1].split("</title>")[0] == "DDoS Protection & Mitigation | Security Service Provider DDoS-GUARD") console.log(`Passed test!`);
else if (resp.status !== 200) console.log(`Failed test! Got status code that was not 200.`, resp.status);
else console.log("Possibly incorrect bypass, doesn't have expected title, says: ". resp.data.split("<title>")[1].split("</title>")[0]);
})();