Esempio n. 1
0
        void ShowSelectedLog(object SelectedLogInfoObject)
        {
            object[] SelectedLogInfo = (object[])SelectedLogInfoObject;
            string   Source          = SelectedLogInfo[0].ToString();
            int      LogId           = (int)SelectedLogInfo[1];

            try
            {
                Session Session = Session.FromLog(LogId, Source);

                if (Session.Request != null)
                {
                    RequestView.SetRequest(Session.Request);

                    if (Session.Response != null)
                    {
                        ResponseView.SetResponse(Session.Response, Session.Request);
                    }
                }
            }
            catch (ThreadAbortException) { }
            catch (Exception Exp) { IronException.Report("Error loading Selected Log info in Log Analyzer", Exp); }
            finally
            {
                EndLogLoad();
            }
        }
Esempio n. 2
0
        private void ManualTestRequestBtn_Click(object sender, EventArgs e)
        {
            NameTestGroupWizard NTGW = new NameTestGroupWizard();

            try
            {
                Request Req = RequestView.GetRequest();
                if (Req != null)
                {
                    NTGW.RequestToTest = Req;
                    NTGW.Show();
                }
            }
            catch {}
        }
Esempio n. 3
0
        void ShowSelectedLog(string Source, int LogId)
        {
            LogDisplayTabs.Visible     = false;
            LoadLogProgressBar.Visible = true;

            RequestView.ClearRequest();
            ResponseView.ClearResponse();

            if (LogLoadThread != null)
            {
                try
                {
                    LogLoadThread.Abort();
                }
                catch { }
            }
            object[] SelectedLogInfo = new object[] { Source, LogId };
            LogLoadThread = new Thread(ShowSelectedLog);
            LogLoadThread.Start(SelectedLogInfo);
        }
Esempio n. 4
0
        void ShowSelectedLog(int LogId)
        {
            LogDisplayTabs.Visible     = false;
            LoadLogProgressBar.Visible = true;

            RequestView.ClearRequest();
            ResponseView.ClearResponse();
            RequestDRV.ClearDiffResults();
            ResponseDRV.ClearDiffResults();

            if (LogLoadThread != null)
            {
                try
                {
                    LogLoadThread.Abort();
                }
                catch { }
            }
            LogLoadThread = new Thread(ShowSelectedLog);
            LogLoadThread.Start(LogId);
        }
Esempio n. 5
0
        void ShowSelectedLog(object SelectedLogInfoObject)
        {
            int    LogId      = (int)SelectedLogInfoObject;
            bool   EnableBtn  = false;
            string ScriptCode = "";

            try
            {
                Session Session = Session.FromScanLog(LogId);
                if (BaselineSession == null && BaselineLogId > 0)
                {
                    BaselineSession = Session.FromScanLog(BaselineLogId);
                }

                StringBuilder SB = new StringBuilder("<i<br>>To access the selected Request in the IronWASP Scripting shell for fuzzing or testing use the following code:<i<br>>");
                SB.Append(string.Format("<i<br>><i<hh>>Python:<i</hh>><i<br>>req = <i<cg>>Request<i</cg>>.<i<cb>>FromScanLog<i</cb>>({0})", LogId));
                SB.Append(string.Format("<i<br>><i<br>><i<hh>>Ruby:<i</hh>><i<br>>req = <i<cg>>Request<i</cg>>.<i<cb>>from_scan_log<i</cb>>({0})", LogId));
                ScriptCode = SB.ToString();

                SB = new StringBuilder(@"{\rtf1{\colortbl ;\red0\green77\blue187;\red247\green150\blue70;\red255\green0\blue0;\red0\green200\blue50;\red255\green255\blue255;}");
                SB.Append(Tools.RtfSafe(ScriptCode));
                ScriptCode = SB.ToString();
                ScriptCode = ScriptCode.Replace(" . ", ".").Replace(" (", "(").Replace("Request ", "Request").Replace(" From", "From").Replace(" from", "from").Replace("Log ", "Log").Replace("log ", "log");

                string RequestStr          = "";
                string ResponseStr         = "";
                string BaselineRequestStr  = "";
                string BaselineResponseStr = "";

                if (Session.Request != null)
                {
                    RequestStr = Session.Request.ToString();
                    RequestView.SetRequest(Session.Request);
                    EnableBtn = true;

                    if (Session.Response != null)
                    {
                        ResponseStr = Session.Response.ToString();
                        ResponseView.SetResponse(Session.Response, Session.Request);
                    }
                }
                if (BaselineSession != null)
                {
                    if (BaselineSession.Request != null)
                    {
                        BaselineRequestStr = BaselineSession.Request.ToString();
                        if (BaselineSession.Response != null)
                        {
                            BaselineResponseStr = BaselineSession.Response.ToString();
                        }
                    }
                }


                string[] RequestSidebySideResults  = DiffWindow.DoSideBySideDiff(BaselineRequestStr, RequestStr);
                string[] ResponseSidebySideResults = DiffWindow.DoSideBySideDiff(BaselineResponseStr, ResponseStr);

                string RequestSinglePageResults  = DiffWindow.DoSinglePageDiff(BaselineRequestStr, RequestStr);
                string ResponseSinglePageResults = DiffWindow.DoSinglePageDiff(BaselineResponseStr, ResponseStr);

                RequestDRV.ShowDiffResults(RequestSinglePageResults, RequestSidebySideResults[0], RequestSidebySideResults[1]);
                ResponseDRV.ShowDiffResults(ResponseSinglePageResults, ResponseSidebySideResults[0], ResponseSidebySideResults[1]);
            }
            catch (ThreadAbortException) { }
            catch (Exception Exp) { IronException.Report("Error loading Selected Log info in Scan Trace Viewer", Exp); }
            finally
            {
                EndLogLoad(EnableBtn, ScriptCode);
            }
        }