-
Notifications
You must be signed in to change notification settings - Fork 96
Description
I tried you're duck2spark converter (and also the DuckEncoder, Python Version). But i'll get some issues:
I try to convert a duckyscript (for example this one: https://github.com/hak5darren/USB-Rubber-Ducky/wiki/Payload---WiFi-password-grabber).
I create a new file called "wlanscript.duck". After that, i use the duckencoder to get the german keboard layout:
cat wlanscript.duck | python duckencoder.py -p -l de > inject.bin
The last step: Create an Arduino Sketch:
duck2spark.py -i inject.bin -l 1 -f 2000 -o sketch.ino
And here are the issues:
The file sketch.ino looks a little bit weird in my Arduino IDE:
/*
* Sketch generated by duck2spark from Marcus Mengs aka MaMe82
*
*/
#include "DigiKeyboard.h"
#define DUCK_LEN 71
const PROGMEM uint8_t duckraw [DUCK_LEN] = {
0x4c, 0x61, 0x6e, 0x67, 0x75, 0x61, 0x67, 0x65, 0x20, 0x66, 0x69, 0x6c, 0x65, 0x20, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x73, 0x2f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x70, 0x65, 0x72, 0x74, 0x69, 0x65, 0x73, 0x20, 0x64, 0x6f, 0x65, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x65, 0x78, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x72, 0x20, 0x69, 0x73, 0x6e, 0x27, 0x74, 0x20, 0x72, 0x65, 0x61, 0x64, 0x61, 0x62, 0x6c, 0x65, 0xa
};
int i = 1; //how many times the payload should run (-1 for endless loop)
bool blink=true;
void setup()
{
// initialize the digital pin as an output.
pinMode(0, OUTPUT); //LED on Model B
pinMode(1, OUTPUT); //LED on Model A
DigiKeyboard.delay(2000); //wait 2000 milliseconds before first run, to give target time to initialize
}
void loop()
{
//should code be runned in this loop?
if (i != 0) {
DigiKeyboard.sendKeyStroke(0);
//parse raw duckencoder script
for (int i=0; i<DUCK_LEN; i+=2)
{
uint8_t key = pgm_read_word_near(duckraw + i);
uint8_t mod = pgm_read_word_near(duckraw + i+1);
if (key == 0) //delay (a delay>255 is split into a sequence of delays)
{
DigiKeyboard.delay(mod);
}
else DigiKeyboard.sendKeyStroke(key,mod);
}
i--;
DigiKeyboard.delay(5000); //wait 5000 milliseconds before next loop iteration
}
else if (blink)
{
digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level)
digitalWrite(1, HIGH);
delay(100); // wait for a second
digitalWrite(0, LOW); // turn the LED off by making the voltage LOW
digitalWrite(1, LOW);
delay(100); // wait for a second
}
}
Is this correct? When i try to compile this (and waited the till the 60-second 'plug your digispark now into your usb port' message appears) and to flash my digispark i'll get this message:
Starting the user app ...
Run error -1 has occured ...
Please unplug the device and restart the program.
After that i watched into my inject.in file and get this message
root@kali:~/duck2spark-master# cat inject.bin
Language file /resources/de.properties doesn't exist or isn't readable
In my duck2spark folder is a subdirectory "resources" with the file de.properties.
I don't get where the problem is. :/