private void AddFilterToGui(FuzzerFilter Filter) { ListViewItem Item = new ListViewItem(); Item.Text = Filter.Name; Item.SubItems.Add(Filter.FilterType.ToString()); Item.SubItems.Add(Filter.ConditionType.ToString()); Item.SubItems.Add(Filter.ConditionValue); listViewFilters.Items.Add(Item); }
public void LoadDefaultFilters() { FuzzerFilter Filter = new FuzzerFilter(); Filter.Name = "Internal Server Error"; Filter.ConditionValue = "500"; Filter.FilterType = FuzzerFilter.FilterTypes.Include; Filter.ConditionType = FuzzerFilter.ConditionTypes.ResponseStatusCode; filters.Add(Filter); AddFilterToGui(Filter); }
private void buttonAddFilter_Click(object sender, EventArgs e) { FuzzerFilter Filter = new FuzzerFilter(); foreach (ListViewItem item in listViewFilters.Items) { if (item.Text == textBoxFilterName.Text) { MessageBox.Show("This filter name already exists. Please choose another", "Name taken", MessageBoxButtons.OK); return; } } Filter.Name = textBoxFilterName.Text; Filter.ConditionValue = textBoxRegex.Text; if (comboBoxFilterType.SelectedIndex == 0) { Filter.FilterType = FuzzerFilter.FilterTypes.Exclude; } else { Filter.FilterType = FuzzerFilter.FilterTypes.Include; } if (comboBoxConditionType.SelectedIndex == 0) { Filter.ConditionType = FuzzerFilter.ConditionTypes.ResponseStatusCode; } else if (comboBoxConditionType.SelectedIndex == 1) { Filter.ConditionType = FuzzerFilter.ConditionTypes.ResponseHTML; } else if (comboBoxConditionType.SelectedIndex == 2) { Filter.ConditionType = FuzzerFilter.ConditionTypes.ResponseHeaders; } Filters.Add(Filter); AddFilterToGui(Filter); SaveFilters(); }
private void buttonAddFilter_Click(object sender, EventArgs e) { if (listViewFilters.SelectedIndices.Count == 0) return; FuzzerFilter Filter = new FuzzerFilter(); Filter.Name = textBoxFilterName.Text; Filter.ConditionValue = textBoxRegex.Text; if (comboBoxFilterType.SelectedIndex == 0) Filter.FilterType = FuzzerFilter.FilterTypes.Exclude; else Filter.FilterType = FuzzerFilter.FilterTypes.Include; if (comboBoxConditionType.SelectedIndex == 0) Filter.ConditionType = FuzzerFilter.ConditionTypes.ResponseStatusCode; else if (comboBoxConditionType.SelectedIndex == 1) Filter.ConditionType = FuzzerFilter.ConditionTypes.ResponseHTML; else if (comboBoxConditionType.SelectedIndex == 2) Filter.ConditionType = FuzzerFilter.ConditionTypes.ResponseHeaders; filters.Add(Filter); AddFilterToGui(Filter); }
private void buttonAddFilter_Click(object sender, EventArgs e) { if (listViewFilters.SelectedIndices.Count == 0) { return; } FuzzerFilter Filter = new FuzzerFilter(); Filter.Name = textBoxFilterName.Text; Filter.ConditionValue = textBoxRegex.Text; if (comboBoxFilterType.SelectedIndex == 0) { Filter.FilterType = FuzzerFilter.FilterTypes.Exclude; } else { Filter.FilterType = FuzzerFilter.FilterTypes.Include; } if (comboBoxConditionType.SelectedIndex == 0) { Filter.ConditionType = FuzzerFilter.ConditionTypes.ResponseStatusCode; } else if (comboBoxConditionType.SelectedIndex == 1) { Filter.ConditionType = FuzzerFilter.ConditionTypes.ResponseHTML; } else if (comboBoxConditionType.SelectedIndex == 2) { Filter.ConditionType = FuzzerFilter.ConditionTypes.ResponseHeaders; } filters.Add(Filter); AddFilterToGui(Filter); }