Пример #1
0
 def setUp(self):
     self.md5 = HexBinary(EMPTY_MD5)
     self.sha1 = HexBinary(EMPTY_SHA1)
     self.sha224 = HexBinary(EMPTY_SHA224)
     self.sha256 = HexBinary(EMPTY_SHA256)
     self.sha384 = HexBinary(EMPTY_SHA384)
     self.sha512 = HexBinary(EMPTY_SHA512)
Пример #2
0
    def __create_dns_record_object(self, domain, record_type, nameserver=None):
        """Creates a CybOX DNSRecordType Object"""
        record = self.__get_dns_record(domain, record_type, nameserver)
        if not record:
            return None

        dns_record = DNSRecord()
        dns_record.domain_name = self.__create_domain_name_object(record.get('Domain_Name'))
        dns_record.ip_address = self.__create_ip_address_object(record.get('IP_Address'))
        dns_record.entry_type = String(record.get('Entry_Type'))
        dns_record.flags = HexBinary(record.get('Flags'))
        dns_record.record_data = record.get('Record_Data')

        return dns_record
Пример #3
0
 def test_constructor(self):
     s = HexBinary(EMPTY_MD5)
     h = Hash(s)
Пример #4
0
exports.name = String()
exports.number_of_addresses = Long()
exports.number_of_functions = Integer()
exports.number_of_names = Long()

# The Extraneous_Bytes field specifies the number of extraneous bytes contained in the PE binary.
extraneous_bytes = Integer()

# https://cybox.readthedocs.org/en/stable/_modules/cybox/objects/win_executable_file_object.html#PEHeaders
headers = PEHeaders()
headers.dos_header = DOSHeader()
headers.entropy = Entropy()
headers.file_header = PEFileHeader()
headers.hashes = HashList()
headers.optional_header = PEOptionalHeader()
headers.signature = HexBinary()

# https://cybox.readthedocs.org/en/stable/_modules/cybox/objects/win_executable_file_object.html#PEImportList
imports = PEImportList()

# https://cybox.readthedocs.org/en/stable/_modules/cybox/objects/win_executable_file_object.html#PEChecksum
pe_checksum = PEChecksum()
pe_checksum.pe_computed_api = Long()
pe_checksum.pe_file_api = Long()
pe_checksum.pe_file_raw = Long()

# https://cybox.readthedocs.org/en/stable/_modules/cybox/objects/win_executable_file_object.html#PEResourceList
resources = PEResourceList()

# https://cybox.readthedocs.org/en/stable/_modules/cybox/objects/win_executable_file_object.html#PESectionList
sections = PESectionList()