Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.75 KB | None | 0 0
  1. public bool login2auth(string authkod)
  2. {
  3.     bool flag = Operators.CompareString(this.authCode, "", false) == 0;
  4.     if (flag)
  5.     {
  6.         bool flag2 = Operators.CompareString(authkod, "", false) == 0;
  7.         if (flag2)
  8.         {
  9.             this.authCode = Interaction.InputBox("Please enter your secret key", "NETGuard Desktop Application", "", -1, -1);
  10.         }
  11.         else
  12.         {
  13.             this.authCode = authkod;
  14.         }
  15.     }
  16.     WebClient webClient = new WebClient();
  17.     webClient.Headers.Add("user-agent", "NETGuard.IO");
  18.     webClient.Proxy = null;
  19.     string data = webClient.DownloadString("https://netguard.io/API/login2auth.php?username=" + this.Username + "&start=netguard");
  20.     string text = NetGuardApi.xor_this(data, this.authCode);
  21.     this.tmpIV = text.Split(new char[]
  22.     {
  23.         '{'
  24.     })[0];
  25.     this.tmpsalt = text.Replace(this.tmpIV + "{0}", string.Empty);
  26.     string username = this.Username;
  27.     string decryptedtext = this.encode(this.encode(this.Password));
  28.     string stringToEscape = NetGuardApi.AESEncrypt(decryptedtext, this.tmpsalt, this.tmpIV);
  29.     webClient.Headers.Add("user-agent", "NETGuard.IO");
  30.     webClient.Proxy = null;
  31.     string encryptedtext = webClient.DownloadString("https://netguard.io/API/login2auth.php?username=" + username + "&password=" + Uri.EscapeDataString(stringToEscape));
  32.     string text2 = NetGuardApi.AESDecrypt(encryptedtext, this.tmpsalt, this.tmpIV);
  33.     bool flag3 = text2.Contains("Welcome");
  34.     bool result;
  35.     if (flag3)
  36.     {
  37.         string[] array = text2.Split(new char[]
  38.         {
  39.             '|'
  40.         });
  41.         this.CurrentPoint = array[2];
  42.         bool flag4 = array.Count<string>() > 3;
  43.         if (flag4)
  44.         {
  45.             this.isBeta = true;
  46.         }
  47.         else
  48.         {
  49.             this.isBeta = false;
  50.         }
  51.         result = true;
  52.     }
  53.     else
  54.     {
  55.         Interaction.MsgBox("Wrong password!", MsgBoxStyle.OkOnly, null);
  56.         result = false;
  57.     }
  58.     return result;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement