README 3.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. mfterm is a terminal interface for working with Mifare Classic tags.
  2. Tab completion on commands is available. Also, commands that have file
  3. name arguments provide tab completion on files. There is also a
  4. command history, like in most normal shells.
  5. Working with the mfterm program there are a few state variables that
  6. are used.
  7. Current Tag
  8. -----------
  9. The "current tag" is populated with the 'load' or 'read' commands. The
  10. 'read' command will read data from a physical tag and requires the
  11. "current keys" to be set to the keys of the tag. Clear the "current
  12. tag" by using the 'clear' command.
  13. Display the "current tag" by using the 'print' command. The keys of
  14. the "current tag" are displayed with the 'print keys' command. Note:
  15. the tag keys could be different from the "current keys" displayed by
  16. the 'keys print' command.
  17. The data of the "current tag" can be manipulated with the 'set'
  18. command.
  19. The "current tag" can be persisted by writing it to a file with the
  20. 'save' command. It can also be written to a physical tag with the
  21. 'write' command. For the 'write' command to succeed, the "current
  22. keys" have to be set to appropriate values.
  23. If you are reading or loading a 1k tag, the mfterm program will still
  24. use a full 4k tag to represent it. The last 3k will be all
  25. zeroes. This is in analogy with the other libnfc tools.
  26. Current Keys
  27. ------------
  28. The "current keys" are used to authenticate when performing operations
  29. on a physical tag. They can be displayed using the 'keys'
  30. command. Clear the "current keys" by using the 'keys clear' command.
  31. The keys are stored just like a tag in a file using the 'keys save',
  32. but with all the data fields except the sector trailers cleared. The
  33. keys can be loaded from a file, either a real tag dump or a key tag
  34. dump, with the 'keys load' command.
  35. The "current keys" can be set to match the "current tag" by using the
  36. 'keys import' command. It is also possible to manually set a key using
  37. the 'keys set' command.
  38. Use the 'keys test' command to test if the "current keys" can be used
  39. to authenticate with a physical tag.
  40. Dictionary
  41. ----------
  42. A key dictionary can be imported from a file using the 'dict load'
  43. command. This dictionary can then be used to perform a dictionary
  44. attack on the sectors of a tag by using the 'dict attack' command.
  45. The format of the dictionary file is simple. One key (6 bytes, 12 hex
  46. characters) per line and # is a comment.
  47. Performing 'dict load' on several files will produce a dictionary that
  48. is the union of those files. Duplicates will be removed.
  49. To list all the keys in the dictionary, use the command 'dict'. To
  50. clear the dictionary use 'dict clear'.
  51. Other commands
  52. --------------
  53. Quit the mfterm program by issuing the 'quit' command.
  54. Help is available by writing 'help'
  55. Specification Files
  56. -------------------
  57. A specification file defines names for parts of the tag data. See the
  58. file mfc-spec.txt for a sample specification.
  59. Specification files are loaded with the command 'spec load'. They can
  60. be cleared with 'spec clear'. To display the data structure loaded use
  61. the command 'spec'.
  62. Once a specification has been loaded, it can be used to access the
  63. data in the tag by using a specification path. In the sample
  64. specification, the path: '.sector_0.block_0.atqa', when entered in the
  65. terminal, will display the two bytes of data starting with byte 6.
  66. WARNING:
  67. --------
  68. The mfterm software is neither thoroughly tested nor widely used. It
  69. likely contains a number of serious bugs that can be exploited to
  70. compromise your computer. Do NOT run the mfterm software as a
  71. privileged user (e.g. root), and ONLY load tag, dictionary and
  72. specification files that you get from people you trust.