Beispiel #1
0
    def vmm_virtio(self):
        if self.bdf is not None:
            match = re.search(
                r"^([0-9a-f]{1,2}):([0-1]?[0-9a-f]{1})\.([0-7]{1})$", self.bdf)
            if match:
                _bus = int(match.group(1), 16) & 0xFF
                _dev = int(match.group(2), 16) & 0x1F
                _fun = int(match.group(3), 16) & 0x07
                vid = self.cs.pci.read_word(_bus, _dev, _fun, 0)
                did = self.cs.pci.read_word(_bus, _dev, _fun, 2)
                dev = (_bus, _dev, _fun, vid, did)
                virt_dev = [dev]
            else:
                self.logger.error("Invalid B:D.F ({})".format(self.bdf))
                self.logger.log(VMMCommand.__doc__)
                return
        else:
            self.logger.log("[CHIPSEC] Enumerating VirtIO devices...")
            virt_dev = get_virtio_devices(self.cs.pci.enumerate_devices())

        if len(virt_dev) > 0:
            self.logger.log("[CHIPSEC] Available VirtIO devices:")
            print_pci_devices(virt_dev)
            for (b, d, f, vid, did) in virt_dev:
                VirtIO_Device(self.cs, b, d, f).dump_device()
        else:
            self.logger.log("[CHIPSEC] No VirtIO devices found")
Beispiel #2
0
    def run(self, module_argv):
        self.logger.start_test( "Tool to overlap and fuzz MMIO spaces of available PCIe devices" )

        pcie_devices = []
        self.logger.log( "[*] Enumerating available PCIe devices.." )
        pcie_devices = self.cs.pci.enumerate_devices()

        self.logger.log( "[*] About to fuzz the following PCIe devices.." )
        print_pci_devices( pcie_devices )
        self.fuzz_overlap_pcie_device( pcie_devices )

        return ModuleResult.PASSED
def run( module_argv ):
    logger.start_test( "Tool to overlap and fuzz MMIO spaces of available PCIe devices" )

    pcie_devices = []
    logger.log( "[*] Enumerating available PCIe devices.." )
    pcie_devices = cs.pci.enumerate_devices()

    logger.log( "[*] About to fuzz the following PCIe devices.." )
    pci.print_pci_devices( pcie_devices )
    fuzz_overlap_pcie_device( pcie_devices )

    return True
    def run(self, module_argv):
        self.logger.start_test( "Tool to overlap and fuzz MMIO spaces of available PCIe devices" )

        pcie_devices = []
        self.logger.log( "[*] Enumerating available PCIe devices.." )
        pcie_devices = self.cs.pci.enumerate_devices()

        self.logger.log( "[*] About to fuzz the following PCIe devices.." )
        pci.print_pci_devices( pcie_devices )
        self.fuzz_overlap_pcie_device( pcie_devices )

        return ModuleResult.PASSED
Beispiel #5
0
def run( module_argv ):
    logger.start_test( "Tool to overlap and fuzz MMIO spaces of available PCIe devices" )

    pcie_devices = []
    logger.log( "[*] Enumerating available PCIe devices.." )
    pcie_devices = cs.pci.enumerate_devices()

    logger.log( "[*] About to fuzz the following PCIe devices.." )
    pci.print_pci_devices( pcie_devices )
    fuzz_overlap_pcie_device( pcie_devices )

    return True
Beispiel #6
0
def run( module_argv ):
    logger.start_test( "PCIe device fuzzer (pass-through devices)" )

    pcie_devices = []
    if len(module_argv) > 2:
        _bus = int(module_argv[0],16)
        _dev = int(module_argv[1],16)
        _fun = int(module_argv[2],16)
        pcie_devices.append( (_bus, _dev, _fun, 0, 0) )
    else:
        logger.log( "[*] Enumerating available PCIe devices.." )
        pcie_devices = cs.pci.enumerate_devices()

    logger.log( "[*] About to fuzz the following PCIe devices.." )
    pci.print_pci_devices( pcie_devices )
    for (b, d, f, vid, did) in pcie_devices:
        logger.log( "[+] Fuzzing device %02X:%02X.%X" % (b, d, f) )
        fuzz_pcie_device( b, d, f )

    return True
Beispiel #7
0
def run(module_argv):
    logger.start_test("PCIe device fuzzer (pass-through devices)")

    pcie_devices = []
    if len(module_argv) > 2:
        _bus = int(module_argv[0], 16)
        _dev = int(module_argv[1], 16)
        _fun = int(module_argv[2], 16)
        pcie_devices.append((_bus, _dev, _fun, 0, 0))
    else:
        logger.log("[*] Enumerating available PCIe devices..")
        pcie_devices = cs.pci.enumerate_devices()

    logger.log("[*] About to fuzz the following PCIe devices..")
    pci.print_pci_devices(pcie_devices)
    for (b, d, f, vid, did) in pcie_devices:
        logger.log("[+] Fuzzing device %02X:%02X.%X" % (b, d, f))
        fuzz_pcie_device(b, d, f)

    return True
Beispiel #8
0
    def run(self, module_argv):
        self.logger.start_test( "PCIe device fuzzer (pass-through devices)" )

        pcie_devices = []
        if len(module_argv) > 2:
            _bus = int(module_argv[0],16)
            _dev = int(module_argv[1],16)
            _fun = int(module_argv[2],16)
            pcie_devices.append( (_bus, _dev, _fun, 0, 0) )
        else:
            self.logger.log( "[*] Enumerating available PCIe devices.." )
            pcie_devices = self.cs.pci.enumerate_devices()

        self.logger.log( "[*] About to fuzz the following PCIe devices.." )
        print_pci_devices( pcie_devices )
        for (b, d, f, vid, did) in pcie_devices:
            self.logger.log( "[+] Fuzzing device {:02X}:{:02X}.{:X}".format(b, d, f) )
            self.fuzz_pcie_device( b, d, f )

        return ModuleResult.PASSED
Beispiel #9
0
    def run(self, module_argv):
        self.logger.start_test("PCIe device fuzzer (pass-through devices)")

        pcie_devices = []
        if len(module_argv) > 2:
            _bus = int(module_argv[0], 16)
            _dev = int(module_argv[1], 16)
            _fun = int(module_argv[2], 16)
            pcie_devices.append( (_bus, _dev, _fun, 0, 0) )
        else:
            self.logger.log("[*] Enumerating available PCIe devices..")
            pcie_devices = self.cs.pci.enumerate_devices()

        self.logger.log("[*] About to fuzz the following PCIe devices..")
        print_pci_devices(pcie_devices)
        for (b, d, f, _, _) in pcie_devices:
            self.logger.log( "[+] Fuzzing device {:02X}:{:02X}.{:X}".format(b, d, f) )
            self.fuzz_pcie_device(b, d, f)

        self.logger.log_warning('System may be in an unknown state, further evaluation may be needed.')
        return ModuleResult.WARNING
Beispiel #10
0
 def pci_enumerate(self):
     self.logger.log( "[CHIPSEC] Enumerating available PCIe devices..." )
     print_pci_devices( self.cs.pci.enumerate_devices() )