public PassiveCheckResult RunCheck(Fiddler.Session fiddlerSession)
        {
            if (fiddlerSession.isHTTPS && fiddlerSession.oResponse.headers.Exists("set-cookie"))
            {
                string cookie = fiddlerSession.oResponse.headers["set-cookie"];

                if (cookie != null && cookie.Length > 0)
                {
                    string[] parts      = cookie.Split(';');
                    string   cookiename = parts[0];
                    cookiename = cookiename.Split('=')[0];

                    if (parts != null && parts.Length > 0)
                    {
                        bool isDomainSet = false;

                        parts.ForEach(v =>
                        {
                            if (v.Trim().ToLower().StartsWith("domain"))
                            {
                                isDomainSet = true;
                            }
                        });

                        if (!isDomainSet)
                        {
                            return(PassiveCheckResult.CreateFailure(this, fiddlerSession.fullUrl, "Cookie not marked with domain"));
                        }
                    }
                }
            }

            return(PassiveCheckResult.CreatePass(this, fiddlerSession.fullUrl));
        }
Esempio n. 2
0
        public PassiveCheckResult RunCheck(Session fiddlerSession)
        {
            if (!fiddlerSession.isHTTPS)
            {
                if (fiddlerSession.uriContains("login"))
                {
                    return(PassiveCheckResult.CreateFailure(this, fiddlerSession.url));
                }
            }

            return(PassiveCheckResult.CreatePass(this, fiddlerSession.url));
        }
        public PassiveCheckResult RunCheck(Fiddler.Session fiddlerSession)
        {
            if (fiddlerSession.isHTTPS)
            {
                if (fiddlerSession.oResponse.headers.Exists("cache-control"))
                {
                    string cc = fiddlerSession.oResponse.headers["cache-control"].Trim().ToLower();
                    if (!cc.Contains("no-store"))
                    {
                        return(PassiveCheckResult.CreateFailure(this, fiddlerSession.url, "Cache-Control header does not contain 'no-store'"));
                    }
                    else if (!cc.Contains("no-cache"))
                    {
                        return(PassiveCheckResult.CreateFailure(this, fiddlerSession.url, "Cache-Control header does not contain 'no-cache'"));
                    }
                }
                else
                {
                    return(PassiveCheckResult.CreateFailure(this, fiddlerSession.url, "No Cache-Control header found"));
                }
            }

            return(PassiveCheckResult.CreatePass(this, fiddlerSession.url));
        }
Esempio n. 4
0
 public PassiveCheckResult RunCheck(Fiddler.Session fiddlerSession)
 {
     return(fiddlerSession.isHTTPS ? PassiveCheckResult.CreatePass(this, fiddlerSession.url) : PassiveCheckResult.CreateFailure(this, fiddlerSession.url));
 }