I have created a workaround to fix a problem that can occur on a Windows PC when UAC pops up, and your focus doesn't follow with the UAC window. For example, when I try to start an elevated powershell, using the windows "run" box, and typing "powershell Start-Process cmd -Verb runAs"; the UAC box pops up for your to click no or yes however the focus is on the shell behind the pop-up box.
In order to fix this, you have to "enable" a security policy. To do this, run secpol.msc from the run prompt. Then go to { Security Settings > Local Policies > User Account Control: Switch to the secure desktop when prompting for elevantion }, and click for it to be enabled.
Currently, I do this using the ducky script below. However, what I'd like to do, is see if there is a shorter way of changing this setting. Also I'd like to know if there is a way I can just set the policy to be enabled, because currently if the setting is already enabled, this script will change the setting to disabled. So there is my problem, please help me fix it.
REM change sec policy on window focus
DELAY 1000
GUI r
DELAY 100
STRING secpol.msc
ENTER
DELAY 2500
SHIFT DOWNARROW
SHIFT DOWNARROW
SHIFT RIGHTARROW
SHIFT DOWNARROW
SHIFT DOWNARROW
SHIFT DOWNARROW
DELAY 700
SHIFT TAB
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT UPARROW
ENTER
DELAY 500
SHIFT UPARROW
ENTER
DELAY 500
ALT F
STRING X
Enable a Security Policy To Focus Window
in Classic USB Rubber Ducky
Posted
I have created a workaround to fix a problem that can occur on a Windows PC when UAC pops up, and your focus doesn't follow with the UAC window. For example, when I try to start an elevated powershell, using the windows "run" box, and typing "powershell Start-Process cmd -Verb runAs"; the UAC box pops up for your to click no or yes however the focus is on the shell behind the pop-up box.
In order to fix this, you have to "enable" a security policy. To do this, run secpol.msc from the run prompt. Then go to { Security Settings > Local Policies > User Account Control: Switch to the secure desktop when prompting for elevantion }, and click for it to be enabled.
Currently, I do this using the ducky script below. However, what I'd like to do, is see if there is a shorter way of changing this setting. Also I'd like to know if there is a way I can just set the policy to be enabled, because currently if the setting is already enabled, this script will change the setting to disabled. So there is my problem, please help me fix it.
REM change sec policy on window focus
DELAY 1000
GUI r
DELAY 100
STRING secpol.msc
ENTER
DELAY 2500
SHIFT DOWNARROW
SHIFT DOWNARROW
SHIFT RIGHTARROW
SHIFT DOWNARROW
SHIFT DOWNARROW
SHIFT DOWNARROW
DELAY 700
SHIFT TAB
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT PAGEDOWN
SHIFT UPARROW
ENTER
DELAY 500
SHIFT UPARROW
ENTER
DELAY 500
ALT F
STRING X