How to change the keyboard language on a BadUSB
// Disclaimer // Hacking without permission is illegal. This file is strictly
educational for learning about cyber-security in the areas of ethical
hacking and penetration testing so that we can protect ourselves against
the real hackers.
Downloading Arduino
Go to https://www.arduino.cc/en/software and download the program.
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.44.43.png)
Then install it.
Run the program.
When Arduino is running go in under the following:
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.44.56.png)
Type Key in the “Filter your search…”
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.45.19.png)
And install Keyboard by Arduino.
BadUSB preparation
Insert your BadUSB in any port on your computer and let windows accept it.
In Arduino select the following:
LilyPad Arduino USB like this (Mine already shows it, as I already have installed it)
Select other board and port…
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.47.15.png)
Now write Lily in the search bar and pick
“LilyPad Arduino USB”
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.47.28.png)
Press ok and your Arduino should (if it does not, that is ok) now look like this:
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.47.39.png)
Downloading the file
Now download this file:
https://ufile.io/dkqu2lmi
Password is: zsecurity.org
No, it is not a virus, or else Zsecurity will cut me off from helping people.
Now copy that file to a different folder on your computer and run it.
Accept everything Arduino Ide tells you.
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.47.52.png)
Your screen should look like this:
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.48.03.png)
Keyboard language change
Now comes the hard part:
Changing the language of your BadUsb.
Scroll down to where it reads:
#include <Keyboard.h>
Hover your cursor over the keyboard.h and a link will show up. (mine may be different from yours).
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.48.15.png)
Mine reads:
D:\OneDrive\Dokumenter\Arduino\libraries\Keyboard\src\Keyboard.h
But yours may be different, now remove Keyboard.k, so it looks like this
D:\OneDrive\Dokumenter\Arduino\libraries\Keyboard\src\
And open it up in a window folder.
It will look like this:
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.48.29.png)
Right click on Keyboard and pick edit/rediger
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.48.40.png)
And this will open:
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-18-at-14.17.58.png)
Now scroll down to where it reads:
void begin(const uint8_t *layout = KeyboardLayout_en_US);
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.49.07.png)
Change the KeyboardLayout_en_US with what keyboard you want to use.
There is only a few here to pick from:
KeyboardLayout_de_DE
KeyboardLayout_en_US
KeyboardLayout_es_ES
KeyboardLayout_fr_FR
KeyboardLayout_it_IT
KeyboardLayout_pt_PT
KeyboardLayout_sv_SE
KeyboardLayout_da_DK
KeyboardLayout_hu_HU
In my case I will pick KeyboardLayout_da_DK as I am from Denmark and the line will look like this:
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.49.47.png)
Now save the file and you are done.
Conclusion
BUT, it is not possible to use special characters like æ ø å and the likes, but as it is only
used on a computer with normal programming language, it won’t matter, unless you are
making folders with special characters.
Now in Arduino IDE, while having your BadUSB in, press the upload button and after that, your BadUSB is ready to go.
![](https://zsecurity.org/wp-content/uploads/2024/07/Screenshot-2024-07-16-at-14.49.58.png)
Have fun and stay Legal.
SK2073
Helper At Zsecurity.org
Tag:bad usb, cyber security, hacking, hardware, keyboard, language, Pentesting, security, usb