示例#1
0
        private void FiddlerApplicationAfterSessionComplete(Session oSession)
        {
            if (string.IsNullOrEmpty(URLFilter) == false)
            {
                URLFilter = URLFilter.Replace("http://", "");
                if (URLFilter.Split(' ').Any(item => oSession.url.Contains(item) == false))
                {
                    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.IsNullOrEmpty(httpitem.Postdata) == false)
            {
                httpitem.Method = MethodType.POST;
                ControlExtended.UIInvoke(() => Documents.Add(httpitem));
            }


            if (string.IsNullOrEmpty(ContentFilter) == false)
            {
                if (ContentFilter.Split(' ').Any(item => oSession.GetResponseBodyAsString().Contains(item) == false))
                {
                    return;
                }
            }


            httpitem.DictCopyTo(Http);
            XLogSys.Print.Info("已经成功获取嗅探字段" + oSession.url);
        }