-
-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] MF_CLASSIC_DETECTION (mfkey32) keys wrong #214
Comments
So, the issue first appeared in the commit 6ec88b4, which was the last one to change MF_DETECTION implementation. Looks like moving it to working memory broke something and it didn't work properly any more. I temporarily fixed it by changing [CONFIG_MF_CLASSIC_DETECTION]
...
.CardMemorySize = MFCLASSIC_1K_MEM_SIZE,
.WorkingMemorySize = DETECTION_MEM_APP_SIZE,
.ReadOnly = false to [CONFIG_MF_CLASSIC_DETECTION]
...
.CardMemorySize = DETECTION_MEM_APP_SIZE,
.WorkingMemorySize = MEMORY_NO_MEMORY,
.ReadOnly = true in |
Okay, found the real problem. In
|
Can somebody create a pull request with that change, please? |
Environment
Bug description
Dear chameleon revE rebooted team!
After flashing the latest firmware to the device, I noticed wrong keys being calculated using mfkey32 (reader attack). Tests were done in a controlled environment with a known key by repeatedly authenticating to a single sector. This is the Arduino code:
Chameleon was fully erased with a
CLEARALL
command before tests, slot 1 was configured asMF_CLASSIC_DETECTION
andDETECTION?
command returned allFF
s and a checksum on the first run. After collecting nonces, the output changed to following:After running mfkey32 I got the following result:
The expected key was
010203302010
, as in the sketch above. I know that 4K configuration isn't available for this mode, I was just experimenting, this is why you see block 240. The following behavior applies to all slots, all keys and all sectors. Only 2 last bytes always don't differ between real and expected outputs. The same function works with the stock firmware and the same newest rebootedGUI (backwards compatibility?). Can you help me to identify the problem? Thanks in advance!Expected function and references
Working mfkey32 (reader) attack on newest firmware
Bug
Steps to Reproduce
MIFARE_CLASSIC_DETECTION
Resolution paths
Ideas
Please note, that the last 2 bytes are always correct! Given that, I can assume that there is some nonce saving issue, which corrupts first nonces and thus the first part of the key
Possible Implementation
The text was updated successfully, but these errors were encountered: