Skip to content

Fake a raspberry pi zero w to look like a keyboard to a Windows 10 PC

Notifications You must be signed in to change notification settings

raspberrypisig/pizero-usb-hid-keyboard

Repository files navigation

pizero-usb-hid-keyboard

Procedure I used

Basically, a ripoff of this: https://www.aidanwoods.com/blog/building-a-wifi-enabled-usb-rubber-ducky/

Tested on Raspberry Pi Zero W and a Windows 10 PC (version 1809).

  1. Started with a clean install of Raspbian Buster
  2. Used a Raspberry Pi 3 to setup wifi/keyboard/enable SSH/apt update etc.
  3. Then took SD card out and put into Pi Zero W and booted.
  4. SSHed into Pi and ran the following (after which the pi will power off):
curl -sSL https://raw.githubusercontent.com/raspberrypisig/pizero-usb-hid-keyboard/master/install.sh | sudo bash -
  1. When pi is off, remove power supply and use an ORDINARY(not OTG cable) microUSB to USB cable and plug it in to the USB connector marked USB on the board(the one next to the HDMI connector). Plug other end to Windows PC.
  2. Be patient, eventually Windows sees it as a Generic USB keyboard (ignore device malformed warnings)
  3. On Windows, open notepad
  4. Using another computer, I ssh'd into pi and ran
cd pizero-usb-hid-keyboard
echo 'left-shift h' | ./hid_gadget_test /dev/hidg0 keyboard
echo 'i' | ./hid_gadget_test /dev/hidg0 keyboard

or alternatively

/home/pi/pizero-usb-hid-keyboard/sendkeys.sh left-shift h
/home/pi/pizero-usb-hid-keyboard/sendkeys.sh i
  1. Success! Should see Hi in notepad
  2. Look at https://github.com/raspberrypisig/pizero-usb-hid-keyboard/blob/master/hid-gadget-test.c#L20 for what is possible.

About

Fake a raspberry pi zero w to look like a keyboard to a Windows 10 PC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published