-
Notifications
You must be signed in to change notification settings - Fork 1
/
hid_usb
27 lines (25 loc) · 1.16 KB
/
hid_usb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
source "/opt/Rubber-Ducky-Pi/.vars"
cd /sys/kernel/config/usb_gadget/
mkdir -p hid_usb
cd hid_usb
echo $idVendor > idVendor # Linux Foundation
echo $idProduct > idProduct # Multifunction Composite Gadget
echo $bcdDevice > bcdDevice # v1.0.0
echo $bcdUSB > bcdUSB # USB2
mkdir -p strings/0x409
echo "$serialnumber" > strings/0x409/serialnumber
echo "$manufacturer" > strings/0x409/manufacturer
echo "$product" > strings/0x409/product
mkdir -p configs/c.1/strings/0x409
echo "Config 1: ECM network" > configs/c.1/strings/0x409/configuration
echo 250 > configs/c.1/MaxPower
# Add functions here
mkdir -p functions/hid.usb0
echo 1 > functions/hid.usb0/protocol
echo 1 > functions/hid.usb0/subclass
echo 8 > functions/hid.usb0/report_length
echo -ne \\x05\\x01\\x09\\x06\\xa1\\x01\\x05\\x07\\x19\\xe0\\x29\\xe7\\x15\\x00\\x25\\x01\\x75\\x01\\x95\\x08\\x81\\x02\\x95\\x01\\x75\\x08\\x81\\x03\\x95\\x05\\x75\\x01\\x05\\x08\\x19\\x01\\x29\\x05\\x91\\x02\\x95\\x01\\x75\\x03\\x91\\x03\\x95\\x06\\x75\\x08\\x15\\x00\\x25\\x65\\x05\\x07\\x19\\x00\\x29\\x65\\x81\\x00\\xc0 > functions/hid.usb0/report_desc
ln -s functions/hid.usb0 configs/c.1/
# End functions
ls /sys/class/udc > UDC