Skip to content
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

nfc: collect nonces during mf classic emulation #1484

Closed

Conversation

indutny
Copy link
Contributor

@indutny indutny commented Jul 28, 2022

What's new

  • When emulating a mifare classic key it is now possible to collect and save nonces for a failed authentication and use them to recover the key through mfkey32v2 tool

Verification

  • Emulate mifare classic key and hold flipper next to a wrong reader. The "log" and "save" buttons should become visible

Checklist (For Reviewer)

  • PR has description of feature/bug or link to Confluence/Jira task
  • Description contains actions to verify feature/bugfix
  • I've built this code, uploaded it to the device and verified feature/bugfix

@hedger hedger added NFC NFC-related New Feature Contains an IMPLEMENTATION of a new feature UI Affects UI labels Jul 29, 2022
@indutny indutny force-pushed the feature/mf-classic-nonces branch from 2182cd4 to 7fd0c77 Compare August 1, 2022 19:41
@gornekich
Copy link
Member

Hi @indutny . Great work!
Mfkey32 attack is a feature that we want to implement. Since it can't bu run on Flipper, we want to offload resource demanding part to companions (mobile apps and web). It's good idea to save data necessary for mfkey32 on SD card. We need to come to the save format so that companions can easily parse data and run the attack.
Personally, I think that it's better to add this functionality to Detect Reader. We can emulate hardcoded MFC card and collect 2 pairs of nr + ar and write them to SD. Seems like partially saved data will cause many questions from users. It is not clear what you have to do with data on the screen and raw string in log file for common user. If you collect only one MfClassicEmulatorNonce structure, you can't run mfkey32.

Also, now flipper crashes when I try to save logs.

Let me know your thoughts on data logging in Detect Reader and more clear log format.

@indutny
Copy link
Contributor Author

indutny commented Aug 2, 2022

I agree, this belongs to other UI affordance. In my limited experiences a pair of nr + ar wasn't sufficient to deconstruct the key. In some cases it leads only to a recovered keystream, but no to the actual key. I need at least 3 pairs to get it working and I suspect others might need more than two as well.

Sorry it crashes! I'll take a look into UI placement and crashes later this week.

@gornekich
Copy link
Member

Did you use mfkey32 or mfkey32v2? The difference here is in first you use constant NT and 2 pairs of AR+NR. In mfkey32v2 you can use different NT.
In my experience your logs perfectly woks with mfkrey32v2.

@gornekich
Copy link
Member

Also, if you plan further work on this PR, could you please set it in Draft state

@indutny indutny marked this pull request as draft August 2, 2022 14:47
@indutny
Copy link
Contributor Author

indutny commented Aug 2, 2022

@gornekich I used a v2 and it didn't really work. Converted PR to draft. Thanks!

@Solilord
Copy link

Hey,
Sorry for asking: is there any Progress?
Iam waiting exactly for this 😅
I have no possibility to use WebCLI while using the reader.

@gornekich
Copy link
Member

I added nonces collection in Detect Reader here #1643

@indutny
Copy link
Contributor Author

indutny commented Sep 1, 2022

Awesome. Thanks!

@indutny indutny closed this Sep 1, 2022
@indutny indutny deleted the feature/mf-classic-nonces branch September 1, 2022 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature Contains an IMPLEMENTATION of a new feature NFC NFC-related UI Affects UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants