Author Topic: Digispark keyboard change USB VID / PID  (Read 19787 times)

beamzer

  • Newbie
  • *
  • Posts: 2
Digispark keyboard change USB VID / PID
« on: March 16, 2017, 01:33:00 pm »
Hi, i would like to use the digispark as a Rubber Ducky on macbook attacks,
but non-apple keyboards generate a dialogue to identify what kind of keyboard it is
and that messes with the attack.
In this video form HAK5 https://www.youtube.com/watch?v=qGPGOoJn54E
Darren shows that the Rubber Ducky can be flashed to show an Apple USB VID/PID
so it's accepted directly without diaglogue (scroll to 19:18).
I believe this is also possible on the digitstump, but i can't find how to do this.

any help is appreciated!
« Last Edit: March 17, 2017, 12:08:19 am by beamzer »

beamzer

  • Newbie
  • *
  • Posts: 2
Re: Digispark keyboard change USB VID / PID
« Reply #1 on: March 17, 2017, 12:04:43 am »
ah, super!
found it on my Mac in
Code: [Select]
Library/Arduino15/packages/digistump/hardware/avr/1.6.7/libraries/DigisparkKeyboard/usbconfig.hand changed:
Code: [Select]
#define USB_CFG_VENDOR_ID 0xc0, 0x16
/* USB vendor ID for the device, low byte first. If you have registered your
 * own Vendor ID, define it here. Otherwise you may use one of obdev's free
 * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules!
 * *** IMPORTANT NOTE ***
 * This template uses obdev's shared VID/PID pair for Vendor Class devices
 * with libusb: 0x16c0/0x5dc.  Use this VID/PID pair ONLY if you understand
 * the implications!
 */

#define USB_CFG_DEVICE_ID 0xdb, 0x27
/* This is the ID of the product, low byte first. It is interpreted in the
 * scope of the vendor ID. If you have registered your own VID with usb.org
 * or if you have licensed a PID from somebody else, define it here. Otherwise
 * you may use one of obdev's free shared VID/PID pairs. See the file
 * USB-IDs-for-free.txt for details!
 * *** IMPORTANT NOTE ***
 * This template uses obdev's shared VID/PID pair for Vendor Class devices
 * with libusb: 0x16c0/0x5dc.  Use this VID/PID pair ONLY if you understand
 * the implications!
 */
into:
Code: [Select]
#define USB_CFG_VENDOR_ID 0xac, 0x05
#define USB_CFG_DEVICE_ID 0x27, 0x22

and it works  ;D
Code: [Select]
% lsusb
...
Bus 020 Device 006: ID 05ac:2227 Apple Inc. DigiKey

I could change the name as well, but actually like the DigiKey addendum  ;)
Code: [Select]
#define USB_CFG_DEVICE_NAME     'D','i','g','i','K','e','y'
#define USB_CFG_DEVICE_NAME_LEN 7

timherrm

  • Newbie
  • *
  • Posts: 3
Re: Digispark keyboard change USB VID / PID
« Reply #2 on: April 24, 2017, 05:43:56 am »
Hi,
i also tried to change the Vendor ID and Product ID in the file you stated.

But if i change it and upload the sketch, the ID's haven't changed.

Do i have to do soemthing else?

Greetings
timo

timherrm

  • Newbie
  • *
  • Posts: 3
Re: Digispark keyboard change USB VID / PID
« Reply #3 on: April 28, 2017, 05:10:48 am »
Hi,
I have got the "Digistump AVR Boards by Digistump Version 1.6.7" installed in Arduino IDE 1.8.1 on Linux.

The file i modified was in /home/user/.arduino15/packages/digistump/hardware/avr/1.6.7/libraries/DigisparkKeyboard/usbconfig.h

One thing i noticed is, that the default lines were:
Code: [Select]
#define USB_CFG_VENDOR_ID 0xc0, 0x16
#define USB_CFG_DEVICE_ID 0xdb, 0x27

But also these values aren't correct.
Code: [Select]
$ lsusb
Bus 002 Device 017: ID 16d0:0753 MCS Digistump DigiSpark

This are the other files named usbconfig.h.
I cant find my current Vendor ID and Device ID in any of these files.
Code: [Select]
/home/user/.arduino15/packages/digistump/hardware/avr/1.6.7/libraries/DigisparkMouse/usbconfig.h
/home/user/.arduino15/packages/digistump/hardware/avr/1.6.7/libraries/DigisparkCDC/usbconfig.h
/home/user/.arduino15/packages/digistump/hardware/avr/1.6.7/libraries/DigisparkKeyboard/usbconfig.h
/home/user/.arduino15/packages/digistump/hardware/avr/1.6.7/libraries/DigisparkJoystick/usbconfig.h
/home/user/.arduino15/packages/digistump/hardware/avr/1.6.7/libraries/DigisparkUSB/usbconfig.h
/home/user/Downloads/arduino-1.6.12/hardware/arduino/avr/bootloaders/gemma/usbconfig.h
/home/user/Downloads/arduino-1.8.1/hardware/arduino/avr/bootloaders/gemma/usbconfig.h

Thanks for your help
timo

timherrm

  • Newbie
  • *
  • Posts: 3
Re: Digispark keyboard change USB VID / PID
« Reply #4 on: April 28, 2017, 11:36:37 am »
Thanks Ralf, my fault.
It is working now!

Thanks!
Timo

bidic17

  • Newbie
  • *
  • Posts: 2
Re: Digispark keyboard change USB VID / PID
« Reply #5 on: April 30, 2017, 10:16:41 pm »
hi guys.

sorry to be butting in.

i'm also trying to change the name of the device on a trinket gamepad library (usb config.h file)

but i can't figure out this part:

#define USB_CFG_VENDOR_ID 0xac, 0x05
#define USB_CFG_DEVICE_ID 0x27, 0x22

is there a way to do a name change on a trinket gamepad library? i am using arduino on windows 10.

in case you need to see the file, i have attached it.

thanks in advance.
« Last Edit: April 30, 2017, 11:44:22 pm by bidic17 »