GithubHelp home page GithubHelp logo

mfoc's Introduction

MFOC is an open source implementation of "offline nested" attack by Nethemba.

This program allow to recover authentication keys from MIFARE Classic card.

Please note MFOC is able to recover keys from target only if it have a known key: default one (hardcoded in MFOC) or custom one (user provided using command line).

Build from source

autoreconf -is
./configure
make && sudo make install

Usage

Put one MIFARE Classic tag that you want keys recovering; Lauching mfoc, you will need to pass options, see

mfoc -h

mfoc's People

Contributors

adamlaurie avatar agebhar1 avatar ceres-c avatar doegox avatar iceman1001 avatar kirelagin avatar neomilium avatar samueloph avatar smortex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mfoc's Issues

configure error

What steps will reproduce the problem?
1.Run ./configure

What is the expected output? What do you see instead?
I expect this to run successfully, however the following is returned despite a 
clean install of libnfc 1.7.0 being installed:
"configure: error: libnfc >= 1.7.0 is mandatory."

What version of the product are you using? On what operating system?
Version 0.10.4 on arch linux

Please provide any additional information below.
I have tried installing all 4 available RC versions of libnfc 1.7.0, but none 
seem to work with mfoc.

Original issue reported on code.google.com by [email protected] on 13 Feb 2013 at 8:07

acr122 not detected to libnfc1.7.0-rc7 please

Hello I'm french, so sorry for the translation, here is my problem:
I have a chip reader ACS 122U-A9 and I want to hack a Mifare Classic 1k (ISO 
14443 Type A), I use a virtual machine (VirtualBox and Backtrack 5 R3) under 
64-bit Windows 7, I installed :
libnfc-1.7.0-rc7
ACR122 drivers on www.acs.com.hk website
mfoc0.10.2
Thank you very much for answering me because I'm desperate not to find the keys 
A and B

I came not to do detect my card reader with libnfc-1.7.0-rc7 with nfc-list 
function why? 
I get to do detect the card reader with libnfc-1.4.2 
I try to use MFOC-0.10.2, I 500-O-P MFOC dump, but it reads the sector 8, 500 
times without finding the key B, which then try? 
thank you to answer me please. 

Original issue reported on code.google.com by [email protected] on 12 Jun 2013 at 6:03

I don't know what kind of card I have, how can I know?

The information I have on the card is:
physically it is a pleasingly white card on both sides.

Found Mifare Classic 1k tag
ISO/IEC 14443A (106 kbps) target:
ATQA (SENS_RES): 00 04

  • UID size: single
  • bit frame anticollision supported
    UID (NFCID1): XX XX XX XX
    SAK (SEL_RES): 28
  • Compliant with ISO/IEC 14443-4
  • Not compliant with ISO/IEC 18092
    ATS: 78 77 74 03 77 43 32 53 01 00 02
  • Max Frame Size accepted by PICC: 256 bytes
  • Bit Rate Capability:
    • PICC to PCD, DS=2, bitrate 212 kbits/s supported
    • PICC to PCD, DS=4, bitrate 424 kbits/s supported
    • PICC to PCD, DS=8, bitrate 847 kbits/s supported
    • PCD to PICC, DR=2, bitrate 212 kbits/s supported
    • PCD to PICC, DR=4, bitrate 424 kbits/s supported
    • PCD to PICC, DR=8, bitrate 847 kbits/s supported
  • Frame Waiting Time: 38.66 ms
  • Start-up Frame Guard Time: 4.833 ms
  • Node Address supported
  • Card IDentifier supported
  • Historical bytes Tk: 77 43 32 53 01 00 02
    • Proprietary format

Response time significantly much higher in lastest version of MFOC?

Here the time experiment with same commands on mfcuk and mfoc and the same tag&reader but diferent versions of nfc-tools.

Results (min aprox):

MFOC 0.10.3, libnfc 1.5.1 & mfcuk 0.3.3 > Time to obtain all keys: 15 min (2min mfcuk and 10min mfoc with only one probe by sector)

MFOC 0.10.7, libnfc 1.7,1 & mfcuk 0.3.8 > Time to obtain all keys: 60 min (15min mfcuk and 45min mfoc with 20-45 probes by sector)

In two case i use these commands: "mfcuk -C -R 0:A -v 2" and "mfoc -k xxxxxxxxxxx -O keys.mfd -P 100"
Tag&reader: Mifare classic 1k tag, reader SCL3711.

Why the lastest version of nfc-tools are more slow?

mfoc from git fail to compile

What steps will reproduce the problem?
1.git clone https://code.google.com/p/mfoc
2.cd mfoc
3.make

What is the expected output? What do you see instead?
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
make -j5 
make  all-recursive
make[1]: Entering directory 
`/var/tmp/portage/net-wireless/mfoc-9999/work/mfoc-9999'
Making all in src
make[2]: Entering directory 
`/var/tmp/portage/net-wireless/mfoc-9999/work/mfoc-9999/src'
  CC       crapto1.o
  CC       crypto1.o
  CC       mfoc.o
  CC       mifare.o
  CC       nfc-utils.o
