Files
SecGen/lib/schemas/vulnerability_metadata_schema.xsd
Z. Cliffe Schreuders 406e65a140 ctf metadata update
2021-11-29 16:20:35 +00:00

316 lines
16 KiB
XML

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.github/cliffe/SecGen/vulnerability"
xmlns="http://www.github/cliffe/SecGen/vulnerability"
elementFormDefault="qualified">
<!-- Vulnerability Privilege levels -->
<!-- *_r (read): permission to read files as a user / root -->
<!-- *_rw (read & write): permission to read and write to files as a user / root -->
<!-- *_rwx (read, write & execute): shell level access -->
<xs:simpleType name="privlegeOptions">
<xs:restriction base="xs:string">
<xs:enumeration value="info_leak"/>
<xs:enumeration value="user_rw"/>
<xs:enumeration value="user_rwx"/>
<xs:enumeration value="root_r"/>
<xs:enumeration value="root_rw"/>
<xs:enumeration value="root_rwx"/>
<xs:enumeration value="various"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="accessOptions">
<xs:restriction base="xs:string">
<xs:enumeration value="remote"/>
<xs:enumeration value="local"/>
<xs:enumeration value="physical"/>
<xs:enumeration value="user_action"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="platformOptions">
<xs:restriction base="xs:string">
<xs:enumeration value="linux"/>
<xs:enumeration value="unix"/>
<xs:enumeration value="windows"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="difficultyOptions">
<xs:restriction base="xs:string">
<xs:enumeration value="low"/>
<xs:enumeration value="medium"/>
<xs:enumeration value="high"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="challengeTypeOptions">
<xs:restriction base="xs:string">
<xs:enumeration value="crypto"/>
<xs:enumeration value="web"/>
<xs:enumeration value="reverse"/>
<xs:enumeration value="forensic"/>
<xs:enumeration value="pwn"/>
<xs:enumeration value="misc"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CVEregexp">
<xs:restriction base="xs:string">
<xs:pattern value="CVE-[0-9]{4}-[0-9]{1,39}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="oneDecimalPlace">
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="1"/>
</xs:restriction>
</xs:simpleType>
<!-- Base Vector String:-->
<!-- Example 1: 'AV:L/AC:H/Au:N/C:N/I:P/A:C'-->
<!-- Access Vector: L = Local access, A = adjacent access, N = network access-->
<!-- Access Complexity: H = High, M = Medium, L = Low-->
<!-- Authentication: N = None required, S = Single instance, M = Multi instance-->
<!-- Confidentiality Impact: N = None, P = Partial, C = Complete-->
<!-- Integrity Impact: N = None, P = Partial, C = Complete-->
<!-- Availability Impact: N = None, P = Partial, C = Complete-->
<xs:simpleType name="CVSSregexp">
<xs:restriction base="xs:string">
<xs:pattern value="AV:(L|A|N)/AC:(H|M|L)/Au:(M|S|N)/C:(N|P|C)/I:(N|P|C)/A:(N|P|C)"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="MSFregexp">
<xs:restriction base="xs:string">
<xs:pattern value="(exploit|auxiliary)/[a-zA-Z0-9_\-/]+"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="randType">
<xs:restriction base="xs:string">
<xs:enumeration value="one_from_list"/>
<xs:enumeration value="flag_value"/>
<xs:enumeration value="none"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="encodeType">
<xs:restriction base="xs:string">
<xs:enumeration value="MD5"/>
<xs:enumeration value="base64"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="InputElements">
<xs:sequence>
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name='vulnerability' type='VulnerabilityType' minOccurs='0' maxOccurs='unbounded' />
<xs:element name='service' type='ServiceBuildUtilityEncoderGeneratorType' minOccurs='0' maxOccurs='unbounded' />
<xs:element name='utility' type='ServiceBuildUtilityEncoderGeneratorType' minOccurs='0' maxOccurs='unbounded' />
<xs:element name='build' type='ServiceBuildUtilityEncoderGeneratorType' minOccurs='0' maxOccurs='unbounded' />
<xs:element name='network' type='NetworkType' minOccurs='0' maxOccurs='unbounded' />
<xs:element name='generator' type='ServiceBuildUtilityEncoderGeneratorType' minOccurs='0' maxOccurs='unbounded' />
<xs:element name='encoder' type='ServiceBuildUtilityEncoderGeneratorType' minOccurs='0' maxOccurs='unbounded' />
<xs:element name='value' type='xs:string' minOccurs='0' maxOccurs='unbounded' />
</xs:choice>
</xs:sequence>
<xs:attribute name='into' type='xs:string'/>
</xs:complexType>
<xs:complexType name="VulnerabilityType">
<xs:sequence>
<xs:element name="input" type="InputElements" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="module_path" type="xs:string"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="author" type="xs:string"/>
<xs:attribute name="module_license" type="xs:string"/>
<xs:attribute name="description" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="privilege" type="xs:string"/>
<xs:attribute name="access" type="xs:string"/>
<xs:attribute name="platform" type="xs:string"/>
<!--optional challenge details-->
<xs:attribute name="challenge_type" type="xs:string"/>
<xs:attribute name="challenge_subtype" type="xs:string"/>
<xs:attribute name="difficulty" type="xs:string"/>
<!--optional vulnerability inputs-->
<xs:attribute name="read_fact" type="xs:string"/>
<!--optional vulnerability details-->
<xs:attribute name="cve" type="xs:string"/>
<xs:attribute name="cvss_base_score" type="xs:string"/>
<xs:attribute name="cvss_vector" type="xs:string"/>
<xs:attribute name="reference" type="xs:string"/>
<xs:attribute name="software_name" type="xs:string"/>
<xs:attribute name="software_license" type="xs:string"/>
<!--optional breadcrumb (info that is leaked and required to exploit)-->
<xs:attribute name="breadcrumb" type="xs:string"/>
<!--optional hints-->
<xs:attribute name="msf_module" type="xs:string"/>
<xs:attribute name="hint" type="xs:string"/>
<xs:attribute name="solution" type="xs:string"/>
</xs:complexType>
<xs:complexType name="ServiceBuildUtilityEncoderGeneratorType">
<xs:sequence>
<xs:element name="input" type="InputElements" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
<xs:attribute name="module_path" type="xs:string"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="author" type="xs:string"/>
<xs:attribute name="module_license" type="xs:string"/>
<xs:attribute name="description" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name="platform" type="xs:string"/>
<xs:attribute name="reference" type="xs:string"/>
<xs:attribute name="software_name" type="xs:string"/>
<xs:attribute name="software_license" type="xs:string"/>
</xs:complexType>
<xs:complexType name="NetworkType">
<xs:attribute name="module_path" type="xs:string"/>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="author" type="xs:string"/>
<xs:attribute name="module_license" type="xs:string"/>
<xs:attribute name="description" type="xs:string"/>
<xs:attribute name="type" type="xs:string"/>
<xs:attribute name='range' type='xs:string'/>
</xs:complexType>
<xs:element name="vulnerability">
<xs:complexType>
<xs:sequence>
<!--required SecGen module details-->
<xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="author" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="module_license" minOccurs="1" maxOccurs="unbounded">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="MIT"/>
<xs:enumeration value="Apache v2"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="description" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="type" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="privilege" type="privlegeOptions" minOccurs="1" maxOccurs="1"/>
<xs:element name="access" type="accessOptions" minOccurs="1" maxOccurs="1"/>
<xs:element name="platform" type="platformOptions" minOccurs="1" maxOccurs="1"/>
<!--optional challenge details-->
<xs:element name="challenge_type" type="challengeTypeOptions" minOccurs="0" maxOccurs="1"/>
<xs:element name="challenge_subtype" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="difficulty" type="difficultyOptions" minOccurs="0" maxOccurs="1"/>
<!--optional input values-->
<xs:element name="read_fact" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="default_input" type="InputElements" minOccurs="0" maxOccurs="unbounded" />
<!--optional vulnerability details-->
<xs:element name="cve" type="CVEregexp" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="cvss_base_score" type="oneDecimalPlace" minOccurs="0" maxOccurs="1"/>
<xs:element name="cvss_vector" type="CVSSregexp" minOccurs="0" maxOccurs="1"/>
<xs:element name="reference" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="software_name" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="software_license" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<!--optional breadcrumb (info that is leaked and required to exploit)-->
<xs:element name="breadcrumb" type="xs:string" minOccurs="0" maxOccurs="1"/>
<!--optional hints-->
<xs:element name="msf_module" type="MSFregexp" minOccurs="0" maxOccurs="1"/>
<xs:element name="hint" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="solution" type="xs:string" minOccurs="0" maxOccurs="1"/>
<!-- cannot co-exist with a system matching ALL of the optionally specified values (can be repeated for OR)-->
<xs:element name="conflict" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="module_path" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="author" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="module_license" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="type" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="privilege" type="privlegeOptions" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="access" type="accessOptions" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="platform" type="platformOptions" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="challenge_type" type="challengeTypeOptions" minOccurs="0" maxOccurs="1"/>
<xs:element name="challenge_subtype" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="difficulty" type="difficultyOptions" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="cve" type="CVEregexp" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="cvss_base_score" type="oneDecimalPlace" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="cvss_vector" type="CVSSregexp" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="reference" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="software_name" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="software_license" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="breadcrumb" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="msf_module" type="MSFregexp" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="hint" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="solution" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- must co-exist with a system matching ALL of the optionally specified values (can be repeated for OR)-->
<!-- if a scenario does not include one already, the first match (randomly) found will be added before this module-->
<xs:element name="requires" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="module_path" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="name" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="author" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="module_license" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="type" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="privilege" type="privlegeOptions" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="access" type="accessOptions" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="platform" type="platformOptions" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="challenge_type" type="challengeTypeOptions" minOccurs="0" maxOccurs="1"/>
<xs:element name="challenge_subtype" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="difficulty" type="difficultyOptions" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="cve" type="CVEregexp" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="cvss_base_score" type="oneDecimalPlace" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="cvss_vector" type="CVSSregexp" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="reference" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="software_name" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="software_license" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="breadcrumb" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="msf_module" type="MSFregexp" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="hint" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="solution" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CyBOK" type="CyBOKType" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="CyBOKType">
<xs:sequence>
<xs:element name="keyword" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="KA" type="xs:string" use="required"/>
<xs:attribute name="topic" type="xs:string"/>
</xs:complexType>
</xs:schema>