本文最后更新于1982天前,其中的信息可能已经有所发展或是发生改变。
- Digispark ATtiny 85
- Arduino IDE 1.8.4 (parrot 中的ide是2.x版本的没有Board Manager)
https://www.arduino.cc/en/Main/Software
- Digispark驱动程序 (Windows)
https://github.com/digistump/DigistumpArduino/releases
在Arduino中添加Digispark的支持
安装Windows下的驱动
代码
DELAY 3000
GUI r
DELAY 500
STRING notepad
DELAY 500
ENTER
DELAY 750
STRING Happy Hacking !!!
ENTER
/*
* Generated with <3 by Dckuino.js, an open source project !
*/
#include <avr/pgmspace.h>
#include "DigiKeyboard.h"
const char line1[] PROGMEM = "notepad";
const char line2[] PROGMEM = "Happy Hacking!!!";
char buffer[256];
#define GetPsz(x) (strncpy_P(buffer, (char*)x, 256))
#define KEY_UP_ARROW 0x52
#define KEY_DOWN_ARROW 0x51
#define KEY_LEFT_ARROW 0x50
#define KEY_RIGHT_ARROW 0x4F
#define KEY_LEFT_GUI 0xE3
#define KEY_ESC 0x29
#define KEY_TAB 0x2B
void digiBegin() {
DigiKeyboard.sendKeyStroke(0,0);
DigiKeyboard.delay(50);
}
void digiEnd() {
const int led=1;
pinMode(led, OUTPUT);
while (1) {
digitalWrite(led, !digitalRead(led));
DigiKeyboard.delay(1000);
}
}
void printText(char *txt) {
DigiKeyboard.print(txt);
DigiKeyboard.update();
}
void setup() {
digiBegin();
DigiKeyboard.delay(3000);
DigiKeyboard.sendKeyStroke(KEY_R,MOD_GUI_LEFT);
DigiKeyboard.delay(500);
// notepad
printText(GetPsz(line1));
DigiKeyboard.delay(500);
DigiKeyboard.sendKeyStroke(KEY_ENTER);
DigiKeyboard.delay(750);
// Happy Hacking!!!
printText(GetPsz(line2));
DigiKeyboard.sendKeyStroke(KEY_ENTER);
digiEnd();
}
/* Unused endless loop */
void loop() {}
图文看不懂没关系
视频版:https://www.bilibili.com/video/av20732981
需要的代码:https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Payloads
生成代码的工具:https://github.com/CYRO4S/Automator
Arduino配置:https://www.bilibili.com/video/av18699066/
驱动https://github.com/digistump/DigistumpArduino/releases
拓展
https://www.bilibili.com/video/av20174979
本文来源于互联网:十块钱RMB | 用Digispark制作一个简单的Badusb
点击数:79