Ejemplo n.º 1
0
        public ExploitDetails(XElement exploit)
        {
            Dbms              = XmlHelpers.GetAttributeValue <string>(exploit, "dbms", string.Empty);
            Name              = XmlHelpers.GetAttributeValue <string>(exploit, "name", string.Empty);
            UserFriendlyName  = XmlHelpers.GetAttributeValue <string>(exploit, "user-friendly-name", string.Empty);
            TrimLast          = XmlHelpers.GetAttributeValue <bool>(exploit, "trim-last", false);
            InjectionStrategy = XmlHelpers.GetAttributeValue <string>(exploit, "injection-strategy", string.Empty);

            Exploit = XmlHelpers.GetElementValue <string>(exploit.Descendants("value").SingleOrDefault(), string.Empty);

            if (exploit.Descendants("result").SingleOrDefault() != null)
            {
                ResultStart = XmlHelpers.GetElementValue <string>(exploit.Descendants("result").SingleOrDefault()
                                                                  .Descendants("start").SingleOrDefault(),
                                                                  string.Empty);
                ResultEnd = XmlHelpers.GetElementValue <string>(exploit.Descendants("result").SingleOrDefault()
                                                                .Descendants("end").SingleOrDefault(),
                                                                string.Empty);
            }

            if (exploit.Descendants("error").SingleOrDefault() != null)
            {
                ErrorStart = XmlHelpers.GetElementValue <string>(exploit.Descendants("error").SingleOrDefault()
                                                                 .Descendants("start").SingleOrDefault(),
                                                                 string.Empty);
                ErrorEnd = XmlHelpers.GetElementValue <string>(exploit.Descendants("error").SingleOrDefault()
                                                               .Descendants("end").SingleOrDefault(),
                                                               string.Empty);
                ErrorValue = XmlHelpers.GetElementValue <string>(exploit.Descendants("error").SingleOrDefault()
                                                                 .Descendants("value").SingleOrDefault(),
                                                                 string.Empty);
            }
        }
Ejemplo n.º 2
0
        public PayloadDetails(XElement payload)
        {
            ParentNodeToMapTo = XmlHelpers.GetAttributeValue <string>(payload, "map-to-parent", string.Empty);
            NodeToMapTo       = XmlHelpers.GetAttributeValue <string>(payload, "map-to-node", string.Empty);
            MapToParams       = XmlHelpers.GetAttributeValue <string>(payload, "map-to-params", string.Empty);
            AttributeToMapTo  = XmlHelpers.GetAttributeValue <string>(payload, "map-to-attribute", string.Empty);

            Dbms               = XmlHelpers.GetAttributeValue <string>(payload, "dbms", string.Empty);
            Name               = XmlHelpers.GetAttributeValue(payload, "name");
            UserFriendlyName   = XmlHelpers.GetAttributeValue(payload, "user-friendly-name");
            ExpectedResultType = (ExpectedResultType)Enum.Parse(typeof(ExpectedResultType),
                                                                XmlHelpers.GetAttributeValue(payload, "expected-result-type"), true);
            Payload = payload.Descendants("value").SingleOrDefault().Value;
            Params  = new List <PayloadParam>();
            var paramElems = payload.Descendants("params").Descendants("param");

            foreach (var param in paramElems)
            {
                Params.Add(new PayloadParam()
                {
                    Name     = XmlHelpers.GetAttributeValue(param, "name"),
                    Position = XmlHelpers.GetAttributeValue <int>(param, "position", 0)
                });
            }
        }
Ejemplo n.º 3
0
 public PatternDetails(XElement pattern)
 {
     Dbms  = XmlHelpers.GetAttributeValue <string>(pattern, "dbms", string.Empty);
     Value = pattern.Value;
 }