lainconnors

Arduino Hash Cracker Python Script

Oct 21st, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.83 KB | None | 0 0
  1. import serial
  2. import time
  3. import sys
  4.  
  5. # Modify these at will
  6. port = 'COM5'
  7. baud = 115200
  8. toCrack = 'e74aa0f06f344e47e97a975e22c51cef'
  9.  
  10. # File definitions
  11. file = open("list.txt", "r")
  12. if file.mode != "r":
  13.     print("Unable to open list.txt in current directory!")
  14.     sys.exit()
  15. lines = file.readlines()
  16.  
  17. ser = serial.Serial(port, baud, timeout=1)
  18. time.sleep(1)
  19. ser.flushInput()
  20.  
  21. # Extra input Sanitation
  22. for line in lines:
  23.     line = line.strip()
  24.  
  25. # The main attraction
  26. for line in lines:
  27.     ser.write(line.encode())
  28.     ser.flushOutput()
  29.     while ser.inWaiting() < 32:
  30.         continue
  31.     hashVal = ser.read_until(size=32)
  32.     print(hashVal)
  33.     if hashVal.decode('ascii') == toCrack:
  34.         print("Found! -- " + line)
  35.         ser.close()
  36.         sys.exit()
  37.     ser.flushInput()
  38. ser.close()
  39. sys.exit()
Add Comment
Please, Sign In to add comment