elkentaro Posted April 8, 2017 Share Posted April 8, 2017 (edited) So with the new firmware 1.1 , we now have extension. Here is my contribution, it sets the input keyboard layout to en-US (US keyboard) to provide an easier way to work with the payloads. Granted there is a DUCKY_LANG option , however its still a bit wanky for me and from reading the forums for some others. This way , you don't need to worry about different layouts. ----------------------------------setkb.sh-------------- #!/bin/bash # # SETKB v1 by @elkentaro # Simplifies executing commands from HID attacks for different language keyboards. on Windows by using Powershell. # Usage: SETKB en-US [give the command the 2 letter combination of keyboard settings] # copy the text of and save it as setkb.sh under /payloads/library/extensions/ # Examples: # SETKB en-US (set the keyboard layout to a US keyboard layout) [usage prior to HID attack] # SETKB ja-JP (set the keyboard layout to a Japanese 106 layout) [usage after HID attack to reset the env] function SETKB() { local kb=$1 shift [[ -z "$kb" ]] && exit 1 # KB keyboard parameter must be given. case "$kb" in 'en-US') QUACK GUI r QUACK DELAY 500 QUACK STRING "powershell.exe Set-WinUserLanguageList -LanguageList en-US -force" QUACK DELAY 1500 QUACK ENTER ;; *) QUACK GUI r QUACK DELAY 500 QUACK "STRING powershell.exe Set-WinUserLanguageList -LanguageList $kb -force" QUACK DELAY 1500 QUACK ENTER ;; esac } export -f SETKB ------------------------------------------------ Minor note: This extension does require that the "-" key is the same key code as the one in us.json . Edited April 9, 2017 by elkentaro 3 Quote Link to comment Share on other sites More sharing options...
EthicalHat Posted April 8, 2017 Share Posted April 8, 2017 And you have to call it at the beginning of any payload like "externsion setkb.sh"? Quote Link to comment Share on other sites More sharing options...
elkentaro Posted April 8, 2017 Author Share Posted April 8, 2017 Not if you are on the new firmware , you can just call it as a command. -----sample payload---- #!/bin/bash ATTACKMODE HID VID_0x05AC PID_0x021d SETKB en-US RUN WIN notepad.exe Q DELAY 5000 Q switch1/quack.txt LED R ------- 1 Quote Link to comment Share on other sites More sharing options...
elkentaro Posted April 17, 2017 Author Share Posted April 17, 2017 New version out. SETKB START will switch it to en-US keyboard, then SETKB DONE will set it back based on windows OS language version, SETKB xx-XX will overwrite to whatever keyboard setting you want. you do have to change the default us.json file to issue a different key code for "-" "-":"00:00:56" Which seems to be the universal key code for "-" on the numpad instead of the keyboard. 2 Quote Link to comment Share on other sites More sharing options...
Drizztfire Posted April 27, 2017 Share Posted April 27, 2017 Hi, Is it possible to specify the InputMethodTips when you set the language. Here's my problem: When i set the language back to fr-CA the default keyboard layout is French Canadian multilingual (InputMethodTips : {0C0C:00011009}) I'd want to set the keyboard layout to French Canadian (InputMethodTips : {0C0C:00001009}) The first is when a set SETKB fr-Ca The second is whan i go manually put French Canadian in the keyboard layout PS C:\Users\user> Get-WinUserLanguageList LanguageTag : fr-CA Autonym : français (Canada) EnglishName : French LocalizedName : Français (Canada) ScriptName : Script latinInputMethodTips : {0C0C:00011009} Spellchecking : True Handwriting : False PS C:\Users\user> Get-WinUserLanguageList LanguageTag : fr-CA Autonym : français (Canada) EnglishName : French LocalizedName : Français (Canada) ScriptName : Script latinInputMethodTips : {0C0C:00001009} Spellchecking : True Handwriting : False Thanks for your help ! 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.