How To: HID Keyboard Attack with Android (Not Kali NetHunter)

HID Keyboard Attack with Android (Not Kali NetHunter)

Hi , Today i will show you how to do HID Keyboard Attacks With Android BUT without using Kali NetHunter BUT You will need to install custom kernel to your Android device, that will add keyboard+mouse functions to it's USB port,So Lets Get Started

Step 1: Prerequisites

For This You Need The Following Things:
1.Rooted Android
2.Custom Recovery(twrp or clockworkmod)
3:ADB Files

Image via

If you Already Have Both then go to and Look For your Device's Kernel and flash the zip file from the Recovery

Step 2: Downloading the Files

Go here and download the files
Push the files with ADB to The Device
with the command : adb push DroidDucky-master data/local/tmp

Step 3: Finding a Payload

Go here and find a Payload that you like(The SD card mounting ones don't work You Could Put the Files in a USB and Plug that in,Instead of the SD card)

Copy-Paste the Script in a TextEditor of your liking(I Prefer Notepad++)

Convert EOL to UNIX (In Notepad++ : Edit > EOL Conversion > UNIX/OSX Format)

Save(file type makes no difference ) and push the file to the Device with the command adb push filename.txt /data/local/tmp

Step 4: Running the Payload

Download a Terminal App Of Your Choice (i prefer juiceSSH)
Connect the Device to the Pc
And run the terminal app
get Superuser Permissions with su
navigate to root directory with cd
go to the directory where the files are stored cd data/local/tmp
use the command bash filename.txt to launch the attack

Image via

Just updated your iPhone? You'll find new features for Podcasts, News, Books, and TV, as well as important security improvements and fresh wallpapers. Find out what's new and changed on your iPhone with the iOS 17.5 update.


But if we could run something like that in every flash drive, that would be great.

there is some research on it but no source code :(

yeah, i saw that one but nothing useful!
i find something for flash drives with 2303 chipset, but that's a rare flash drive!

what type of attack does it do what device's does it target

Depends on the payload you use

Is it work any samrtphones?

First of all : great tutorial !

I've managed to understand all the procedures but I'm somewhat lost about the kernel.

I'm currently working on a Huawei p9 lite dual sim with kernel 3.10.90-g033208c, android 6.0 , MEDROM v2. What kernel patch do I need and how do I get it working ?

Thanks in advance !

I tried it but doesn't work for me .It says syntax error. but when I use usb keyboard app it works fineHelp me please????

Share Your Thoughts

  • Hot
  • Latest