arrase / Raspiducky

A Keystroke Injection Tool like Rubber Ducky build over Raspberry Pi Zero W
https://arrase.github.io/Raspiducky/
122 stars 15 forks source link

Error from hid.sh #18

Closed josefmonje closed 7 years ago

josefmonje commented 7 years ago

Seems i'm having a problem with ls /sys/class/udc > UDC tail /var/logs/boot.log

ls: write error: Device or resource busy
[FAILED] Failed to start /etc/rc.local Compatibility.
See 'systemctl status rc-local.service' for details.
         Starting Terminate Plymouth Boot Screen...
         Starting Hold until boot process finishes up...

systemctl status rc-local.service

● rc-local.service - /etc/rc.local Compatibility
   Loaded: loaded (/lib/systemd/system/rc-local.service; static)
  Drop-In: /etc/systemd/system/rc-local.service.d
           └─ttyoutput.conf
   Active: failed (Result: exit-code) since ...
  Process: 773 ExecStart=/etc/rc.local start (code=exited, status=2)

cat /sys/kernel/config/usb_gadget/raspiducky/UDC

ls /sys/class/udc

20980000.usb

cat /etc/rc.local

#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Turn off/on HDMI
#/usr/bin/tvservice -o
#/usr/bin/tvservice -p

# Turn off LED
echo none | sudo tee /sys/class/leds/led0/trigger
echo 1 | sudo tee /sys/class/leds/led0/brightness

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

/usr/bin/hid.sh
sleep 3
/usr/bin/run_payload.sh

exit 0

any ideas?

josefmonje commented 7 years ago

By the way, i'm usually running the pi zero as either g_ether, g_cdc, or g_multi (still experimenting on what works). Could it be that this is what's causing the issue?

PeterPorzuczek commented 7 years ago

Same problem here. Have you found any solution?

josefmonje commented 7 years ago

@PeterPorzuczek it seems it really won't work for now. follow the link in the comments in my code. this is a repo of gadgets modes i've tried. comments in the issue linked are promising.

arrase commented 7 years ago

g_ether, g_cdc, or g_multi are incompatible with libcomposite, you can not run both at the same time

josefmonje commented 7 years ago

Just to clarify, libcomposite was also used. There is a patch in the upcoming kernel build that fixes the bug in usb_f_hid.ko https://github.com/raspberrypi/linux/issues/1943

mame82 commented 7 years ago

Had a similar problem with P4wnP1. Can confirm that the issue with USB Composite HID gadget (usb_f_hid.ko) has been fixed in kernel 4.9.39+. I'm able to use a HID Keyboard and a custom HID device (covert channel comms) again, after running rpi-update.