public WordlistManager()
        {
            vm          = SB.WordlistManager;
            DataContext = vm;

            InitializeComponent();
        }
Exemple #2
0
        public DialogSelectWordlist(object caller)
        {
            Caller      = caller;
            vm          = OB.WordlistManager;
            DataContext = vm;

            InitializeComponent();
        }
        public WordlistManager()
        {
            vm          = OB.WordlistManager;
            DataContext = vm;

            InitializeComponent();

            vm.RefreshList();
        }
Exemple #4
0
        private void importWordlistButton_MouseDown(object sender, MouseButtonEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter      = "Wordlist file | *.txt";
            ofd.FilterIndex = 1;
            ofd.ShowDialog();
            try
            {
                // Add the wordlist to the runner
                ((Runner)Caller).SetWordlist(WordlistManagerViewModel.FileToWordlist(ofd.FileName));

                ((MainDialog)Parent).Close();
            }
            catch { }
        }
Exemple #5
0
        private void wordlistsListView_Drop(object sender, System.Windows.DragEventArgs e)
        {
            try
            {
                try { myTask?.Dispose(); } catch { }
                if (addToWordlistsCheckBox.IsChecked.GetValueOrDefault())
                {
                    myTask = Task.Run(() =>
                    {
                        string[] wordlists = (string[])e.Data.GetData(System.Windows.DataFormats.FileDrop);
                        foreach (string path in wordlists.Where(w => w.EndsWith(".txt")))
                        {
                            try
                            {
                                var wordlist = WordlistManagerViewModel.FileToWordlist(path);
                                Dispatcher.Invoke(() => wordlist.RemoveDup = removeDupCheckBox.IsChecked.GetValueOrDefault());
                                Dispatcher.Invoke(() => vm.Add(wordlist));
                            }
                            catch { }
                        }
                    });
                }
                else
                {
                    var wordlistPath = ((string[])e.Data.GetData(System.Windows.DataFormats.FileDrop))[0];
                    if (!wordlistPath.EndsWith(".txt") || !File.Exists(wordlistPath))
                    {
                        return;
                    }
                    var wordlist = WordlistManagerViewModel.FileToWordlist(wordlistPath);
                    wordlist.RemoveDup = removeDupCheckBox.IsChecked.GetValueOrDefault();
                    ((Runner)Caller).SetWordlist(wordlist);

                    ((MainDialog)Parent).Close();
                }
            }
            catch (Exception ex)
            {
                SB.Logger.Log(ex.Message, RuriLib.LogLevel.Error, true);
            }
        }
Exemple #6
0
        private void importWordlistButton_MouseDown(object sender, MouseButtonEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();

            ofd.Filter      = "Wordlist file | *.txt";
            ofd.FilterIndex = 1;
            if (ofd.ShowDialog() == DialogResult.OK)
            {
                pathTextBox.Text = ofd.FileName;
                if (addToWordlistsCheckBox.IsChecked.GetValueOrDefault())
                {
                    try
                    {
                        var wordlist = WordlistManagerViewModel.FileToWordlist(ofd.FileName);
                        wordlist.RemoveDup = removeDupCheckBox.IsChecked.GetValueOrDefault();
                        vm.Add(wordlist);
                    }
                    catch (Exception ex)
                    {
                        SB.Logger.Log(ex.Message, RuriLib.LogLevel.Error, true);
                    }
                }
                else
                {
                    try
                    {
                        // Add the wordlist to the runner
                        var wordlist = WordlistManagerViewModel.FileToWordlist(ofd.FileName);
                        wordlist.RemoveDup = removeDupCheckBox.IsChecked.GetValueOrDefault();
                        ((Runner)Caller).SetWordlist(wordlist);

                        ((MainDialog)Parent).Close();
                    }
                    catch { }
                }
            }
        }