To protect against BadUSB key stroke injection attacks, it seems logical to require a password to access a command line with admin privileges. This can be done by modifying the "Value Data" of the following Registry Key to be 1
:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\ConsentPromptBehaviorAdmin
As documented: "This option prompts the Consent Admin to enter his or her user name and password (or another valid admin) when an operation requires elevation of privilege. This operation occurs on the secure desktop"
This will prevent any unauthorised system modifications via the command line.
However, the Registry Editor itself doesn't require any password to access it, and a BadUSB attack could just assume that the protection measure above had been done, and therefore modify the key to the default 4
so that a password would not be required to access a command line with admin privileges.
So is there a way to protect the Registry Editor by requiring a password to open it?
HKEY_LOCAL_MACHINE
. They can however change things inHKEY_CURRENT_USER
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
for your account and deny keys values edit. But in such case you should edit permissions when you need to alter something, or execute regedit under another admin account.