Пример #1
0
        private void InterceptRequest(Session session)
        {
            if (!session.hostname.EndsWith(s3Configuration.ServiceUrl))
              {
            return;
              }

              if (session.HTTPMethodIs("CONNECT"))
              {
            session.oFlags["x-replywithtunnel"] = "fake tunnel";
            return;
              }

              string bucket = string.Empty;
              if (!session.HostnameIs(s3Configuration.ServiceUrl))
              {
            string virtualHostedPath = session.hostname.Replace("." + s3Configuration.ServiceUrl, string.Empty);
            bucket = "/" + virtualHostedPath;
              }

              if(session.isHTTPS)
              {
            session.fullUrl = session.fullUrl.Replace("https", "http");
              }
              session.host = string.Format("127.0.0.1:{0}", s3Configuration.HostPort);
              session.PathAndQuery = string.Format("{0}{1}", bucket, session.PathAndQuery);
        }
Пример #2
0
        public void AutoTamperRequestBefore(Session oSession)
        {
            // http:443 프로토콜 체크
            if (PLinkCore.PLink.host.isHttpsFilter) { checkHttpsFilter(oSession); }

            // api 모드 적용
            if (oSession.HostnameIs("api.plink")) {
                runApiMode(oSession);
                return;
            }

            // PLink host 변조 적용
            if (PLinkCore.PLink.host.StartState) {
                checkHost(oSession);
            }
        }
        public void AutoTamperRequestBefore(Session session)
        {
            if (Settings.enabled && session.HostnameIs(reportHost) && !session.isFTP)
            {
                // TODO: We should offer an option to hide the reports from Fiddler; change "ui-strikeout" to "ui-hide" in the next line
                session["ui-strikeout"] = "CSPReportGenerator";

                if (!session.HTTPMethodIs("CONNECT"))
                {
                    session.utilCreateResponseAndBypassServer();
                    session.oResponse.headers.Add("Content-Type", "text/html");
                    session.ResponseBody = Encoding.UTF8.GetBytes("<!doctype html><HTML><BODY><H1>Report received.</H1></BODY></HTML>");

                    ProcessCSPReport(session);
                }
                else
                {
                    session["x-replywithtunnel"] = "CSPReportGenerator";
                }
            }
        }
Пример #4
0
        void OnFiddlerSessionComplete(Session oSession)
        {
            if (configuration == null || !configuration.HostsToIntercept.Any(host => oSession.HostnameIs(host)))
            {
                return;
            }

            lock (sessionsLock)
            {
                sessions.Add(oSession);
            }

            var session = new FiddlerHttpSession(oSession);
            OnSessionComplete?.Invoke(this, new HttpSessionCompleteEventArgs(session));
        }
Пример #5
0
        public void AutoTamperRequestBefore(Session oSession)
        {
            // 캐쉬 적용하지 않기
            if (disabledCache){ SetDiabledCache(oSession); }

            // http:443 프로토콜 체크
            if (PLinkCore.PLink.host.isHttpsFilter) { checkHttpsFilter(oSession); }

            log(getSessionString(oSession));

            // api 모드 적용
            if (oSession.HostnameIs("api.plink")) {
                runApiMode(oSession);
                return;
            }

            // PLink host 변조 적용
            if (PLinkCore.PLink.host.StartState) {
                checkHost(oSession);
            }

            log(oSession.fullUrl);
        }