-
Notifications
You must be signed in to change notification settings - Fork 230
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
Can't recover keys from 'weaker' cards #39
Comments
Hi! You may write where your comment code? I'll have this error too Find functintion and comment //good &= parity, what more needs to be done?
|
I made a lot of changes while troubleshooting and I'm not sure that the code below is correct; let me know whether it works for you. First, to determine that the 'weaker' card was the problem, I added a counter for 4-bit (NACK) hits: In mfcuk.c, after Now if you run with -v 3, a weak card will show a 'hit4' count for every auth attempt. I'll post another comment with the actual recovery code. |
To recover the key from the 'weak' card, I made a histogram of the high 24 bits of all 48-bit candidate keys and another histogram of the low 24 bits. In mfcuk.c, after and after Now, try running, e.g. With luck, you'll start seeing e.g. Unfortunately, I've a bug where when there >1M candidates, it gets a segmentation fault. I was lazy and didn't fix it. If it happens again, just repeat the command and hope that you get maxhi and maxlo up to 5 or 6 before the fault hits. |
Somehow, the forum isn't rendering the large code block properly. Here are the added lines, without a code block:
|
Thanks for your help. Your code WORK! I'am HAPPY!!!! ./mfcuk -C -R 0:A mfcuk - 0.3.8 INFO: Connected to NFC reader: pn532_uart:/dev/ttyUSB0 RECOVER: 0 The corrected version of the files crapto1.c and mfcuk.c upload to git: |
we need to put a new level of verbose logs showing the output of your code. Great code and thank you! |
@Stewart8 thank you for your patch, it works on my weak mfc! |
@DrSchottky I'd like to help test that |
@Stewart8 I replied by mail. |
@DrSchottky do you still have that patched fork? I'm running into the same problem and would like to test your fork with my cards. If not, does anyone else have a repo up which can be used? I'm having trouble compiling this one under Kali. |
@Man-of-Wood |
good job!!! |
@Stewart8 |
i need help to compile and install it on kali linux (live usb). i dont have any idea, i am a beginer |
anyone have the binary of this patched version. I just cant get it to compile under linux or windows, keep getting errors and sick of trying. If someone could just upload the binary it would be so helpful. Thanks |
@droidnewbie2 windows version: |
Hi, if i want to script my mfcuk installation, can i use some fork that is up to date with this patch ? |
when I use your windows version, it cannot work with PN532. It cannot found the device. I found your repo MifareOneTool-English](https://github.com/xcicode/MifareOneTool), but it also cannot found the device. xcicode/MifareOneTool works very well but it report the error :ERROR: mfcuk_key_recovery_block() (error code=0x03) |
Like many others, I was unable to recover any keys, even from 'blank' cards with 0xffffffffffff default keys, getting an indefinite number of 0x03 errors.
Attempting to debug, I discovered that my cards were responding with NACK to all failed authentication attempts, regardless of parity bits, as described in section 4.3 of http://eprint.iacr.org/2009/137.pdf .
It appears that mfcuk 0.3.8 has no logic to detect or handle this behavior, and gets confused by assuming that all 'hits' have good plaintext parity, even though (with this card type) most do not.
I don't know enough about cryptography to implement (or even understand) the elegant solution proposed in section 6.1 of the same paper.
However, I was able to recover keys by commenting out the parity checking logic in check_pfx_parity , putting candidate keys in a histogram table, and waiting until the same value was seen 4 times (with different nonces).
Sorry, I was just patching and don't have any production code for this method (and I know it's not the best method anyway).
The end result was that I got the desired data; many thanks for the program.
The text was updated successfully, but these errors were encountered: