nfc-tools / mfcuk

MiFare Classic Universal toolKit (MFCUK)
GNU General Public License v2.0
991 stars 230 forks source link

SIGSEGV in recovery #77

Open 0x5ECF4ULT opened 4 years ago

0x5ECF4ULT commented 4 years ago

So I got that SmartMX card with 4k emulation and tried to run the release version 0.3.8 Standard command ./mfcuk -C -R -1 throws a segfault. Time to start gdb... This is the output:

mfcuk - 0.3.8
Mifare Classic DarkSide Key Recovery Tool - 0.3
by Andrei Costin, zveriu@gmail.com, http://andreicostin.com

INFO: Connected to NFC reader: pn532_uart:/dev/ttyUSB0

VERIFY: 
    Key A sectors: 0
Program received signal SIGSEGV, Segmentation fault.
0x0000555555557295 in main (argc=<optimized out>, argv=<optimized out>) at mfcuk.c:1521
1521          for (j = 0; (j < crntNumVerifKeys) && (ptr_trailer->abtAccessBits[action_byte] & ACTIONS_VERIFY) && !(ptr_trailer->abtAccessBits[result_byte] & ACTIONS_VERIFY); j++) {
(gdb) 

It seems like the program crashes at the verification of the keys. The funny thing is that if the type parameter is given. It tries to authenticate but constantly throws error 0x08 The card OS is "atrust-acos"

xavave commented 4 years ago

did you try to compile and run this forked version: https://github.com/DrSchottky/mfcuk? maybe it would work better ..

0x5ECF4ULT commented 4 years ago

Just tried out. Crashes at exact same position

xavave commented 4 years ago

@tacticalDevC what about the windows version ? Could you try it ? I have compiled a bunch of tools, available here: http://legacy.averbouch.biz/libnfc-and-nfc-utils-binaries-on-windows-10/#alltools

0x5ECF4ULT commented 4 years ago

I'm sorry I don't have any Windows machine anymore. Let's focus on the code. What do you need to find the error?

xavave commented 4 years ago

@tacticalDevC you don’t have a dump of this tag so I could test it on my side ?

0x5ECF4ULT commented 4 years ago

Nope because I wanted to crack the tag. But I have this. Maybe it helps you. Thanks in advance

xavave commented 4 years ago

@tacticalDevC unfortunately I need a tag dump to try to reproduce this error. did you try mfoc with extended keys dictionary: https://github.com/ikarus23/MifareClassicTool/blob/master/Mifare%20Classic%20Tool/app/src/main/assets/key-files/extended-std.keys

0x5ECF4ULT commented 4 years ago

mfoc doesn't work either. Pls see this issue (spoiler: no one has answered yet).

xavave commented 4 years ago

@tacticalDevC i replied here: https://github.com/nfc-tools/mfoc/issues/77

31KM commented 3 years ago

This is caused by the fact that your card is not a compatible Mifare card (only Classic 1K & 4K are supported AFAIK). I tried the tool with a DESFire v3 and got the same issue. Using it with a real Classic card on the other hand worked for me.