Esempio n. 1
0
        private void FiddlerApplicationAfterSessionComplete(Session oSession)
        {
            if (oSession.oRequest.headers == null)
            {
                return;
            }

            var httpitem = new HttpItem {
                Parameters = oSession.oRequest.headers.ToString()
            };

            XLogSys.Print.Debug("visiting... " + oSession.url);

            if ((oSession.BitFlags & SessionFlags.IsHTTPS) != 0)
            {
                httpitem.URL = "https://" + oSession.url;
            }
            else
            {
                httpitem.URL = "http://" + oSession.url;
            }
            if (oSession.RequestMethod.ToLower() == "post")
            {
                httpitem.Method = MethodType.POST;
            }

            httpitem.Postdata = Encoding.Default.GetString(oSession.RequestBody);



            if (string.IsNullOrWhiteSpace(SelectText) == false)
            {
                var content = oSession.GetResponseBodyAsString();

                content = JavaScriptAnalyzer.Decode(content);
                if (content.Contains(SelectText) == false)
                {
                    return;
                }
            }
            if (string.IsNullOrWhiteSpace(SelectText) == true)
            {
                return;
            }
            if (ConfigFile.Config.Get <bool>("AutoStartStopFiddler"))
            {
                StopVisit();
            }
            httpitem.DictCopyTo(Http);
            var post = "";

            if (Http.Method == MethodType.POST)
            {
                post = "POST content is:\n" + httpitem.Postdata + "\n";
            }
            var window = MainFrm as Window;

            ControlExtended.UIInvoke(() => { if (window != null)
                                             {
                                                 window.Topmost = true;
                                             }
                                     });
            var info = GlobalHelper.FormatArgs("success_get", oSession.url, Http.Method, post);

            XLogSys.Print.Info(info);
            //IsSuperMode = false;
            ControlExtended.UIInvoke(() => { if (window != null)
                                             {
                                                 window.Topmost = false;
                                             }
                                     });
            SniffSucceed?.Invoke(this, new EventArgs());
            URL = oSession.url;
        }
Esempio n. 2
0
        private void FiddlerApplicationAfterSessionComplete(Session oSession)
        {
            if (oSession.oRequest.headers == null)
            {
                return;
            }
            var httpitem = new HttpItem {
                Parameters = oSession.oRequest.headers.ToString()
            };


            if ((oSession.BitFlags & SessionFlags.IsHTTPS) != 0)
            {
                httpitem.URL = "https://" + oSession.url;
            }
            else
            {
                httpitem.URL = "http://" + oSession.url;
            }


            httpitem.Postdata = Encoding.Default.GetString(oSession.RequestBody);


            if (string.IsNullOrWhiteSpace(SelectText) == false)
            {
                var content = oSession.GetResponseBodyAsString();

                content = JavaScriptAnalyzer.Decode(content);
                if (content.Contains(SelectText) == false)
                {
                    return;
                }
            }
            StopVisit();
            httpitem.DictCopyTo(Http);
            var post = "";

            if (Http.Method == MethodType.POST)
            {
                post = "post请求的内容为:\n" + httpitem.Postdata + "\n";
            }
            var window = MainFrm as Window;

            ControlExtended.UIInvoke(() => { if (window != null)
                                             {
                                                 window.Topmost = true;
                                             }
                                     });
            var info = $"已经成功获取嗅探字段! 真实请求地址:\n{oSession.url},\n已自动配置了网页采集器,请求类型为{Http.Method}\n {post}已经刷新了网页采集器的内容";

            XLogSys.Print.Info(info);

            ControlExtended.UIInvoke(() => { if (window != null)
                                             {
                                                 window.Topmost = false;
                                             }
                                     });
            SniffSucceed?.Invoke(this, new EventArgs());
            URL = oSession.url;
        }