Beispiel #1
0
 private void BaseTabs_Selected(object sender, TabControlEventArgs e)
 {
     if (e.TabPageIndex != CurrentStep)
     {
         BaseTabs.SelectTab(CurrentStep);
     }
 }
 private void FromClipboardLL_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     FromClipboard = true;
     RequestToTest = ClipboardRequest;
     CurrentStep   = 1;
     BaseTabs.SelectTab(1);
 }
 private void StartAnalysisBtn_Click(object sender, EventArgs e)
 {
     if (StartAnalysisBtn.Text.Equals("Start Analysis"))
     {
         StartAnalysisBtn.Text = "Stop Analysis";
         try
         {
             AnalysisThread.Abort();
         }
         catch { }
         if (!ReadFilter())
         {
             return;
         }
         if (!ReadConfig())
         {
             ShowConfigPanel();
             return;
         }
         ClearResultsGrid();
         AnalysisProgressBar.Visible = true;
         AnalysisThread = new Thread(DoAnalysis);
         AnalysisThread.Start();
         BaseTabs.SelectTab(1);
     }
     else
     {
         StopAnalysis(false);
     }
 }
 private void BaseTabs_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (!BaseTabs.SelectedTab.Name.Equals(IndexNames[this.CurrentStep]))
     {
         BaseTabs.SelectTab(IndexNames[this.CurrentStep]);
     }
 }
Beispiel #5
0
 private void SaveEditsLbl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
 {
     BodyFormatPluginsParametersGrid.Rows[ExpandedParameterIndex].Cells[1].Value = EditTBP.GetText();
     BodyTypeFormatPluginsParametersChanged = true;
     BaseTabs.SelectTab("BodyParametersTab");
     ClearEditTab();
 }
Beispiel #6
0
        private void TestCandidatesBtn_Click(object sender, EventArgs e)
        {
            List <int> SelectedLogIds = new List <int>();

            foreach (DataGridViewRow Row in CandidatesGrid.Rows)
            {
                if ((bool)Row.Cells[0].Value)
                {
                    SelectedLogIds.Add((int)Row.Cells[1].Value);
                }
            }
            if (SelectedLogIds.Count == 0)
            {
                MessageBox.Show("No candidates were selected for testing, select atleast one candidate.");
                return;
            }

            ResultsGrid.Rows.Clear();
            ResultsStepProgressBar.Visible = true;
            InResultsStage = true;
            BaseTabs.SelectTab(2);
            try
            {
                WorkerThread.Abort();
            }
            catch { }
            WorkerThread = new Thread(TestSelectedCandidates);
            WorkerThread.Start(SelectedLogIds);
        }
Beispiel #7
0
 private void BaseTabs_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (BaseTabs.SelectedIndex != CurrentStep)
     {
         BaseTabs.SelectTab(CurrentStep);
     }
 }
Beispiel #8
0
 private void SearchBtn_Click(object sender, EventArgs e)
 {
     if (SearchBtn.Text.Equals("Search with this Filter"))
     {
         LogSearchQuery Query = GetQueryFromInput();
         if (Query != null)
         {
             LastSearchResultsIds = new List <int>(CurrentSearchResultsIds);
             CurrentSearchResultsIds.Clear();
             LogGrid.Rows.Clear();
             BaseTabs.SelectTab("SearchResultsTab");
             if (LogSearchThread != null)
             {
                 try { LogSearchThread.Abort(); }
                 catch { }
             }
             LogSearchThread = new Thread(DoSearch);
             LogSearchThread.Start(Query);
             SearchBtn.Text = "Stop Current Search";
         }
     }
     else
     {
         StopSearch();
     }
 }
 private void BaseTabs_Selecting(object sender, TabControlCancelEventArgs e)
 {
     if (BaseTabs.SelectedIndex != CurrentStep)
     {
         BaseTabs.SelectTab(CurrentStep);
         MessageBox.Show("Use the 'Next Step ->' and '<- Previous Step' buttons on the bottom right and left corners of this window for navigation.");
     }
 }
Beispiel #10
0
 void ClearEditTab()
 {
     EditTBP.SetText("");
     BaseTabs.TabPages["EditingTab"].Text = "  ";
     if (BaseTabs.SelectedTab.Name == "EditingTab")
     {
         BaseTabs.SelectTab("HeadersTab");
     }
 }
