Windows – Automatically disable devices to save power and mitigate DMA attack in Windows 7

energy-savingpower-managementwindows 7

Some OEM include energy saving apps that can switch off certain devices such as webcam or optical drive. Is there any brand-agnostic app out there that can do it? If the list of disabled device is customizable, it would be useful too for mitigating DMA attack (disabling Firewire, PCMCIA, SDIO, Thunderbolt, etc). Even better if it can recognize lock/logoff event, to mimic OSX behavior in mitigating the DMA attack.

Best Answer

You can disable hardware devices via commandline
I am not sure that merely disabling a device is sufficient to mitigate the DMA attack

Microsoft provides devcon as a command line device management tool

Get It

  1. Obtain the Windows Driver Kit (WDK) 7.1.0 from Microsoft.
  2. Extract the ISO to a temporary file.
  3. Expand the windows installer file “”WDK\setuptools_x64fre.msi“” to a temp directory.
  4. devcon is located in “drive:\your\temp\folder\WinDDK\7600.16385.win7_wdk.100208-1538\tools\devcon\amd64\".

Use It

  1. Find the device you want to manage. Ex: devcon find * | find "DVD"
  2. Disable the device ID returned. Ex: devcon disable PCI\VEN_1102

Automate It

  1. Collect the IDs for all devices you wish to disable
  2. Add the commands to disable the devices to a simple batch file
  3. Call the batch file from a logoff script.
  4. Reverse the commands and add them to another batch file.
  5. Call this batch file from a logon script.

Note: it may be possible to do this using only powershell but I wasn't able to find the correct calls. The closest I found was get-wmiobject Win32_PNPEntity