Contains methods for loading Filters from various locations
Inheritance: FilterStorage
Example #1
0
 /// <summary>
 /// Initialise the IDS to scan cookies using the same filters as an already existing IDS object
 /// </summary>
 /// <param name="cookies">The cookie collection to detect intrusions within</param>
 /// <param name="ids">The IDS containing the preloaded filters</param>
 public IDS(System.Web.HttpCookieCollection cookies, IDS ids)
 {
     _store = ids._store;
     _cookies = cookies;
     _report = new Report(RequestType.Cookie);
     
     IsCookie = true;
 }
Example #2
0
        /// <summary>
        /// Initialise the IDS to scan cookies
        /// </summary>
        /// <param name="cookies">The cookie collection to detect intrusions within</param>
        /// <param name="xmlPath">The path to the filters file</param>
        public IDS(System.Web.HttpCookieCollection cookies, string xmlPath)
        {
            XmlDocument xd = new XmlDocument();
            xd.Load(xmlPath);
            _store = new Storage(xd, typeof(RegexFilter));
            _cookies = cookies;
            _report = new Report(RequestType.Cookie);

            IsCookie = true;
        }
Example #3
0
        /// <summary>
        /// Initialise the IDS to scan a GET, POST or other request
        /// </summary>
        /// <param name="request">The Name-Value collection to detect intrusions within</param>
        /// <param name="xmlPath">The path to the filters file</param>
        /// <param name="requestType">Indicates What type of request this is and therefore whether to exclude certain parameters.</param>
        public IDS(NameValueCollection request, string xmlPath, RequestType requestType)
        {
            XmlDocument xd = new XmlDocument();
            xd.Load(xmlPath);
            _store = new Storage(xd, typeof(RegexFilter));
            _request = request;
            _report = new Report(requestType);

            switch (requestType)
            {
                case RequestType.Cookie:
                    IsCookie = true;
                    break;
                case RequestType.Post:
                    IsForm = true;
                    break;
                case RequestType.Header:
                    IsHeader = true;
                    break;
            }
            
        }
Example #4
0
        /// <summary>
        /// Initialise the IDS to scan a GET, POST or other request using the same filters as an already existing IDS object
        /// </summary>
        /// <param name="request">The Name-Value collection to detect intrusions within</param>
        /// <param name="ids">The IDS containing the preloaded filters</param>
        /// <param name="requestType">Indicates What type of request this is and therefore whether to exclude certain parameters.</param>
        public IDS(NameValueCollection request, IDS ids, RequestType requestType)
        {
            _store = ids._store;
            _request = request;
            _report = new Report(requestType);

            switch (requestType)
            {
                case RequestType.Cookie:
                    IsCookie = true;
                    break;
                case RequestType.Post:
                    IsForm = true;
                    break;
                case RequestType.Header:
                    IsHeader = true;
                    break;
            }

        }
Example #5
0
        /// <summary>
        /// Initialise the IDS to scan a GET, POST or other request
        /// </summary>
        /// <param name="request">The Name-Value collection to detect intrusions within</param>
        /// <param name="requestType">Indicates What type of request this is and therefore whether to exclude certain parameters.</param>
        public IDS(NameValueCollection request, RequestType requestType)
        {
            XmlDocument xd = new XmlDocument();
            xd.Load(this.GetType().Assembly.GetManifestResourceStream("IDS.default_filter.xml"));
            _store = new Storage(xd, typeof(RegexFilter));
            _request = request;
            _report = new Report(requestType);

            switch (requestType)
            {
                case RequestType.Cookie:
                    IsCookie = true;
                    break;
                case RequestType.Post:
                    IsForm = true;
                    break;
                case RequestType.Header:
                    IsHeader = true;
                    break;
            }

        }
Example #6
0
 /// <summary>
 /// Initialise the IDS to scan a GET request using the same filters as an already existing IDS object
 /// </summary>
 /// <param name="request">The Name-Value collection to detect intrusions within</param>
 /// <param name="ids">The IDS containing the preloaded filters</param>
 public IDS(NameValueCollection request, IDS ids)
 {
     _store = ids._store;
     _request = request;
     _report = new Report(RequestType.Get);
 }
Example #7
0
 /// <summary>
 /// Initialise the IDS to scan a GET request
 /// </summary>
 /// <param name="request">The Name-Value collection to detect intrusions within</param>
 /// <param name="xmlPath">The path to the filters file</param>
 public IDS(NameValueCollection request, string xmlPath)
 {
     XmlDocument xd = new XmlDocument();
     xd.Load(xmlPath);
     _store = new Storage(xd, typeof(RegexFilter));
     _request = request;
     _report = new Report(RequestType.Get);
 }
Example #8
0
 /// <summary>
 /// Initialise the IDS to scan a GET request
 /// </summary>
 /// <param name="request">The Name-Value collection to detect intrusions within</param>
 public IDS(NameValueCollection request)
 {
     XmlDocument xd = new XmlDocument();
     xd.Load(this.GetType().Assembly.GetManifestResourceStream("IDS.default_filter.xml"));
     _store = new Storage(xd, typeof(RegexFilter));
     _request = request;
     _report = new Report(RequestType.Get);
 }
Example #9
0
 /// <summary>
 /// Initialise the IDS to scan output
 /// </summary>
 /// <param name="oF">An OutputFilter</param>
 internal IDS(OutputFilter oF)
 {
     _store = oF._store;
     _pageOutput = oF.Output;
     _page = oF.Page;
     _report = new Report(RequestType.Output);
     _isRaw = true;
     _oF = oF;
 }