Beispiel #11
0
 void Reset()
 {
     try
     {
         AnalysisThread.Abort();
     }
     catch { }
     ResetConfigureStep();
     ResetRecordStep();
     ResetTestStep();
     ResetSaveStep();
     BaseTabs.SelectTab(0);
 }
 private void Step0NextBtn_Click(object sender, EventArgs e)
 {
     try
     {
         ShowStep0Status("");
         RequestToTest = new Request(RequestUrlTB.Text.Trim());
         if (UseUserAgentCB.Checked)
         {
             if (SelectedUserAgentLbl.Text.Trim().Length > 0)
             {
                 RequestToTest.Headers.Set("User-Agent", SelectedUserAgentLbl.Text);
             }
             else
             {
                 ShowStep0Error("No user-agent strings were selected");
                 return;
             }
         }
         if (UseAdditionalHeadersCB.Checked)
         {
             RequestToTest.Headers.Set("Accept", "*/*");
             RequestToTest.Headers.Set("Accept-Encoding", "gzip,deflate");
             RequestToTest.Headers.Set("Accept-Charset", "ISO-8859-1,utf-8");
         }
         if (UsePostBodyCB.Checked)
         {
             if (PostBodyTB.Text.Trim().Length == 0)
             {
                 ShowStep0Error("Post body is empty");
                 return;
             }
             else
             {
                 RequestToTest.Method     = "POST";
                 RequestToTest.BodyString = PostBodyTB.Text.Trim();
                 try
                 {
                     RequestToTest.ContentType = PostBodyTypeCombo.Text;
                 }
                 catch
                 {
                     ShowStep0Error("Invalid body content-type value");
                     return;
                 }
             }
         }
         CurrentStep = 1;
         BaseTabs.SelectTab(1);
     }
     catch (Exception Exp) { ShowStep0Error(string.Format("Invalid input - {0}", Exp.Message)); }
 }
        private void FindCandidatesBtn_Click(object sender, EventArgs e)
        {
            List <string> SelectedHosts = new List <string>();

            foreach (TreeNode Node in HostnamesScopeTree.Nodes)
            {
                SelectedHosts.AddRange(GetSelectedHosts(Node));
            }

            List <string> SelectedFileTypes = new List <string>();

            foreach (DataGridViewRow Row in FileTypesScopeGrid.Rows)
            {
                if ((bool)Row.Cells[0].Value)
                {
                    if (Row.Cells[1].Value.ToString().Equals(" NO EXTENSION "))
                    {
                        SelectedFileTypes.Add("");
                    }
                    else
                    {
                        SelectedFileTypes.Add(Row.Cells[1].Value.ToString());
                    }
                }
            }
            if (SelectedHosts.Count == 0)
            {
                MessageBox.Show("Atleast one host must be selected for testing");
                return;
            }
            if (SelectedFileTypes.Count == 0)
            {
                MessageBox.Show("Atleast one file extension must be selected for testing");
                return;
            }

            SelectCandidatesBotttomSplit.Visible = false;
            CandidatesStepProgressBar.Visible    = true;
            BaseTabs.SelectTab(1);
            try
            {
                WorkerThread.Abort();
            }
            catch { }
            WorkerThread = new Thread(FindCandidatesFromDB);
            WorkerThread.Start(new Dictionary <string, List <string> >()
            {
                { "Hosts", SelectedHosts }, { "File", SelectedFileTypes }
            });
        }
Beispiel #14
0
 void GoToTestStep()
 {
     ResetTestStep();
     TopMost = false;
     TestStepProgressBar.Visible = false;
     TestStepWaitMoreBtn.Visible = true;
     TestStepDontWaitBtn.Visible = true;
     
     try
     {
         RecordingCompletionWaitThread.Abort();
     }
     catch { }
     RecordingCompletionWaitTime = DefaultRecordingCompletionWaitTime;
     RecordingCompletionWaitThread = new Thread(WaitForRecordingCompletion);
     RecordingCompletionWaitThread.Start();
     CurrentStep = 2;
     BaseTabs.SelectTab(CurrentStep);
 }
