- Learning Python for Forensics
- Preston Miller Chapin Bryce
- 124字
- 2021-08-20 10:17:10
Running the script
We now have a script that takes a setupapi.dev.log file, as found on Windows 7, and outputs USB entries with their associated timestamps. The following screenshot shows how we can execute the script with a sample setupapi.dev.log file, which has been provided in the code bundle. Your output may vary depending on the setupapi.dev.log file you use the script on:
![](https://epubservercos.yuewen.com/F9A585/19470382208827306/epubprivate/OEBPS/Images/fd0d7ec0-c1ba-472c-b53b-cfb780f8fa95.png?sign=1739048005-RCLquywM55f8sXPtD8vOAHG1yBMED2u3-0-6da676aeb06fe3b75403f223d7dc2b42)
Since setupapi.dev.log has numerous entries, we have pulled out two additional snippets from our command's output that focus on USB and USBSTOR devices:
![](https://epubservercos.yuewen.com/F9A585/19470382208827306/epubprivate/OEBPS/Images/e0a7af39-e28b-49c8-9e83-af8c7cdd65cf.png?sign=1739048005-3E1KIsHASE58WqgsWJIEk5zIYlDOxExP-0-4154daf75d5696f49fd4dc9a35594f66)
Our second snippet shows some details from the USBSTOR entries:
![](https://epubservercos.yuewen.com/F9A585/19470382208827306/epubprivate/OEBPS/Images/9f38a21a-037f-423c-b936-0f6172b92655.png?sign=1739048005-9NNa6kO8FAuFWhmMaCO8pcSUZM7xFeys-0-f1b96252f54221dff8a56ea7ef827123)
Our current iteration seems to generate some false positives by extracting responsive lines that do not pertain solely to USB devices; let's see how we can address that.