Use Android as Rubber Ducky against targeted Android device or PC
Using Android as Rubber Ducky against Android or Windows. This is not a new technique, just a demo how to perform HID attack using Android instead of rubber ducky. For targeted Android device it is not necessary to be rooted, have ADB/USB debugging enabled and device authorized, since attacker's smartphone behaves as connected keyboard.
hid_attack - script contains customized commands that are executed (typed) against targeted Android device hid_pc - script contains customized commands that are executed (typed) against targeted Windows 10
- charge you smartphone using you own adapter
- use none trivial PIN or password lockscreen protection
- use mobile security software that will detect and prevent from launching payloads
- Don't let anyone charge their smartphones in your PC
- Use security software that will detect Metasploit payload
- USB condom should help
Android: https://youtu.be/aOWr6rWhsIs
PC: https://youtu.be/PJbqZm73MOc
- rooted Android with HID kernel support (e.g. NetHunter ROM)
- OTG cable
In the video was used "part1/msf_install" PoC script. Tested payload is removed.
USB Gadget Tool: https://github.com/tejado/android-usb-gadget
HID gadgets: https://github.com/pelya/android-keyboard-gadget/tree/master/hid-gadget-test
For easy access, I copied USB Gadget Tool and HID gadget to https://github.com/androidmalware/android_hid/tree/main/part2
This is custom script, which might not work on your testing case scenario. Because of that, you must play around with pressed keys that are sent to targeted device. Website with my testing payload is not active anymore. List of all possible keys can be found on the link below.
bash hid_attack bash hid_pc
https://github.com/pelya/android-keyboard-gadget
https://github.com/urbanadventurer/Android-PIN-Bruteforce
https://github.com/anbud/DroidDucky/blob/master/droidducky.sh