Beispiel #15
0
        private void SaveEditsLbl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            string Name         = BodyFormatPluginsParametersGrid.Rows[ExpandedParameterIndex].Cells[0].Value.ToString();
            string NormalValue  = EditTBP.GetText();
            string EncodedValue = "";

            if (EditTBP.IsBinary)
            {
                EncodedValue = Tools.Base64EncodeByteArray(EditTBP.GetBytes());
            }
            else
            {
                EncodedValue = Tools.Base64Encode(EditTBP.GetText());
            }

            BodyFormatPluginsParametersGrid.Rows.RemoveAt(ExpandedParameterIndex);
            BodyFormatPluginsParametersGrid.Rows.Insert(ExpandedParameterIndex, new object[] { Name, NormalValue, Properties.Resources.Glass, EncodedValue });

            BodyFormatPluginsParametersGrid.Rows[ExpandedParameterIndex].Cells[1].Value = EditTBP.GetText();
            BodyTypeFormatPluginsParametersChanged = true;
            BaseTabs.SelectTab("BodyParametersTab");
            ClearEditTab();
        }
Beispiel #16
0
        private void SaveEditsLbl_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            switch (ExpandedParameterSection)
            {
            case ("UrlPathParts"):
                UrlPathPartsParametersGrid.Rows[ExpandedParameterIndex].Cells[1].Value = EditTBP.GetText();
                UrlPathPartsChanged = true;
                BaseTabs.SelectTab("UrlPathPartsParametersTab");
                break;

            case ("Query"):
                QueryParametersGrid.Rows[ExpandedParameterIndex].Cells[1].Value = EditTBP.GetText();
                QueryParametersChanged = true;
                BaseTabs.SelectTab("QueryParametersTab");
                break;

            case ("Body"):
                BodyParametersGrid.Rows[ExpandedParameterIndex].Cells[1].Value = EditTBP.GetText();
                BodyParametersChanged = true;
                BaseTabs.SelectTab("BodyParametersTab");
                break;

            case ("Cookie"):
                CookieParametersGrid.Rows[ExpandedParameterIndex].Cells[1].Value = EditTBP.GetText();
                CookieParametersChanged = true;
                BaseTabs.SelectTab("CookieParametersTab");
                break;

            case ("Headers"):
                HeadersParametersGrid.Rows[ExpandedParameterIndex].Cells[1].Value = EditTBP.GetText();
                HeadersParametersChanged = true;
                BaseTabs.SelectTab("HeadersParametersTab");
                break;
            }
            ClearEditTab();
        }
Beispiel #17
0
 void SetEditTab(string Value)
 {
     EditTBP.SetText(Value);
     BaseTabs.TabPages["EditingTab"].Text = "  Selected Parameter Value  ";
     BaseTabs.SelectTab("EditingTab");
 }
Beispiel #18
0
 void GoToConfigureStep()
 {
     ResetConfigureStep();
     CurrentStep = 0;
     BaseTabs.SelectTab(CurrentStep);
 }
Beispiel #19
0
 void GoToRecordStep()
 {
     ResetRecordStep();
     CurrentStep = 1;
     BaseTabs.SelectTab(CurrentStep);
 }
Beispiel #20
0
        private void FindCandidatesBtn_Click(object sender, EventArgs e)
        {
            List <string> SelectedHosts = new List <string>();

            foreach (TreeNode Node in HostnamesScopeTree.Nodes)
            {
                SelectedHosts.AddRange(GetSelectedHosts(Node));
            }

            List <string> SelectedFileTypes = new List <string>();

            foreach (DataGridViewRow Row in FileTypesScopeGrid.Rows)
            {
                if ((bool)Row.Cells[0].Value)
                {
                    if (Row.Cells[1].Value.ToString().Equals(" NO EXTENSION "))
                    {
                        SelectedFileTypes.Add("");
                    }
                    else
                    {
                        SelectedFileTypes.Add(Row.Cells[1].Value.ToString());
                    }
                }
            }

            TokenName             = CsrfTokenParameterNameTB.Text;
            TokenReplacementValue = CsrfTokenReplacementValueTB.Text;
            RemoveParameter       = TestModeRemoveTokenRB.Checked;

            if (Recording.Recording.GetNames().Contains(SessionRecordingCombo.Text))
            {
                LoginRecording = Recording.Recording.Get(SessionRecordingCombo.Text);
            }
            else if (SessionRecordingCombo.Text.Trim().Length > 0)
            {
                MessageBox.Show("Invalid Login recording name, enter a valid name.");
                return;
            }
            if (TokenName.Trim().Length == 0)
            {
                MessageBox.Show("Name of the CSRF token parameter cannot be blank.");
                return;
            }
            if (SelectedHosts.Count == 0)
            {
                MessageBox.Show("Atleast one host must be selected for testing");
                return;
            }
            if (SelectedFileTypes.Count == 0)
            {
                MessageBox.Show("Atleast one file extension must be selected for testing");
                return;
            }

            CandidatesBaseSplit.Visible       = false;
            CandidatesStepProgressBar.Visible = true;
            BaseTabs.SelectTab(1);
            try
            {
                WorkerThread.Abort();
            }
            catch { }
            WorkerThread = new Thread(FindCandidatesFromDB);
            WorkerThread.Start(new Dictionary <string, List <string> >()
            {
                { "Hosts", SelectedHosts }, { "File", SelectedFileTypes }, { "TokenName", new List <string>()
                                                                             {
                                                                                 TokenName
                                                                             } }
            });
        }