nfc-utils.c: In function ‘print_nfc_target’:
nfc-utils.c:125:3: error: incompatible type for argument 2 of 
‘str_nfc_target’
In file included from nfc-utils.c:39:0:
/usr/local/include/nfc/nfc.h:139:18: note: expected ‘nfc_target’ but 
argument is of type ‘const struct nfc_target *’
nfc-utils.c:127:3: warning: implicit declaration of function ‘nfc_free’ 
[-Wimplicit-function-declaration]
make[2]: *** [nfc-utils.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory 
`/var/tmp/portage/net-wireless/mfoc-9999/work/mfoc-9999/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory 
`/var/tmp/portage/net-wireless/mfoc-9999/work/mfoc-9999'
make: *** [all] Error 2



What version of the product are you using? On what operating system?
using the git version (today) on:
Linux localhost 3.11.6-gentoo #1 SMP Wed Oct 23 15:47:29 CEST 2013 x86_64 
Intel(R) Core(TM) i3 CPU 540 @ 3.07GHz GenuineIntel GNU/Linux


Please provide any additional information below.
with libnfc: libnfc-1.7.0-40-g7e5257d

Original issue reported on code.google.com by hisoka2501 on 9 Nov 2013 at 12:18

Mifare Plus with no known key

Hello,

First of all I thank the creators of these wonderful tools that make it easy for us! But I happen to have a problem, and I hope to find the solution here!
I have a Mifare Classic 1k card, whose security makes me think of a Mifare Classic 1k Plus. Of course I try to clone it to have another copy.
As said before when I play mfcuk Diff Nt and Auth have all the time the same value over 2000. I do not know any sequence of the card, I still try several combolist through mfoc (keylist) but that did not give anything. I also tried to go through MilazyCracker (with crapto1 / craptev1), same result (mfoc: ERROR: No sector encrypted with the default key, exiting ...).
I asked myself a question a little crazy, unless you have other solutions to offer me ahah. Is it possible to ask mfoc to test all possible combinations (with as parameter: characters abcdef0123456789, length 12), on a single sector (eg 0: A) for a day to fall on the right combination. Knowing that generating a file with all combinations would represent a file of 3 Peta bytes, rather huge.
Once this combination is found, execute the basic mfoc "nested" attack to recover the remaining 15 and 16 sectors. I count if it is possible to run on a raspberry pi (low consumption, ...).
The attack will be extremely, extremely, extremely long, ... I know, ... but I have no choice. There is the problem of the power outage, and we must start all over again, problematic with an attack of such length.
I hope I have not rushed you with my questions but I am in my last ditches. If you wish to have additional information, and if you have other solutions, do not hesitate!
Thank you very much in advance !
PS: My apologies if you find spelling mistakes, I'm French :-)

SPECTERR.

MFOC doesn't write into the output file and recovers no keys

I am running mfoc on Mac OS X, installed with Homebrew.

ffff-MacBook-Pro:~ ffff$ mfoc -k ffffeeeedddd -O mycard.mfd
The custom key 0xffffeeeedddd has been added to the default keys
ISO/IEC 14443A (106 kbps) target:
ATQA (SENS_RES): ff ff

  • UID size: single
  • bit frame anticollision supported
    UID (NFCID1): ff ff ff ff
    SAK (SEL_RES): ff
  • Compliant with ISO/IEC 14443-4
  • Not compliant with ISO/IEC 18092
    ATS: ff ff ff ff ff ff ff ff ff ff
  • Max Frame Size accepted by PICC: 256 bytes
  • Bit Rate Capability:
    • Same bitrate in both directions mandatory
  • Frame Waiting Time: 77.33 ms
  • Start-up Frame Guard Time: 1.208 ms
  • Node Address not supported
  • Card IDentifier not supported
  • Historical bytes Tk: 44 49 20 30 32 56
    • Proprietary format

Fingerprinting based on MIFARE type Identification Procedure:

  • SmartMX with MIFARE 1K emulation
    Other possible matches based on ATQA & SAK values:
  • JCOP31 v2.3.1

Try to authenticate to all sectors with default keys...
Symbols: '.' no key found, '/' A key found, '' B key found, 'x' both keys found
[Key: ffffeeeedddd] -> [xxxxxxxxxxxxxxxx]
[Key: ffffffffffff] -> [xxxxxxxxxxxxxxxx]
[Key: a0a1a2a3a4a5] -> [xxxxxxxxxxxxxxxx]
[Key: d3f7d3f7d3f7] -> [xxxxxxxxxxxxxxxx]
[Key: 000000000000] -> [xxxxxxxxxxxxxxxx]
[Key: b0b1b2b3b4b5] -> [xxxxxxxxxxxxxxxx]
[Key: 4d3a99c351dd] -> [xxxxxxxxxxxxxxxx]
[Key: 1a982c7e459a] -> [xxxxxxxxxxxxxxxx]
[Key: aabbccddeeff] -> [xxxxxxxxxxxxxxxx]
[Key: 714c5c886e97] -> [xxxxxxxxxxxxxxxx]
[Key: 587ee5f9350f] -> [xxxxxxxxxxxxxxxx]
[Key: a0478cc39091] -> [xxxxxxxxxxxxxxxx]
[Key: 533cb6c723f6] -> [xxxxxxxxxxxxxxxx]
[Key: 8fd0a4f256e9] -> [xxxxxxxxxxxxxxxx]

Sector 00 - FOUND_KEY [A] Sector 00 - FOUND_KEY [B]
Sector 01 - FOUND_KEY [A] Sector 01 - FOUND_KEY [B]
Sector 02 - FOUND_KEY [A] Sector 02 - FOUND_KEY [B]
Sector 03 - FOUND_KEY [A] Sector 03 - FOUND_KEY [B]
Sector 04 - FOUND_KEY [A] Sector 04 - FOUND_KEY [B]
Sector 05 - FOUND_KEY [A] Sector 05 - FOUND_KEY [B]
Sector 06 - FOUND_KEY [A] Sector 06 - FOUND_KEY [B]
Sector 07 - FOUND_KEY [A] Sector 07 - FOUND_KEY [B]
Sector 08 - FOUND_KEY [A] Sector 08 - FOUND_KEY [B]
Sector 09 - FOUND_KEY [A] Sector 09 - FOUND_KEY [B]
Sector 10 - FOUND_KEY [A] Sector 10 - FOUND_KEY [B]
Sector 11 - FOUND_KEY [A] Sector 11 - FOUND_KEY [B]
Sector 12 - FOUND_KEY [A] Sector 12 - FOUND_KEY [B]
Sector 13 - FOUND_KEY [A] Sector 13 - FOUND_KEY [B]
Sector 14 - FOUND_KEY [A] Sector 14 - FOUND_KEY [B]
Sector 15 - FOUND_KEY [A] Sector 15 - FOUND_KEY [B]

We have all sectors encrypted with the default keys..

Auth with all sectors succeeded, dumping keys to a file!
nfc_initiator_mifare_cmd: Success

And this is the output. I get that after about 5 seconds of touching the card. However the output file is empty.
I have manually installed mfoc and used this fix (http://www.george-smart.co.uk/wiki/NFC_Experiments). Here the output file got written, however it was mainly just 0000.

What could be the problem?

nfc_initiator_mifare_cmd always returns Timeout

What steps will reproduce the problem?
1. git clone nfclib / compile / install / test

#nfc-list 
nfc-list uses libnfc libnfc-1.7.0-51-g7b7f506
NFC device: SCM Micro / SCL3711-NFC&RW opened
1 ISO14443A passive target(s) found:
ISO/IEC 14443A (106 kbps) target:
    ATQA (SENS_RES): 00  04  
       UID (NFCID1): 37  08  xx  xx  
      SAK (SEL_RES): 88

>> nfc lib is working

2. git clone mfoc / autoconf / make
3. run mfoc



What is the expected output? What do you see instead?

+ running mfoc
> old version was running (was in early 2013)
instead error occurs: nfc_initiator_mifare_cmd: Timeout



What version of the product are you using? On what operating system?
libnfc libnfc-1.7.0-51-g7b7f506
mfoc head (23.01.2014 git: 290a0759567d)
ubuntu 13.10
reader SCM Micro / SCL3711 (USB dongle)



Please provide any additional information below.

# mfoc -O test
ISO/IEC 14443A (106 kbps) target:
    ATQA (SENS_RES): 00  04  
* UID size: single
* bit frame anticollision supported
       UID (NFCID1): 37  08  xx  xx  
      SAK (SEL_RES): 88  
* Not compliant with ISO/IEC 14443-4
* Not compliant with ISO/IEC 18092

Fingerprinting based on MIFARE type Identification Procedure:
* SmartMX with MIFARE 1K emulation
Other possible matches based on ATQA & SAK values:
* Mifare Classic 1K Infineon

Try to authenticate to all sectors with default keys...
Symbols: '.' no key found, '/' A key found, '\' B key found, 'x' both keys found
[Key: ffffffffffff] -> [xnfc_initiator_mifare_cmd: Timeout



Original issue reported on code.google.com by [email protected] on 23 Jan 2014 at 9:51

Add instructions for building mfoc on Windows.

The available documentation for mfoc details how to build it on *nix-based systems, but not Windows. Even if this project is not intended for Windows, I believe the project could still benefit from providing instructions for building for Windows for those who would like to try it.

Unfortunately, using a VM with USB passthrough is not possible, as the program does not work properly in a VM, and USB passthrough is apparently not supported by the Windows Subsystem for Linux for anything other than external drives and flash drives.

distance 64 .nfc_initiator_init: Input / Output Error

What steps will reproduce the problem?
1.mfoc -O test.dump ,can not write the file and report this message:"distance 
64 .nfc_initiator_init: Input / Output Error"

my libnfc version is 1.7.0 


What is the expected output? What do you see instead?
Sector 00 -  UNKNOWN_KEY [A]  Sector 00 -  UNKNOWN_KEY [B]  
Sector 01 -  UNKNOWN_KEY [A]  Sector 01 -  UNKNOWN_KEY [B]  
Sector 02 -  UNKNOWN_KEY [A]  Sector 02 -  UNKNOWN_KEY [B]  
Sector 03 -  UNKNOWN_KEY [A]  Sector 03 -  UNKNOWN_KEY [B]  
Sector 04 -  UNKNOWN_KEY [A]  Sector 04 -  UNKNOWN_KEY [B]  
Sector 05 -  UNKNOWN_KEY [A]  Sector 05 -  UNKNOWN_KEY [B]  
Sector 06 -  FOUND_KEY   [A]  Sector 06 -  FOUND_KEY   [B]  
Sector 07 -  FOUND_KEY   [A]  Sector 07 -  FOUND_KEY   [B]  
Sector 08 -  FOUND_KEY   [A]  Sector 08 -  FOUND_KEY   [B]  
Sector 09 -  FOUND_KEY   [A]  Sector 09 -  FOUND_KEY   [B]  
Sector 10 -  FOUND_KEY   [A]  Sector 10 -  FOUND_KEY   [B]  
Sector 11 -  FOUND_KEY   [A]  Sector 11 -  FOUND_KEY   [B]  
Sector 12 -  FOUND_KEY   [A]  Sector 12 -  FOUND_KEY   [B]  
Sector 13 -  FOUND_KEY   [A]  Sector 13 -  FOUND_KEY   [B]  
Sector 14 -  FOUND_KEY   [A]  Sector 14 -  FOUND_KEY   [B]  
Sector 15 -  FOUND_KEY   [A]  Sector 15 -  FOUND_KEY   [B]  


Using sector 06 as an exploit sector
Sector: 0, type A, probe 0, distance 64 .nfc_initiator_init: Input / Output 
Error


my mfoc version is 0.10.7 and my system is ubuntu 12.04_x64

NFC device:acr122u-a9


Original issue reported on code.google.com by [email protected] on 12 Jan 2014 at 1:48

how to find out whether my card is java card according to sak 28

I have run command nfc-list:

displaying:

nfc-list uses libnfc 1.7.1
NFC device: pn532_uart:/dev/ttyUSB0 opened
1 ISO14443A passive target(s) found:
ISO/IEC 14443A (106 kbps) target:
ATQA (SENS_RES): 00 04
UID (NFCID1): d3 a7 a3 12
SAK (SEL_RES): 28
ATS: 78 80 a0 02 20 90 00 00 00 00 00 d3 a7 a3 12

I have looked up information from AN10833, according the document it seems like be MIFARE
Classic 1KB+ MIFARE plus or MIFARE Classic 1KB+ MIFARE DESFire or…
or even maybe a java card JCOP41 v2.3.1?

I cant determine which type so I can't do other things. when I use mfoc, it tells me " Cannot determine card type from SAK"

any idea?

Error while requesting plain tag-nonce

hi everyone, i open this topic searching for someone who could give me a hand, i put this 2 dumps of the same card, the error ocurrs when the last sector's key (B key) is found , nevertheless, if i remove manually the last sector B key (i wanna clarify that i have the keys of this card), the process continue and finally gets the keys. i hope someone could give me an answer, thanks!

Sector 00 -  FOUND_KEY   [A]  Sector 00 -  FOUND_KEY   [B]  
Sector 01 -  FOUND_KEY   [A]  Sector 01 -  FOUND_KEY   [B]  
Sector 02 -  FOUND_KEY   [A]  Sector 02 -  FOUND_KEY   [B]  
Sector 03 -  FOUND_KEY   [A]  Sector 03 -  FOUND_KEY   [B]  
Sector 04 -  FOUND_KEY   [A]  Sector 04 -  FOUND_KEY   [B]  
Sector 05 -  FOUND_KEY   [A]  Sector 05 -  FOUND_KEY   [B]  
Sector 06 -  FOUND_KEY   [A]  Sector 06 -  FOUND_KEY   [B]  
Sector 07 -  FOUND_KEY   [A]  Sector 07 -  FOUND_KEY   [B]  
Sector 08 -  FOUND_KEY   [A]  Sector 08 -  FOUND_KEY   [B]  
Sector 09 -  FOUND_KEY   [A]  Sector 09 -  FOUND_KEY   [B]  
Sector 10 -  FOUND_KEY   [A]  Sector 10 -  FOUND_KEY   [B]  
Sector 11 -  UNKNOWN_KEY [A]  Sector 11 -  FOUND_KEY   [B]  
Sector 12 -  FOUND_KEY   [A]  Sector 12 -  FOUND_KEY   [B]  
Sector 13 -  FOUND_KEY   [A]  Sector 13 -  FOUND_KEY   [B]  
Sector 14 -  FOUND_KEY   [A]  Sector 14 -  FOUND_KEY   [B]  
Sector 15 -  FOUND_KEY   [A]  Sector 15 -  UNKNOWN_KEY [B]  

Using sector 00 as an exploit sector
Sector: 11, type A, probe 0, distance 13209 ....
# 
Sector 00 -  FOUND_KEY   [A]  Sector 00 -  FOUND_KEY   [B]  
Sector 01 -  FOUND_KEY   [A]  Sector 01 -  FOUND_KEY   [B]  
Sector 02 -  FOUND_KEY   [A]  Sector 02 -  FOUND_KEY   [B]  
Sector 03 -  FOUND_KEY   [A]  Sector 03 -  FOUND_KEY   [B]  
Sector 04 -  FOUND_KEY   [A]  Sector 04 -  FOUND_KEY   [B]  
Sector 05 -  FOUND_KEY   [A]  Sector 05 -  FOUND_KEY   [B]  
Sector 06 -  FOUND_KEY   [A]  Sector 06 -  FOUND_KEY   [B]  
Sector 07 -  FOUND_KEY   [A]  Sector 07 -  FOUND_KEY   [B]  
Sector 08 -  FOUND_KEY   [A]  Sector 08 -  FOUND_KEY   [B]  
Sector 09 -  FOUND_KEY   [A]  Sector 09 -  FOUND_KEY   [B]  
Sector 10 -  FOUND_KEY   [A]  Sector 10 -  FOUND_KEY   [B]  
Sector 11 -  UNKNOWN_KEY [A]  Sector 11 -  FOUND_KEY   [B]  
Sector 12 -  FOUND_KEY   [A]  Sector 12 -  FOUND_KEY   [B]  
Sector 13 -  FOUND_KEY   [A]  Sector 13 -  FOUND_KEY   [B]  
Sector 14 -  FOUND_KEY   [A]  Sector 14 -  FOUND_KEY   [B]  
Sector 15 -  FOUND_KEY   [A]  Sector 15 -  FOUND_KEY   [B]  

Using sector 00 as an exploit sector
Error while requesting plain tag-nonce

Cannot write dump file

I get this error trying to dump a card with mfoc. The card is a mifaire classic 4K. I'm running Kali 2017.1
Would you have any idea of the reason why ?

thnaks in advance

Build fails on i386

I just tried to build mfoc 0.10.4 against libnfc 1.7.0rc1 on both amd64 and 
i386.

On i386:

make[3]: Entering directory `/build/buildd/mfoc-0.10.4/src'
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -std=c99 -c crapto1.c
In file included from crapto1.c:20:0:
crapto1.h: In function 'parity':
crapto1.h:65:5: warning: implicit declaration of function 'asm' 
[-Wimplicit-function-declaration]
crapto1.h:71:27: error: expected ')' before ':' token
make[3]: *** [crapto1.o] Error 1
make[3]: Leaving directory `/build/buildd/mfoc-0.10.4/src'

Whereas on amd64:

make[3]: Entering directory `/build/buildd/mfoc-0.10.4/src'
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -std=c99 -c crapto1.c
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -std=c99 -c crypto1.c
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -std=c99 -c mfoc.c
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -std=c99 -c mifare.c
gcc -DHAVE_CONFIG_H -I. -I..     -g -O2 -std=c99 -c nfc-utils.c

Original issue reported on code.google.com by jdthood on 31 Jan 2013 at 10:45

MFOC -D output key is reversed .

image

actual key is 729c6c622f34

image

there's no error compiling MFOC.I compiled in Kali 2017.1 any idea why the output key when i used -D commandline is reversed .

How to write dump back to card?

I'll restored all keys and got card dump. How to write dump back to card?
nfc-mfclassic write "Could not read dump file"

Card Mifare Plus in Classic mode.

Truncated dump for Mifare Classic Mini

When I try to dump a Mifare Classic Mini card (0.3K) into a file (mfoc -O dump.mfd), I don't get the whole dump in the output file.

FB FE D8 C2 1F 89 04 00 C2 12 00 00 00 00 00 14
A5 00 09 38 09 38 09 38 09 38 00 05 00 05 00 05
00 05 00 05 00 05 00 05 00 05 00 05 00 05 00 05
A0 A1 A2 A3 A4 A5 61 E7 89 C1 B0 B1 B2 B3 B4 B5
88 05 D8 82 00 04 B2 1E 00 00 21 00 0C 01 AF D2
01 01 01 0E 02 08 08 08 00 00 00 00 00 00 00 00
00 03 C7 01

On the other hand, the console output seems to dump correctly the card content :

Block 19, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  4b  44  bb  5a  00  00  00  00  00  00  
Block 18, type A, key a0a1a2a3a4a5 :00  00  54  cb  18  96  f7  00  00  00  00  00  4d  49  43  00  
Block 17, type B, key c43a971cfb19 :dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  
Block 16, type B, key c43a971cfb19 :dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  
Block 15, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  0f  00  ff  e1  00  00  00  00  00  00  
Block 14, type B, key 68ae574e79ec :dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  
Block 13, type B, key 68ae574e79ec :dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  
Block 12, type B, key 68ae574e79ec :dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  dd  
Block 11, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  0f  00  ff  4d  00  00  00  00  00  00  
Block 10, type B, key dc23a6a62cf3 :00  00  00  00  00  00  00  00  dd  dd  dd  dd  dd  dd  dd  dd  
Block 09, type B, key dc23a6a62cf3 :00  00  00  02  00  00  00  00  00  00  00  00  00  00  00  00  
Block 08, type B, key dc23a6a62cf3 :00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  
Block 07, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  1e  11  ee  5a  00  00  00  00  00  00  
Block 06, type B, key c90f0f964570 :00  03  c7  01  35  a0  00  01  00  00  00  00  00  00  00  00  
Block 05, type B, key c90f0f964570 :01  01  01  0e  02  08  08  08  00  00  00  00  00  00  00  00  
Block 04, type A, key a0a1a2a3a4a5 :88  05  d8  82  00  04  b2  1e  00  00  21  00  0c  01  af  d2  
Block 03, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  61  e7  89  c1  00  00  00  00  00  00  
Block 02, type A, key a0a1a2a3a4a5 :00  05  00  05  00  05  00  05  00  05  00  05  00  05  00  05  
Block 01, type A, key a0a1a2a3a4a5 :a5  00  09  38  09  38  09  38  09  38  00  05  00  05  00  05  
Block 00, type A, key a0a1a2a3a4a5 :fb  fe  d8  c2  1f  89  04  00  c2  12  00  00  00  00  00  14 

In file included from nfc-utils.c:35:0: expected «const struct nfc_target *» but argument is of type «nfc_target»

diff --git a/src/nfc-utils.c b/src/nfc-utils.c
index deb51e7..0a34b0e 100644
--- a/src/nfc-utils.c
+++ b/src/nfc-utils.c
@@ -118,7 +118,7 @@ void
 print_nfc_target(const nfc_target nt, bool verbose)
 {
   char *s;
-  str_nfc_target(&s, nt, verbose);
+  str_nfc_target(&s, &nt, verbose);
   printf("%s", s);
   free(s);
 }

Original issue reported on code.google.com by [email protected] on 29 Mar 2013 at 3:26

Error using ACR122U210

I have the ACR122U210 reader, and nfc-list display correctly the information 
from my device. I've downloaded the latest drivers from the manufacturer, also 
I've tried using several libnfc and mfoc versions as well. The error is this:

root@bt:~# mfoc -P 500 -O out
    ATQA (SENS_RES): 00  04  
* UID size: single
* bit frame anticollision supported
       UID (NFCID1): ab  08  5c  8c  
      SAK (SEL_RES): 08  
* Not compliant with ISO/IEC 14443-4
* Not compliant with ISO/IEC 18092
Fingerprinting based on ATQA & SAK values:
* Mifare Classic 1K
* Mifare Plus (4-byte UID) 2K SL1
* SmartMX with Mifare 1K emulation
[Key: ffffffffffff] -> [................]
[Key: a0a1a2a3a4a5] -> [................]
[Key: d3f7d3f7d3f7] -> [................]
[Key: 000000000000] -> [................]
[Key: b0b1b2b3b4b5] -> [................]
[Key: 4d3a99c351dd] -> [................]
[Key: 1a982c7e459a] -> [................]
[Key: aabbccddeeff] -> [................]
[Key: 714c5c886e97] -> [................]
[Key: 587ee5f9350f] -> [................]
[Key: a0478cc39091] -> [................]
[Key: 533cb6c723f6] -> [................]
[Key: 8fd0a4f256e9] -> [................]

Sector 00 -  UNKNOWN_KEY [A]  Sector 00 -  UNKNOWN_KEY [B]  
Sector 01 -  UNKNOWN_KEY [A]  Sector 01 -  UNKNOWN_KEY [B]  
Sector 02 -  UNKNOWN_KEY [A]  Sector 02 -  UNKNOWN_KEY [B]  
Sector 03 -  UNKNOWN_KEY [A]  Sector 03 -  UNKNOWN_KEY [B]  
Sector 04 -  UNKNOWN_KEY [A]  Sector 04 -  UNKNOWN_KEY [B]  
Sector 05 -  UNKNOWN_KEY [A]  Sector 05 -  UNKNOWN_KEY [B]  
Sector 06 -  UNKNOWN_KEY [A]  Sector 06 -  UNKNOWN_KEY [B]  
Sector 07 -  UNKNOWN_KEY [A]  Sector 07 -  UNKNOWN_KEY [B]  
Sector 08 -  UNKNOWN_KEY [A]  Sector 08 -  UNKNOWN_KEY [B]  
Sector 09 -  UNKNOWN_KEY [A]  Sector 09 -  UNKNOWN_KEY [B]  
Sector 10 -  UNKNOWN_KEY [A]  Sector 10 -  UNKNOWN_KEY [B]  
Sector 11 -  UNKNOWN_KEY [A]  Sector 11 -  UNKNOWN_KEY [B]  
Sector 12 -  UNKNOWN_KEY [A]  Sector 12 -  UNKNOWN_KEY [B]  
Sector 13 -  UNKNOWN_KEY [A]  Sector 13 -  UNKNOWN_KEY [B]  
Sector 14 -  UNKNOWN_KEY [A]  Sector 14 -  UNKNOWN_KEY [B]  
Sector 15 -  UNKNOWN_KEY [A]  Sector 15 -  UNKNOWN_KEY [B]  
mfoc: ERROR: 

No sector encrypted with the default key has been found, exiting..

I've read that this is a problem with my version of the ACR122U, but I don't 
have any other reader to test.

Original issue reported on code.google.com by [email protected] on 19 May 2013 at 4:46

Error, cannot dump file

mfoc/src/mfoc.c

Line 732 in 9d9f01f

fprintf(stdout, "Error, cannot write dump\n");

mfoc version 0.10.7.
It gives this error for mifare classic 4k.

Auth with all sectors succeeded, dumping keys to a file!
Block 255, type A, key 7259fa0197c6 :00 00 00 00 00 00 7c 37 88 00 00 00 00 00 00 00
Block 254, type A, key 7259fa0197c6 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
..........
Block 00, type A, key ffffffffffff :04 47 12 22 e3 56 80 18 42 00 80 00 00 00 09 17
Error, cannot write dump

please help me figure out why.

No NFC device found with mfoc, but it does work with libnfc examples/utils with adafruit pn532

Hello, I have build mfoc and libnfc, and the example programs with libnfc seem to be working, however I get the "No NFC device found with mfoc". Any advice here would be appreciated. Is there some specific output I should share?

Am I perhaps not getting the correct config or building libnfc improperly? Is mfoc not detecting its configuration?
(I can successfully run their ./examples/nfc-poll program to detect an nfc card)

(For some context, I was getting this error before with libnfc, but then I followed the instructions in the last post here by webnology.ch by on nov 19, 2013.) Which I used to build libnfc:
`$ sudo apt-get install autoconf automake libtool
$ sudo apt-get install libusb-0.1-4 libusb-dev libpcsclite1 libpcsclite-dev libccid pcscd
$ sudo apt-get install git
$ sudo git clone https://code.google.com/p/libnfc/
$ cd libnfc
$ mkdir /etc/nfc
$ mkdir /etc/nfc/devices.d/
$ sudo nano /etc/nfc/devices.d/pn532_via_uart2usb.conf

paste the following 5 lines into the pn532_via_uart2usb.conf:

Typical configuration file for PN532 board (ie. microbuilder.eu / Adafruit) device

name = "Adafruit PN532 board via UART"
connstring = pn532_uart:/dev/ttyUSB0
allow_intrusive_scan = true
log_level = 3

$ sudo autoreconf -vis
$ ./configure --prefix=/usr --with-drivers=pn532_uart --sysconfdir=/etc
$ sudo make clean
$ sudo make
$ sudo make install all

plugin ure ftdi usb

$ cd examples
$ sudo ./nfc-poll`

I rebuilt mfoc after getting the libnfc examples to work,

This is how I am build mfoc on my linux PC.
`

git clone https://github.com/nfc-tools/mfoc && cd mfoc

Then, we start the installation in the same way:

autoreconf -vis

./configure --with-drivers=pn532_uart --enable-serial-autoprobe

sudo make clean all

sudo make

sudo make install`

This is what happens when I run mfoc
mfoc -P 500 -O dump_first_try.dmp No NFC device found.

Error happens during mfoc make

What steps will reproduce the problem?
1. export libnfc_CFLAGS="-I /usr/local/lib/libnfc/include"
2. export libnfc_LIBS="-L /usr/local/lib/libnfc/lib"
3. ./configure --prefix=/usr/local/lib/mfoc
4. make

What version of the product are you using? On what operating system?

Libnfc: 1.7.1
mfoc: 0.10.7
Ubuntu: 14.04LTS

Please provide any additional information below.

tony@ubuntu:/usr/local/src/mfoc-0.10.7$ make
make  all-recursive
make[1]: Entering directory `/usr/local/src/mfoc-0.10.7'
Making all in src
make[2]: Entering directory `/usr/local/src/mfoc-0.10.7/src'
  CCLD   mfoc
mfoc.o: In function `mf_init':
/usr/local/src/mfoc-0.10.7/src/mfoc.c:584: undefined reference to `nfc_init'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:589: undefined reference to `nfc_open'
mfoc.o: In function `mf_configure':
/usr/local/src/mfoc-0.10.7/src/mfoc.c:598: undefined reference to 
`nfc_initiator_init'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:603: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:608: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:613: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:617: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:622: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:604: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:599: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:618: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:614: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:609: undefined reference to `nfc_perror'
mfoc.o: In function `mf_select_tag':
/usr/local/src/mfoc-0.10.7/src/mfoc.c:635: undefined reference to 
`nfc_initiator_select_passive_target'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:637: undefined reference to `nfc_close'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:638: undefined reference to `nfc_exit'
mfoc.o: In function `mf_anticollision':
/usr/local/src/mfoc-0.10.7/src/mfoc.c:681: undefined reference to 
`nfc_initiator_select_passive_target'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:682: undefined reference to `nfc_perror'
mfoc.o: In function `mf_enhanced_auth':
/usr/local/src/mfoc-0.10.7/src/mfoc.c:717: undefined reference to 
`iso14443a_crc_append'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:722: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:729: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:734: undefined reference to 
`nfc_initiator_transceive_bytes'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:739: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:776: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:785: undefined reference to 
`nfc_initiator_transceive_bits'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:864: undefined reference to 
`iso14443a_crc_append'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:872: undefined reference to 
`nfc_initiator_transceive_bits'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:878: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:883: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:814: undefined reference to 
`nfc_initiator_transceive_bits'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:842: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:843: undefined reference to 
`nfc_initiator_transceive_bits'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:777: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:740: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:730: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:723: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:884: undefined reference to `nfc_perror'
mfoc.o:/usr/local/src/mfoc-0.10.7/src/mfoc.c:879: more undefined references to 
`nfc_perror' follow
mfoc.o: In function `main':
/usr/local/src/mfoc-0.10.7/src/mfoc.c:178: undefined reference to 
`nfc_initiator_init'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:183: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:188: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:193: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:197: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:208: undefined reference to 
`nfc_initiator_select_passive_target'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:179: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:553: undefined reference to `nfc_close'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:554: undefined reference to `nfc_exit'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:184: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:189: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:194: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:198: undefined reference to `nfc_perror'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:513: undefined reference to `nfc_perror'
mfoc.o:/usr/local/src/mfoc-0.10.7/src/mfoc.c:209: more undefined references to 
`nfc_perror' follow
mfoc.o: In function `main':
/usr/local/src/mfoc-0.10.7/src/mfoc.c:545: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:546: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:549: undefined reference to `nfc_close'
/usr/local/src/mfoc-0.10.7/src/mfoc.c:550: undefined reference to `nfc_exit'
mifare.o: In function `nfc_initiator_mifare_cmd':
/usr/local/src/mfoc-0.10.7/src/mifare.c:123: undefined reference to 
`nfc_device_set_property_bool'
/usr/local/src/mfoc-0.10.7/src/mifare.c:127: undefined reference to 
`nfc_initiator_transceive_bytes'
nfc-utils.o: In function `print_nfc_target':
/usr/local/src/mfoc-0.10.7/src/nfc-utils.c:125: undefined reference to 
`str_nfc_target'
/usr/local/src/mfoc-0.10.7/src/nfc-utils.c:127: undefined reference to 
`nfc_free'
collect2: error: ld returned 1 exit status
make[2]: *** [mfoc] Error 1
make[2]: Leaving directory `/usr/local/src/mfoc-0.10.7/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/mfoc-0.10.7'
make: *** [all] Error 2


Original issue reported on code.google.com by [email protected] on 13 Jan 2015 at 9:27

Can't dump tag ISO14443B-2 ST Rx

My ACR122U can detect the tag : ISO14443B-2 ST Rx and show me his UID.
But when I launch MFOC, I got : Error no tag was found

Can't add key to default key for miLazyCracker.sh

Hi everybody. i had got the keys from a random mifare classic 1k, i used mfoc to add default keys and that keys were add, but when i used again MFOC in another terminal, it doesn't appear the new added keys.
Im trying to use miLazyCracker but i got the error because that program use the default keys from mfoc and i can't add it.

root@kali:~/miLazyCracker-master# mfoc -f keya.txt -O 1
The custom key 0x1848a8d1e4c5 has been added to the default keys
The custom key 0x0172066b2f03 has been added to the default keys
Found Mifare Classic 1k tag
ISO/IEC 14443A (106 kbps) target:
ATQA (SENS_RES): 00 04

  • UID size: single
  • bit frame anticollision supported
    UID (NFCID1): XX XX XX XX
    SAK (SEL_RES): 08
  • Not compliant with ISO/IEC 14443-4
  • Not compliant with ISO/IEC 18092
    Fingerprinting based on MIFARE type Identification Procedure:
  • MIFARE Classic 1K
  • MIFARE Plus (4 Byte UID or 4 Byte RID) 2K, Security level 1
  • SmartMX with MIFARE 1K emulation
    Other possible matches based on ATQA & SAK values:
    Try to authenticate to all sectors with default keys...
    Symbols: '.' no key found, '/' A key found, '' B key found, 'x' both keys found
    [Key: 1848a8d1e4c5] -> [................]
    [Key: 0172066b2f03] -> [x...............]
    [Key: ffffffffffff] -> [x.......^C

root@kali:~/miLazyCracker-master# ./miLazyCracker.sh
Found Mifare Classic 1k tag
ISO/IEC 14443A (106 kbps) target:
ATQA (SENS_RES): 00 04

  • UID size: single
  • bit frame anticollision supported
    UID (NFCID1): XX XX XX XX
    SAK (SEL_RES): 08
  • Not compliant with ISO/IEC 14443-4
  • Not compliant with ISO/IEC 18092
    Fingerprinting based on MIFARE type Identification Procedure:
  • MIFARE Classic 1K
  • MIFARE Plus (4 Byte UID or 4 Byte RID) 2K, Security level 1
  • SmartMX with MIFARE 1K emulation
    Other possible matches based on ATQA & SAK values:
    Try to authenticate to all sectors with default keys...
    Symbols: '.' no key found, '/' A key found, '' B key found, 'x' both keys found
    [Key: ffffffffffff] -> [................]
    [Key: a0a1a2a3a4a5] -> [................]
    [Key: d3f7d3f7d3f7] -> [................]
    [Key: 000000000000] -> [................]
    [Key: b0b1b2b3b4b5] -> [................]
    [Key: 4d3a99c351dd] -> [................]
    [Key: 1a982c7e459a] -> [................]
    [Key: aabbccddeeff] -> [................]
    [Key: 714c5c886e97] -> [................]
    [Key: 587ee5f9350f] -> [.......^C

Error while requesting plain tag-nonce

I'm trying to get the keys from a mifire classic card, and after it match with several keys appears the error
"Error while requesting plain tag-nonce"
What happen?

missing dependency

So, I keep trying to ./configure...

I also keep getting a "configure: error: libnfc >= 1.7.0 is mandatory." error, yet I'm pretty sure, checking the package manager, I have 1.7.1-4 installed... What am I doing wrong?

Card is not vulnerable to nested attack

When it try to crack the AB keys of data sector, it encounter such problem, So what should I do?

Sector 00 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 01 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 02 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 03 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 04 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 05 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 06 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 07 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 08 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 09 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 10 - Unknown Key A               Unknown Key B
Sector 11 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 12 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 13 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 14 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 15 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff


Using sector 00 as an exploit sector
Card is not vulnerable to nested attack

mfoc via uart

I have an Adafruit PN532 Breakout Board and an FTDI Friend.
I've installed the libnfc to use via uart and I can successfully use my NFC/RFID reader (nfc-list), but when I try to use the mfoc, it gives me a "No NFC device found" error.
What can I do?

MFOC doesnt work on certain types of Mifare classic card.

I am on MFOC 0.10.7 on libnfc 1.7.1.

I have tried with other cards and there is no problem retrieving the keys under 
5 minutes. However this card seems to be taking a long time.

The card is a mifare classic 1K but the manufacturer is unknown.

There are 13 other sectors using the default keys of a1a2a3a4a5a6/b1b2b3b4b5b6.

Is it possible that mifare classic cards has been patched? or is there any 
suggestions to retrieve the keys of this particular card.

On a side note, may I ask if there is any way to get mfoc to exploit other 
sectors instead of 0? Maybe there's a chance.


mac-1320:src user$ mfoc -P 8000 -O dump
ISO/IEC 14443A (106 kbps) target:
    ATQA (SENS_RES): 00  44  
* UID size: double
* bit frame anticollision supported
       UID (NFCID1): 2f  f0  b8  be  
      SAK (SEL_RES): 08  
* Not compliant with ISO/IEC 14443-4
* Not compliant with ISO/IEC 18092

Fingerprinting based on MIFARE type Identification Procedure:
* MIFARE Classic 1K
* MIFARE Plus (7 Byte UID) 2K, Security level 1
Other possible matches based on ATQA & SAK values:

Try to authenticate to all sectors with default keys...
Symbols: '.' no key found, '/' A key found, '\' B key found, 'x' both keys found
[Key: ffffffffffff] -> [..x.............]
[Key: a0a1a2a3a4a5] -> [..x.////////////]
[Key: d3f7d3f7d3f7] -> [..x.////////////]
[Key: 000000000000] -> [..x.////////////]
[Key: b0b1b2b3b4b5] -> [..x.xxxxxxxxxxxx]
[Key: 4d3a99c351dd] -> [..x.xxxxxxxxxxxx]
[Key: 1a982c7e459a] -> [..x.xxxxxxxxxxxx]
[Key: aabbccddeeff] -> [..x.xxxxxxxxxxxx]
[Key: 714c5c886e97] -> [..x.xxxxxxxxxxxx]
[Key: 587ee5f9350f] -> [..x.xxxxxxxxxxxx]
[Key: a0478cc39091] -> [..x.xxxxxxxxxxxx]
[Key: 533cb6c723f6] -> [..x.xxxxxxxxxxxx]
[Key: 8fd0a4f256e9] -> [..x.xxxxxxxxxxxx]

Sector 00 -  UNKNOWN_KEY [A]  Sector 00 -  UNKNOWN_KEY [B]  
Sector 01 -  UNKNOWN_KEY [A]  Sector 01 -  UNKNOWN_KEY [B]  
Sector 02 -  FOUND_KEY   [A]  Sector 02 -  FOUND_KEY   [B]  
Sector 03 -  UNKNOWN_KEY [A]  Sector 03 -  UNKNOWN_KEY [B]  
Sector 04 -  FOUND_KEY   [A]  Sector 04 -  FOUND_KEY   [B]  
Sector 05 -  FOUND_KEY   [A]  Sector 05 -  FOUND_KEY   [B]  
Sector 06 -  FOUND_KEY   [A]  Sector 06 -  FOUND_KEY   [B]  
Sector 07 -  FOUND_KEY   [A]  Sector 07 -  FOUND_KEY   [B]  
Sector 08 -  FOUND_KEY   [A]  Sector 08 -  FOUND_KEY   [B]  
Sector 09 -  FOUND_KEY   [A]  Sector 09 -  FOUND_KEY   [B]  
Sector 10 -  FOUND_KEY   [A]  Sector 10 -  FOUND_KEY   [B]  
Sector 11 -  FOUND_KEY   [A]  Sector 11 -  FOUND_KEY   [B]  
Sector 12 -  FOUND_KEY   [A]  Sector 12 -  FOUND_KEY   [B]  
Sector 13 -  FOUND_KEY   [A]  Sector 13 -  FOUND_KEY   [B]  
Sector 14 -  FOUND_KEY   [A]  Sector 14 -  FOUND_KEY   [B]  
Sector 15 -  FOUND_KEY   [A]  Sector 15 -  FOUND_KEY   [B]  


Using sector 02 as an exploit sector
Sector: 0, type A, probe 0, distance 24267 .....
Sector: 0, type A, probe 1, distance 38049 .....
Sector: 0, type A, probe 2, distance 35545 .....
Sector: 0, type A, probe 3, distance 39176 .....
Sector: 0, type A, probe 4, distance 23788 .....

...

Sector: 0, type A, probe 1898, distance 24569 .....


The mfoc has been running for 3 hours but to no avail.

Original issue reported on code.google.com by [email protected] on 23 Mar 2014 at 11:06

Is it possible to use the crypto-1 part as a library of sorts?

The code is unreadable, and I don't have the mathematical background to understand a single thing that is happening in the crapto-1/crypto-1 parts. I'm wondering if it's possible to use it as a library to authenticate a MIFARE Classic tag without braking it, and how, if anyone would be so willing and kind to give at least a few hints.

Basically, the question is: is it a crypto-1 implementation? If so, how can I leverage it?

Can't install on Debian 8

Hello

I'm not able to install mfoc on Debian 8

I've tried with automake

automake

configure.ac: error: no proper invocation of AM_INIT_AUTOMAKE was found.
configure.ac: You should verify that configure.ac invokes AM_INIT_AUTOMAKE,
configure.ac: that aclocal.m4 is present in the top-level directory,
configure.ac: and that aclocal.m4 was recently regenerated (using aclocal)
Makefile.am: error: required file './INSTALL' not found
Makefile.am: 'automake --add-missing' can install 'INSTALL'
configure.ac:5: error: required file 'config.h.in' not found
src/Makefile.am: error: required file './depcomp' not found
src/Makefile.am: 'automake --add-missing' can install 'depcomp'
/usr/share/automake-1.14/am/depend2.am: error: am__fastdepCC does not appear in AM_CONDITIONAL
/usr/share/automake-1.14/am/depend2.am: The usual way to define 'am__fastdepCC' is to add 'AC_PROG_CC'
/usr/share/automake-1.14/am/depend2.am: to 'configure.ac' and run 'aclocal' and 'autoconf' again
/usr/share/automake-1.14/am/depend2.am: error: AMDEP does not appear in AM_CONDITIONAL
/usr/share/automake-1.14/am/depend2.am: The usual way to define 'AMDEP' is to add one of the compiler tests
/usr/share/automake-1.14/am/depend2.am: AC_PROG_CC, AC_PROG_CXX, AC_PROG_OBJC, AC_PROG_OBJCXX,
/usr/share/automake-1.14/am/depend2.am: AM_PROG_AS, AM_PROG_GCJ, AM_PROG_UPC
/usr/share/automake-1.14/am/depend2.am: to 'configure.ac' and run 'aclocal' and 'autoconf' again

and with ./configure

./configure

-bash: ./configure: Datei oder Verzeichnis nicht gefunden // Translated " File or Folder not found "

What do i wrong ??

Hitmare

Mifare mini truncated dump

Hi all,

Sorry to open that thread but I failed to figure out how to solve my issue with my Mifare 0.3k dump.
I got all the keys, worked with mfoc 0.10.7 and got a dump which appears as partial.
I don't know if it is the last version but I failed installing it from here and took the one available on Kali repository...
I've seen this #33 but don't know how to implement it
I've also seen this http://www.proxmark.org/forum/viewtopic.php?id=5443 which is very interesting but I also failed applying it to my issue.

Is there an easy way to get my full dump (or build manually the dump as the console output seems to be ok)
Another question, is there a way to edit a mfd dump to have custom dump and/or to correct it?
I saw a lot of persons making that on the internet but no one sharing the code.

Thank you very much for all the help you could give!

Funky

Make error

What steps will reproduce the problem?
1. make

What version of the product are you using? On what operating system?

Distributor ID: Ubuntu
Description:    Ubuntu 12.10
Release:        12.10
Codename:       quantal

libnfc-1.7.0-rc7

Please provide any additional information below.

# make
(CDPATH="${ZSH_VERSION+.}:" && cd . && /bin/bash /tools/mfoc-0.10.5/missing 
--run autoheader)
rm -f stamp-h1
touch config.h.in
cd . && /bin/bash ./config.status config.h
config.status: creating config.h
config.status: config.h is unchanged
make  all-recursive
make[1]: ingresso nella directory "/tools/mfoc-0.10.5"
Making all in src
make[2]: ingresso nella directory "/tools/mfoc-0.10.5/src"
  CC     mfoc.o
  CC     mifare.o
  CC     nfc-utils.o
nfc-utils.c: In function âprint_nfc_targetâ:
nfc-utils.c:121:3: error: incompatible type for argument 2 of âstr_nfc_targetâ
In file included from nfc-utils.c:35:0:
/usr/local/include/nfc/nfc.h:146:18: note: expected âconst struct nfc_target 
*â but argument is of type ânfc_targetâ
make[2]: *** [nfc-utils.o] Errore 1
make[2]: uscita dalla directory "/tools/mfoc-0.10.5/src"
make[1]: *** [all-recursive] Errore 1
make[1]: uscita dalla directory "/tools/mfoc-0.10.5"
make: *** [all] Errore 2

Original issue reported on code.google.com by [email protected] on 13 May 2013 at 1:03

Card is not vulnerable to nested attack

Hello,
I used the following command to perform a dump of my Mifare Classic 1K card:

mfoc -O my_dump.mdf

Then I used the following command to write the dump into a blank card:

nfc-mfclassic w A my_dump.mdf blank.mdf f
Result:

NFC reader: ACS / ACR122U PICC Interface opened
  Found MIFARE Classic card:
  ISO/IEC 14443A (106 kbps) target:
      ATQA (SENS_RES): 00  04  
         UID (NFCID1): a0  b0  5b  56  
        SAK (SEL_RES): 08  
  Guessing size: seems to be a 1024-byte card
  Writing 64 blocks |...............................................................|
  Done, 63 of 64 blocks written.

After that I tried to read my new card with same command used at the beginning:

mfoc -O my_new_dump.mdf

And the result is:

Found Mifare Classic 1k tag
  ISO/IEC 14443A (106 kbps) target:
      ATQA (SENS_RES): 00  04  
  * UID size: single
  * bit frame anticollision supported
         UID (NFCID1): a0  b0  5b  56  
        SAK (SEL_RES): 08  
  * Not compliant with ISO/IEC 14443-4
  * Not compliant with ISO/IEC 18092
  
  Fingerprinting based on MIFARE type Identification Procedure:
  * MIFARE Classic 1K
  * MIFARE Plus (4 Byte UID or 4 Byte RID) 2K, Security level 1
  * SmartMX with MIFARE 1K emulation
  Other possible matches based on ATQA & SAK values:
  
  Try to authenticate to all sectors with default keys...
  Symbols: '.' no key found, '/' A key found, '\' B key found, 'x' both keys found
  [Key: ffffffffffff] -> [................]
  [Key: a0a1a2a3a4a5] -> [/...............]
  [Key: d3f7d3f7d3f7] -> [/...............]
  [Key: 000000000000] -> [/...............]
  [Key: b0b1b2b3b4b5] -> [/...............]
  [Key: 4d3a99c351dd] -> [/...............]
  [Key: 1a982c7e459a] -> [/...............]
  [Key: aabbccddeeff] -> [/...............]
  [Key: 714c5c886e97] -> [/...............]
  [Key: 587ee5f9350f] -> [/...............]
  [Key: a0478cc39091] -> [/...............]
  [Key: 533cb6c723f6] -> [/...............]
  [Key: 8fd0a4f256e9] -> [/...............]
  
  Sector 00 - Found   Key A: a0a1a2a3a4a5 Unknown Key B
  Sector 01 - Unknown Key A               Unknown Key B
  Sector 02 - Unknown Key A               Unknown Key B
  Sector 03 - Unknown Key A               Unknown Key B
  Sector 04 - Unknown Key A               Unknown Key B
  Sector 05 - Unknown Key A               Unknown Key B
  Sector 06 - Unknown Key A               Unknown Key B
  Sector 07 - Unknown Key A               Unknown Key B
  Sector 08 - Unknown Key A               Unknown Key B
  Sector 09 - Unknown Key A               Unknown Key B
  Sector 10 - Unknown Key A               Unknown Key B
  Sector 11 - Unknown Key A               Unknown Key B
  Sector 12 - Unknown Key A               Unknown Key B
  Sector 13 - Unknown Key A               Unknown Key B
  Sector 14 - Unknown Key A               Unknown Key B
  Sector 15 - Unknown Key A               Unknown Key B
  
  
  Using sector 00 as an exploit sector
  Card is not vulnerable to nested attack

I tried also with the mfcuk command but I cannot read.

Is there someone can help me explaining what happend?
Thanks

Patch for Mifare Classic Mini

Attached is a Patch to support Mifare Classic Mini tags. Would be great if you 
can include it.

Sample output:
firefart@Laptop:~/mfoc-0.10.7/src$ ./mfoc -O test.mfd 
Found Mifare Classic Mini tag
ISO/IEC 14443A (106 kbps) target:
    ATQA (SENS_RES): 00  04  
* UID size: single
* bit frame anticollision supported
       UID (NFCID1): XX  XX  XX  XX  
      SAK (SEL_RES): 09  
* Not compliant with ISO/IEC 14443-4
* Not compliant with ISO/IEC 18092

Fingerprinting based on MIFARE type Identification Procedure:
* MIFARE Mini 0.3K
* SmartMX with MIFARE 1K emulation
Other possible matches based on ATQA & SAK values:

Try to authenticate to all sectors with default keys...
Symbols: '.' no key found, '/' A key found, '\' B key found, 'x' both keys found
[Key: ffffffffffff] -> [.....]
[Key: a0a1a2a3a4a5] -> [/....]
[Key: d3f7d3f7d3f7] -> [/....]
[Key: 000000000000] -> [/....]
[Key: b0b1b2b3b4b5] -> [/....]
[Key: 4d3a99c351dd] -> [/....]
[Key: 1a982c7e459a] -> [/....]
[Key: aabbccddeeff] -> [/....]
[Key: 714c5c886e97] -> [/....]
[Key: 587ee5f9350f] -> [/....]
[Key: a0478cc39091] -> [/....]
[Key: 533cb6c723f6] -> [/....]
[Key: 8fd0a4f256e9] -> [/....]
[Key: b4c132439eef] -> [x....]

Sector 00 -  FOUND_KEY   [A]  Sector 00 -  FOUND_KEY   [B]  
Sector 01 -  UNKNOWN_KEY [A]  Sector 01 -  UNKNOWN_KEY [B]  
Sector 02 -  UNKNOWN_KEY [A]  Sector 02 -  UNKNOWN_KEY [B]  
Sector 03 -  UNKNOWN_KEY [A]  Sector 03 -  UNKNOWN_KEY [B]  
Sector 04 -  UNKNOWN_KEY [A]  Sector 04 -  UNKNOWN_KEY [B]  


Using sector 00 as an exploit sector
Sector: 1, type A, probe 0, distance 12022 .....
Found Key: A [1b28835a9bdf]
Sector: 2, type A, probe 0, distance 12022 .....
Found Key: A [b94f10488015]
Sector: 3, type A, probe 0, distance 12020 .....
Found Key: A [f04898d03e33]
Sector: 4, type A, probe 0, distance 12024 .....
Found Key: A [23406e5056aa]
Sector: 1, type B, probe 0, distance 12020 .....
Sector: 1, type B, probe 1, distance 12020 .....
Found Key: B [28539669015e]
Sector: 2, type B, probe 0, distance 12026 .....
Found Key: B [aa988bc4eb3e]
Sector: 3, type B, probe 0, distance 12020 .....
Found Key: B [7332014c8fd1]
Sector: 4, type B, probe 0, distance 12020 .....
Sector: 4, type B, probe 1, distance 12070 .....
Sector: 4, type B, probe 2, distance 12022 .....
Sector: 4, type B, probe 3, distance 12022 .....
Sector: 4, type B, probe 4, distance 12024 .....
Found Key: B [696c351df482]
Auth with all sectors succeeded, dumping keys to a file!
Block 19, type A, key 23406e5056aa :00  00  00  00  00  00  78  77  88  00  00  
00  00  00  00  00  
Block 18, type A, key 23406e5056aa :55  01  00  00  00  00  00  00  00  00  00  
00  00  00  00  00  
Block 17, type A, key 23406e5056aa :00  00  00  00  00  00  00  00  00  00  00  
00  00  00  00  01  
Block 16, type A, key 23406e5056aa :00  00  00  00  00  00  00  00  00  00  00  
00  00  00  00  00  
Block 15, type A, key f04898d03e33 :00  00  00  00  00  00  78  77  88  00  00  
00  00  00  00  00  
Block 14, type A, key f04898d03e33 :55  01  00  00  00  00  00  00  00  00  00  
00  00  00  00  00  
Block 13, type A, key f04898d03e33 :00  00  00  00  00  00  00  00  00  00  00  
00  00  00  00  01  
Block 12, type A, key f04898d03e33 :00  00  00  00  00  00  00  00  00  00  00  
00  00  00  00  00  
Block 11, type A, key b94f10488015 :00  00  00  00  00  00  78  77  88  0c  00  
00  00  00  00  00  
Block 10, type A, key b94f10488015 :55  01  00  00  00  00  00  00  00  00  00  
00  00  00  00  00  
Block 09, type A, key b94f10488015 :00  00  00  00  00  00  00  00  00  00  00  
00  00  00  00  01  
Block 08, type A, key b94f10488015 :00  00  00  00  00  00  00  00  00  00  00  
00  00  00  00  00  
Block 07, type A, key 1b28835a9bdf :00  00  00  00  00  00  78  77  88  28  00  
00  00  00  00  00  
Block 06, type A, key 1b28835a9bdf :55  01  00  00  00  00  00  00  00  00  00  
00  00  00  00  00  
Block 05, type A, key 1b28835a9bdf :01  00  00  01  00  00  80  01  00  01  00  
00  00  00  80  01  
Block 04, type A, key 1b28835a9bdf :01  00  00  01  00  00  80  01  00  01  00  
00  00  00  80  00  
Block 03, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  78  77  88  c1  00  
00  00  00  00  00  
Block 02, type A, key a0a1a2a3a4a5 :00  00  00  00  00  00  00  00  00  00  00  
00  00  00  00  00  
Block 01, type A, key a0a1a2a3a4a5 :62  00  48  88  49  88  4a  88  4b  88  00  
00  00  00  00  00  
Block 00, type A, key a0a1a2a3a4a5 :XX  XX  XX  XX  XX  XX  XX  XX  XX  XX  XX  
XX  XX  XX  XX  XX  

Original issue reported on code.google.com by FireFart on 31 Mar 2014 at 8:02

Attachments:

Error write dump Mifare 4k

When i used mfoc to read dump of mifare classic 4k, read all 256 block, but don't write dump.
The error is: Error, cannot write dump

nfc_initiator_init: Timeout

Hello,
starting mfoc or miLazyCracker gives : nfc_initiator_init: Timeout
This stops the process ...
Using :

nfc-list uses libnfc 1.7.1
NFC device: pn532_uart:/dev/ttyUSB0 opened

Part of the log:


Sector 00 - Found   Key A: a0a1a2a3a4a5 Found   Key B: ffffffffffff
Sector 01 - Unknown Key A               Unknown Key B
Sector 02 - Unknown Key A               Unknown Key B
Sector 03 - Unknown Key A               Unknown Key B
Sector 04 - Unknown Key A               Unknown Key B
Sector 05 - Found   Key A: ffffffffffff Found   Key B: ffffffffffff
Sector 06 - Unknown Key A               Unknown Key B
Sector 07 - Unknown Key A               Unknown Key B
Sector 08 - Unknown Key A               Unknown Key B
Sector 09 - Unknown Key A               Unknown Key B
Sector 10 - Unknown Key A               Unknown Key B
Sector 11 - Unknown Key A               Unknown Key B
Sector 12 - Unknown Key A               Unknown Key B
Sector 13 - Unknown Key A               Unknown Key B
Sector 14 - Unknown Key A               Unknown Key B
Sector 15 - Unknown Key A               Unknown Key B


Using sector 00 as an exploit sector
Sector: 1, type A, probe 0, distance 18879 .....
Sector: 1, type A, probe 1, distance 19839 ...nfc_initiator_init: Timeout

Any ideas why?

mfoc upgrade error during make

What steps will reproduce the problem?
upgrade from mfoc-0.10.2 to mfoc-0.10.7 because mfoc -O mycard.mfd gives error
No NFC device found.

What is the expected output? What do you see instead?
Please see additional information

What version of the product are you using? On what operating system?
mfoc-0.10.2  libnfc-1.7.0-rc4 Kali Linux

Please provide any additional information below.

root@kachina:~# pcscd
root@kachina:~# nfc-list
nfc-list uses libnfc libnfc-1.7.0-rc4
NFC device: ACS ACR 38U-CCID 00 00 / ACR122U101 opened
1 Felica (212 kbps) passive target(s) found:
FeliCa (212 kbps) target:
        ID (NFCID2): 01  01  07  01  f9  12  6e  0b  
    Parameter (PAD): 01  20  22  04  27  67  4e  ff  
   System Code (SC): 80  08  

1 Felica (424 kbps) passive target(s) found:
FeliCa (424 kbps) target:
        ID (NFCID2): 01  01  07  01  f9  12  6e  0b  
    Parameter (PAD): 01  20  22  04  27  67  4e  ff  
   System Code (SC): 80  08  

root@kachina:~# cd mfoc-0.10.7
root@kachina:~/mfoc-0.10.7# ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether make supports nested variables... yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libnfc... yes
checking for inline... inline
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for size_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for memset... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
root@kachina:~/mfoc-0.10.7# make
make  all-recursive
make[1]: Entering directory `/root/mfoc-0.10.7'
Making all in src
make[2]: Entering directory `/root/mfoc-0.10.7/src'
  CC     crapto1.o
  CC     crypto1.o
  CC     mfoc.o
  CC     mifare.o
  CC     nfc-utils.o
nfc-utils.c: In function ‘print_nfc_target’:
nfc-utils.c:125:3: error: incompatible type for argument 2 of 
‘str_nfc_target’
In file included from nfc-utils.c:39:0:
/usr/local/include/nfc/nfc.h:139:18: note: expected ‘nfc_target’ but 
argument is of type ‘const struct nfc_target *’
nfc-utils.c:127:3: warning: implicit declaration of function ‘nfc_free’ 
[-Wimplicit-function-declaration]
make[2]: *** [nfc-utils.o] Error 1
make[2]: Leaving directory `/root/mfoc-0.10.7/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/root/mfoc-0.10.7'
make: *** [all] Error 2



Original issue reported on code.google.com by [email protected] on 18 Nov 2014 at 8:56

"Card is not vulnerable to nested attack" - PNRG

Could someone help me with this card? I'm not sure that it is a tool error. I need to know if there are any other tool besides mfoc (mfcuk not work) Thanks in advance, I attach the dump mfoc

`mfoc -O myCard.mfd -k b94f10488015 -k b4c132439eef
The custom key 0xb94f10488015 has been added to the default keys
The custom key 0xb4c132439eef has been added to the default keys
Found Mifare Classic Mini tag
ISO/IEC 14443A (106 kbps) target:
ATQA (SENS_RES): 00 04

  • UID size: single
  • bit frame anticollision supported
    UID (NFCID1): 66 fc 8a 8d
    SAK (SEL_RES): 09
  • Not compliant with ISO/IEC 14443-4
  • Not compliant with ISO/IEC 18092

Fingerprinting based on MIFARE type Identification Procedure:

  • MIFARE Mini 0.3K
  • SmartMX with MIFARE 1K emulation
    Other possible matches based on ATQA & SAK values:

Try to authenticate to all sectors with default keys...
Symbols: '.' no key found, '/' A key found, '' B key found, 'x' both keys found
[Key: b94f10488015] -> [.....]
[Key: b4c132439eef] -> [....]
[Key: ffffffffffff] -> [....]
[Key: a0a1a2a3a4a5] -> [x....]
[Key: d3f7d3f7d3f7] -> [x....]
[Key: 000000000000] -> [x....]
[Key: b0b1b2b3b4b5] -> [x....]
[Key: 4d3a99c351dd] -> [x....]
[Key: 1a982c7e459a] -> [x....]
[Key: aabbccddeeff] -> [x....]
[Key: 714c5c886e97] -> [x....]
[Key: 587ee5f9350f] -> [x....]
[Key: a0478cc39091] -> [x....]
[Key: 533cb6c723f6] -> [x....]
[Key: 8fd0a4f256e9] -> [x....]

Sector 00 - Found Key A: a0a1a2a3a4a5 Found Key B: b4c132439eef
Sector 01 - Unknown Key A Unknown Key B
Sector 02 - Unknown Key A Unknown Key B
Sector 03 - Unknown Key A Unknown Key B
Sector 04 - Unknown Key A Unknown Key B

Using sector 00 as an exploit sector
Card is not vulnerable to nested attack`

New feature request

I don't have a NFC reader. So I used the one on my Nexus 7 to make a dump. Now I want to get the key that is used on the card (to crack it).
Can you add a way of using dump to crack it or is it impossible just because of the way it works?

nfc_initiator_mifare_cmd: Mifare Authentication Failed

hello all mfoc find me the three missing keys but do not create the dump

sudo mfoc -f key.txt -O test1.mfd
[sudo] Mot de passe de _______ : 
The custom key 0x6c449f91af6b has been added to the default keys
The custom key 0x07364b58ce42 has been added to the default keys
The custom key 0x0419f24294b5 has been added to the default keys
The custom key 0xb0b1b2b3b4b5 has been added to the default keys
The custom key 0xa0a1a2a3a4a5 has been added to the default keys
Found Mifare Classic 1k tag
ISO/IEC 14443A (106 kbps) target:
ATQA (SENS_RES): 04 00

  • UID size: single
  • bit frame anticollision not supported
    UID (NFCID1): 5e 84 75 b9
    SAK (SEL_RES): 08
  • Not compliant with ISO/IEC 14443-4
  • Not compliant with ISO/IEC 18092

Fingerprinting based on MIFARE type Identification Procedure:
Other possible matches based on ATQA & SAK values:

  • Unknown card, sorry

Try to authenticate to all sectors with default keys...
Symbols: '.' no key found, '/' A key found, '' B key found, 'x' both keys found
[Key: 6c449f91af6b] -> [...............]
[Key: 07364b58ce42] -> [..............]
[Key: 0419f24294b5] -> [.\............]
[Key: b0b1b2b3b4b5] -> [\\\\\\\\]
[Key: a0a1a2a3a4a5] -> [xxxxxxxxxxxxxxxx]
[Key: ffffffffffff] -> [xxxxxxxxxxxxxxxx]
[Key: a0a1a2a3a4a5] -> [xxxxxxxxxxxxxxxx]
[Key: d3f7d3f7d3f7] -> [xxxxxxxxxxxxxxxx]
[Key: 000000000000] -> [xxxxxxxxxxxxxxxx]
[Key: b0b1b2b3b4b5] -> [xxxxxxxxxxxxxxxx]
[Key: 4d3a99c351dd] -> [xxxxxxxxxxxxxxxx]
[Key: 1a982c7e459a] -> [xxxxxxxxxxxxxxxx]
[Key: aabbccddeeff] -> [xxxxxxxxxxxxxxxx]
[Key: 714c5c886e97] -> [xxxxxxxxxxxxxxxx]
[Key: 587ee5f9350f] -> [xxxxxxxxxxxxxxxx]
[Key: a0478cc39091] -> [xxxxxxxxxxxxxxxx]
[Key: 533cb6c723f6] -> [xxxxxxxxxxxxxxxx]
[Key: 8fd0a4f256e9] -> [xxxxxxxxxxxxxxxx]

Sector 00 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5
Sector 01 - Found Key A: a0a1a2a3a4a5 Found Key B: 07364b58ce42
Sector 02 - Found Key A: a0a1a2a3a4a5 Found Key B: 0419f24294b5
Sector 03 - Found Key A: a0a1a2a3a4a5 Found Key B: 6c449f91af6b
Sector 04 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5
Sector 05 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5
Sector 06 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5
Sector 07 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5
Sector 08 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5
Sector 09 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5
Sector 10 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5
Sector 11 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5
Sector 12 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5
Sector 13 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5
Sector 14 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5
Sector 15 - Found Key A: a0a1a2a3a4a5 Found Key B: b0b1b2b3b4b5

We have all sectors encrypted with the default keys..

Auth with all sectors succeeded, dumping keys to a file!
Block 63, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 78 77 88 69 00 00 00 00 00 00
Block 62, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 61, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 60, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 59, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 78 77 88 69 00 00 00 00 00 00
Block 58, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 57, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 56, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 55, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 78 77 88 69 00 00 00 00 00 00
Block 54, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 53, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 52, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 51, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 78 77 88 69 00 00 00 00 00 00
Block 50, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 49, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 48, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 47, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 78 77 88 69 00 00 00 00 00 00
Block 46, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 45, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 44, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 43, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 78 77 88 69 00 00 00 00 00 00
Block 42, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 41, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 40, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 39, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 78 77 88 69 00 00 00 00 00 00
Block 38, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 37, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 36, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 35, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 78 77 88 69 00 00 00 00 00 00
Block 34, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 33, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 32, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 31, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 78 77 88 69 00 00 00 00 00 00
Block 30, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 29, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 28, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 27, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 78 77 88 69 00 00 00 00 00 00
Block 26, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 25, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 24, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 23, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 78 77 88 69 00 00 00 00 00 00
Block 22, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 21, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 20, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 19, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 78 77 88 69 00 00 00 00 00 00
Block 18, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 17, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 16, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Block 15, type A, key a0a1a2a3a4a5 :00 00 00 00 00 00 4b 44 bb ea 00 00 00 00 00 00
Block 14, type A, key a0a1a2a3a4a5 :00 00 44 39 15 4a e4 00 00 00 00 00 4d 49 43 00
nfc_initiator_mifare_cmd: Mifare Authentication Failed

the file is created but it is empty would anyone have an idea to solve this problem?

Clear out put.

What steps will reproduce the problem?
1.mfoc -P 500 -O dump_file

What is the expected output? What do you see instead?
nfc_initiator_select_passive_target: Success

What version of the product are you using? On what operating system?
Backtrack 5 r2 / mfoc 0.10.2

Please provide any additional information below.
The created file is clear. Nothing hppens.

Original issue reported on code.google.com by [email protected] on 7 Feb 2014 at 6:55

mfoc.c compile error

I'm trying to run miLazyCrackerFreshInstall.sh which requires mfoc to be compiled. When gcc is called, the redefinition error of unknownSector, knownSector, unknownKeyLetter and unexpected_random comes up.
Any help will be appreciated

Reading
package lists...
Building dependency tree...
Reading state information...
autoconf is already the newest version (2.69-10).
git is already the newest version (1:2.11.0-3+deb9u3).
libnfc-bin is already the newest version (1.7.1-4).
libnfc-dev is already the newest version (1.7.1-4).
0 upgraded, 0 newly installed, 0 to remove and 48 not upgraded.
HEAD is now at ba072f1 update debian dir with up-to-date packaging
Removing INSTALL
Removing Makefile
Removing Makefile.in
Removing aclocal.m4
Removing autom4te.cache/
Removing compile
Removing config.h
Removing config.h.in
Removing config.h.in~
Removing config.log
Removing config.status
Removing configure
Removing depcomp
Removing install-sh
Removing missing
Removing src/.deps/
Removing src/Makefile
Removing src/Makefile.in
Removing src/crapto1.o
Removing src/crypto1.o
Removing src/mfoc.c.orig
Removing src/mfoc.c.rej
Removing src/mfoc.h.rej
Removing stamp-h1
patching file src/mfoc.c
Hunk #1 succeeded at 72 with fuzz 2 (offset 14 lines).
Hunk #2 FAILED at 159.
Hunk #3 succeeded at 257 (offset 15 lines).
Hunk #4 FAILED at 471.
Hunk #5 FAILED at 554.
Hunk #6 FAILED at 770.
Hunk #7 FAILED at 1029.
5 out of 7 hunks FAILED -- saving rejects to file src/mfoc.c.rej
patching file src/mfoc.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file src/mfoc.c.rej
patching file src/mfoc.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file src/mfoc.c.rej
patching file src/mfoc.c
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
6 out of 6 hunks ignored -- saving rejects to file src/mfoc.c.rej
patching file src/mfoc.h
Reversed (or previously applied) patch detected! Assume -R? [n]
Apply anyway? [n]
Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file src/mfoc.h.rej
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking whether make supports nested variables... (cached) yes
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for libnfc... yes
checking for inline... inline
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for size_t... yes
checking for uint8_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint64_t... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking for memset... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
make all-recursive
make[1]: Entering directory '/home/pi/miLazyCracker/mfoc'
Making all in src
make[2]: Entering directory '/home/pi/miLazyCracker/mfoc/src'
CC crapto1.o
CC crypto1.o
CC mfoc.o
Makefile:388: recipe for target 'mfoc.o' failed
make[2]: Leaving directory '/home/pi/miLazyCracker/mfoc/src'
Makefile:358: recipe for target 'all-recursive' failed
make[1]: Leaving directory '/home/pi/miLazyCracker/mfoc'
Makefile:299: recipe for target 'all' failed
Making install in src
make[1]: Entering directory '/home/pi/miLazyCracker/mfoc/src'
CC mfoc.o
Makefile:388: recipe for target 'mfoc.o' failed
make[1]: Leaving directory '/home/pi/miLazyCracker/mfoc/src'
Makefile:358: recipe for target 'install-recursive' failed
HEAD is now at 89de1ba Merge pull request #28 from dkgitdev/patch-1
Removing libnfc_crypto1_crack.c.orig
patching file libnfc_crypto1_crack.c
Hunk #1 succeeded at 730 with fuzz 2 (offset 17 lines).
Done.

Sector 1 no key

HI, I have a mifare card and the problem is that I can not read sector 1 with MCT on Android, how can I find the key? I also have the ACR122u reader, thank you for your help, Regards Dimitri

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.