Ejemplo n.º 1
0
        public List <DownloadsDTO> getDownloads()
        {
            if (result == null)
            {
                List <DownloadsDTO> output = new List <DownloadsDTO>();
                DataTable           completedDownloads;
                string s = "SELECT datetime(moz_annos.dateAdded / 1000000, 'unixepoch', 'localtime') as dateAdded, moz_annos.content  FROM moz_annos";
                try {
                    completedDownloads = client.select(s);

                    foreach (DataRow r in completedDownloads.Rows)
                    {
                        if (r["content"].ToString().Contains("Downloads") || r["content"].ToString().Contains("C:"))
                        {
                            output.Add(new DownloadsDTO("" + r["dateAdded"], "Firefox", "", "", "" + r["content"]));
                        }
                    }
                } catch (System.Data.SQLite.SQLiteException e) {
                    Console.WriteLine(location + " not Found");
                    client.dbConnection.Close();
                }
                result = output;
            }
            return(result);
        }
Ejemplo n.º 2
0
        //public List<string> getHistory() {
        public List <HistoryDTO> getHistory()
        {
            if (result == null)
            {
                List <HistoryDTO> output = new List <HistoryDTO>();
                try {
                    queryResult = client.select(QUERY);
                    var rows = queryResult.Rows;
                    Console.WriteLine("Have " + rows.Count + " to process");

                    int partes      = (int)(rows.Count * 0.10f);
                    int percentagem = 0;
                    int i           = 0;
                    foreach (DataRow r in rows)
                    {
                        i++;
                        if (partes > 0 && (i % partes == 0))
                        {
                            percentagem += 10;
                            Console.WriteLine("Ja vou a " + percentagem + "%");
                        }


                        output.Add(new HistoryDTO("" + r["date"], "Chrome", "" + r["url"]));
                    }
                } catch (System.Data.SQLite.SQLiteException e) {
                    Console.WriteLine(location + " not Found");
                    client.dbConnection.Close();
                }
                result = output;
            }

            return(result);
        }
Ejemplo n.º 3
0
        public override List <SearchDTO> getSearches()
        {
            if (result == null)
            {
                DataTable        browsed;
                List <string>    output     = new List <string>();
                List <SearchDTO> outputDTOs = new List <SearchDTO>();
                string           s          = "SELECT datetime(moz_historyvisits.visit_date/1000000, 'unixepoch', 'localtime')as time, moz_places.url FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id";
                try {
                    browsed = client.select(s);

                    foreach (DataRow r in browsed.Rows)
                    {
                        string[] search = getSearchInURL((string)r["url"]);
                        if (search != null)
                        {
                            string line = r["time"] + " SEARCH in " + search[0] + search[1];
                            if (!output.Contains(line))
                            {
                                output.Add(line);
                                outputDTOs.Add(new SearchDTO("" + r["time"], "Firefox", search[1], search[0]));
                            }
                        }
                    }
                } catch (System.Data.SQLite.SQLiteException e) {
                    Console.WriteLine(location + " not Found");
                    client.dbConnection.Close();
                }
                outputDTOs = outputDTOs.OrderBy(o => o.getTime()).ToList();
                result     = outputDTOs;
            }

            return(result);
        }
Ejemplo n.º 4
0
        //public List<string> getPasswords() {
        public List <PasswordDTO> getPasswords()
        {
            if (result == null)
            {
                List <PasswordDTO> res = new List <PasswordDTO>();
                try {
                    if (queryResult == null)
                    {
                        queryResult = client.select(QUERY);
                        WindowsBLOBDecipher.decipherQueryResultField("pass", queryResult);
                    }

                    //List<string> res = new List<string>();

                    foreach (DataRow r in queryResult.Rows)
                    {
                        string pass = System.Text.Encoding.Default.GetString((byte[])r["pass"]);
                        //TODO missing time
                        res.Add(new PasswordDTO("", "Chrome", "" + r["url"], "" + r["username"], pass));
                    }
                } catch (System.Data.SQLite.SQLiteException e) {
                    Console.WriteLine(location + " not Found");
                    client.dbConnection.Close();
                }
                result = res;
            }

            return(result);
        }
Ejemplo n.º 5
0
        //public List<string> getSearches() {
        public override List <SearchDTO> getSearches()
        {
            DataTable        browsed             = null;
            List <SearchDTO> res_searchs         = new List <SearchDTO>();
            List <string>    output              = new List <string>();
            List <SearchDTO> res_history_searchs = new List <SearchDTO>();

            if (result == null)
            {
                try {
                    queryResult = client.select(QUERY);

                    foreach (DataRow r in queryResult.Rows)
                    {
                        res_searchs.Add(new SearchDTO("", "Chrome", "" + r["term"]));
                    }

                    result = res_searchs;


                    // find search words in history urls
                    browsed = client.select(HISTORY_QUERY);
                    foreach (DataRow r in browsed.Rows)
                    {
                        string[] search = getSearchInURL((string)r["url"]);
                        if (search != null)
                        {
                            string line = r["date"] + " SEARCH in " + search[0] + search[1];
                            if (!output.Contains(line))
                            {
                                output.Add(line);
                                res_history_searchs.Add(new SearchDTO("" + r["date"], "Chrome", search[1], search[0]));
                            }
                        }
                    }
                    result.AddRange(res_history_searchs);
                } catch (System.Data.SQLite.SQLiteException e) {
                    Console.WriteLine(location + " not Found");
                    client.dbConnection.Close();
                }
            }
            return(result);
        }
