You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

proxmark3_parser.py 984B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/usr/bin/python
  2. # Original source: proxmark3.org community forum
  3. import sys
  4. import os
  5. import string
  6. try:
  7. file= open(sys.argv[1])
  8. except:
  9. print
  10. print '\tusage: mifarecrack.py <proxmark3 logfile>'
  11. print
  12. sys.exit(True)
  13. lines= file.readlines()
  14. uid= ''
  15. gotone= False
  16. for i in range(len(lines)):
  17. if not uid and string.find(lines[i],': 93 20') > 0:
  18. uid= lines[i + 1][20:34]
  19. print
  20. print 'Found TAG UID:', uid
  21. if string.find(lines[i],': 60') > 0 or string.find(lines[i],': 61') > 0:
  22. gotone= True
  23. tag_challenge= lines[i+1]
  24. reader_challenge_response= lines[i+2]
  25. tag_response= lines[i+3]
  26. break
  27. if not gotone:
  28. print 'No crypto exchange found!'
  29. sys.exit(True)
  30. crackstring= './mifarecrack '+ uid
  31. # now process challenge/response
  32. crackstring += ' ' + tag_challenge[20:34]
  33. crackstring += ' ' + reader_challenge_response[20:50]
  34. crackstring += ' ' + tag_response[20:34]
  35. print 'Executing ', crackstring
  36. os.execv('./mifarecrack',string.split(crackstring))