Beispiel #21
0
 void GoToSaveStep()
 {
     ResetSaveStep();
     CurrentStep = 3;
     BaseTabs.SelectTab(CurrentStep);
 }
Beispiel #22
0
        private void FindCandidatesBtn_Click(object sender, EventArgs e)
        {
            if (Recording.Recording.Has(RecordingSelectBox.Text))
            {
                LoginRecording = Recording.Recording.Get(RecordingSelectBox.Text);
            }
            else if (RecordingSelectBox.Text.Trim().Length > 0)
            {
                MessageBox.Show("Invalid Login recording name, enter a valid name.");
                return;
            }

            foreach (DataGridViewRow Row in ParametersGrid.Rows)
            {
                if (Row.Cells[0].Value != null && Row.Cells[1].Value != null && Row.Cells[2].Value != null && Row.Cells[3].Value != null && Row.Cells[4].Value != null && Row.Cells[5].Value != null)
                {
                    string[] ParameterNameValue = new string[] { (string)Row.Cells[4].Value, (string)Row.Cells[5].Value };
                    if ((bool)Row.Cells[0].Value)
                    {
                        ParametersToAdd["Query"].Add(ParameterNameValue);
                    }
                    if ((bool)Row.Cells[1].Value)
                    {
                        ParametersToAdd["Body"].Add(ParameterNameValue);
                    }
                    if ((bool)Row.Cells[2].Value)
                    {
                        ParametersToAdd["Cookie"].Add(ParameterNameValue);
                    }
                    if ((bool)Row.Cells[3].Value)
                    {
                        ParametersToAdd["Headers"].Add(ParameterNameValue);
                    }
                }
            }

            int ParamsToAddCount = 0;

            foreach (string Section in ParametersToAdd.Keys)
            {
                ParamsToAddCount += ParametersToAdd[Section].Count;
            }
            if (ParamsToAddCount == 0)
            {
                MessageBox.Show("Atleast one host must be selected for testing");
                return;
            }

            List <string> SelectedHosts = new List <string>();

            foreach (TreeNode Node in HostnamesScopeTree.Nodes)
            {
                SelectedHosts.AddRange(GetSelectedHosts(Node));
            }

            List <string> SelectedFileTypes = new List <string>();

            foreach (DataGridViewRow Row in FileTypesScopeGrid.Rows)
            {
                if ((bool)Row.Cells[0].Value)
                {
                    if (Row.Cells[1].Value.ToString().Equals(" NO EXTENSION "))
                    {
                        SelectedFileTypes.Add("");
                    }
                    else
                    {
                        SelectedFileTypes.Add(Row.Cells[1].Value.ToString());
                    }
                }
            }
            if (SelectedHosts.Count == 0)
            {
                MessageBox.Show("Atleast one host must be selected for testing");
                return;
            }
            if (SelectedFileTypes.Count == 0)
            {
                MessageBox.Show("Atleast one file extension must be selected for testing");
                return;
            }


            CandidatesBottomSplit.Visible = false;
            CandidatesProgressBar.Visible = true;
            BaseTabs.SelectTab(1);
            try
            {
                WorkerThread.Abort();
            }
            catch { }
            WorkerThread = new Thread(FindCandidatesFromDB);
            WorkerThread.Start(new Dictionary <string, List <string> >()
            {
                { "Hosts", SelectedHosts }, { "File", SelectedFileTypes }
            });
        }
 private void Step1PreviousStepBtn_Click(object sender, EventArgs e)
 {
     CurrentStep = 0;
     BaseTabs.SelectTab(0);
 }
Beispiel #24
0
 void SetEditTab(byte[] Value)
 {
     EditTBP.SetBytes(Value);
     BaseTabs.TabPages["EditingTab"].Text = "  Selected Parameter Value  ";
     BaseTabs.SelectTab("EditingTab");
 }