Ejemplo n.º 6
0
        public List <AutofillDTO> getAutofills()
        {
            DataTable          inputed;
            string             s      = "select fieldname, value, timesUsed, datetime(firstUsed / 1000000, 'unixepoch', 'localtime') as first,datetime(lastUsed / 1000000, 'unixepoch', 'localtime') as last from moz_formhistory";
            List <AutofillDTO> output = new List <AutofillDTO>();

            try {
                inputed = client.select(s);
                foreach (DataRow r in inputed.Rows)
                {
                    //output.Add(r["first"]+ "  "+ "fieldname:" + r["fieldname"] + "  value:" + r["value"] + "  timesUsed:" + r["timesUsed"] + "  last:" + r["last"] + "\r\n");
                    output.Add(new AutofillDTO("" + r["first"], "Firefox", "" + r["value"], "" + r["fieldname"]));
                }
            } catch (System.Data.SQLite.SQLiteException e) { Console.WriteLine(location + " not Found"); }
            return(output);
        }
Ejemplo n.º 7
0
 //public List<string> getCookies() {
 public List <CookiesDTO> getCookies()
 {
     if (result == null)
     {
         List <CookiesDTO> res = new List <CookiesDTO>();
         try {
             queryResult = client.select(QUERY);
             WindowsBLOBDecipher.decipherQueryResultField("value", queryResult);
             res = convertToList();
         } catch (System.Data.SQLite.SQLiteException e) {
             Console.WriteLine(location + " not Found");
             client.dbConnection.Close();
         }
         result = res;
     }
     return(result);
 }
Ejemplo n.º 8
0
 public List <DownloadsDTO> getDownloads()
 {
     if (result == null)
     {
         List <DownloadsDTO> res = new List <DownloadsDTO>();
         try {
             if (queryResult == null)
             {
                 queryResult = client.select(QUERY);
             }
             res = convertToList();
         } catch (System.Data.SQLite.SQLiteException e) {
             Console.WriteLine(location + " not Found");
             client.dbConnection.Close();
         }
         result = res;
     }
     return(result);
 }
Ejemplo n.º 9
0
        //public List<string> getAutofills() {
        public List <AutofillDTO> getAutofills()
        {
            if (result == null)
            {
                List <AutofillDTO> res = new List <AutofillDTO>();
                try {
                    queryResult = client.select(QUERY);

                    //List<string> res = new List<string>();
                    foreach (DataRow r in queryResult.Rows)
                    {
                        //res.Add("AUTOFILL " + r["value"]);
                        res.Add(new AutofillDTO("", "Chrome", "" + r["value"]));
                    }
                } catch (System.Data.SQLite.SQLiteException e) {
                    Console.WriteLine(location + " not Found");
                    client.dbConnection.Close();
                }
                result = res;
            }
            return(result);
        }
Ejemplo n.º 10
0
        public List <HistoryDTO> getHistory()
        {
            if (result == null)
            {
                DataTable         browsed;
                List <HistoryDTO> output = new List <HistoryDTO>();
                string            s      = "select datetime(last_visit_date/1000000,'unixepoch','localtime') as time, title, url, visit_count from moz_places ";
                s = "SELECT datetime(moz_historyvisits.visit_date/1000000, 'unixepoch', 'localtime')as time, moz_places.url FROM moz_places, moz_historyvisits WHERE moz_places.id = moz_historyvisits.place_id";
                try {
                    browsed = client.select(s);
                    var rows = browsed.Rows;

                    Console.WriteLine("Have " + rows.Count + " to process");

                    int partes      = (int)(rows.Count * 0.10f);
                    int percentagem = 0;
                    int i           = 0;

                    foreach (DataRow r in browsed.Rows)
                    {
                        i++;
                        if (partes > 0 && (i % partes == 0))
                        {
                            percentagem += 10;
                            Console.WriteLine("Ja vou a " + percentagem + "%");
                        }

                        output.Add(new HistoryDTO("" + r["time"], "Firefox", "" + r["url"]));
                    }
                } catch (System.Data.SQLite.SQLiteException e) {
                    Console.WriteLine(location + " not Found");
                    client.dbConnection.Close();
                }
                output = output.OrderBy(o => o.getTime()).ToList();
                result = output;
            }
            return(result);
        }
Ejemplo n.º 11
0
        public List <CookiesDTO> getCookies()
        {
            if (result == null)
            {
                List <CookiesDTO> output = new List <CookiesDTO>();
                DataTable         storedCookies;
                string            s = "select baseDomain, name, value, host, path, datetime(expiry, 'unixepoch', 'localtime') as expiration, datetime(lastAccessed/1000000,'unixepoch','localtime') as last ,datetime(creationTime/1000000,'unixepoch','localtime') as creat, isSecure, isHttpOnly FROM moz_cookies";
                try {
                    storedCookies = client.select(s);

                    foreach (DataRow r in storedCookies.Rows)
                    {
                        output.Add(new CookiesDTO("" + r["creat"], "Firefox", "" + r["baseDomain"], "" + r["last"], "" + r["expiration"], "" + r["value"]));
                    }
                } catch (System.Data.SQLite.SQLiteException e) {
                    Console.WriteLine(location + " not Found");
                    client.dbConnection.Close();
                }
                //output = output.OrderBy(o => o.getDomain()).ThenBy(o => o.getTime()).ToList();
                output = output.OrderByDescending(o => o.getTime()).ToList();
                result = output;
            }
            return(result);
        }