Re: Mifare Classic Offline Cracker

dennyxiao wrote:

acr122U firmware version?
Ubuntu  version and  64bit amd or 386 32bits?

ACR122U206 - PN532 v1.4 (0x07) & Ubuntu 9.10 Karmic Koala i386 version(Virtual in VMware)
Could this give any problems then?

Re: Mifare Classic Offline Cracker

Sorry, where can I find .008 release ? I cannot find it in nethemba website...

Re: Mifare Classic Offline Cracker

rleo79 wrote:

Sorry, where can I find .008 release ? I cannot find it in nethemba website...


http://www.nethemba.com/mfoc.tar.bz2

this is 0.08

Re: Mifare Classic Offline Cracker

150 probes are not enough to find a key.. is it possible?

30 (edited by Baquinjam Palas 2010-07-05 15:43:49)

Re: Mifare Classic Offline Cracker

The first key?. Yes, it´s posible, and perhaps 1000 are also posible.

But you must use mfoc when you know one key.

Regards.

Re: Mifare Classic Offline Cracker

Hi all,

FYI, MFOC is now hosted at nfc-tools¹, we now have a VCS and issue tracker for MFOC.

Thanks to Nethemba² people for this tool.

A new version 0.09 that works with libnfc 1.3.9 is available in the downloads section.

Enjoy!

[1] http://code.google.com/p/nfc-tools/
[2] https://www.nethemba.com/

Romuald Conty

Re: Mifare Classic Offline Cracker

Hi there,

I've tried to compile MFOC on MacOS Leopard but when i'm starting to do a 'make' the following error occured:

make  all-recursive
Making all in src
  CC     mfoc.o
mfoc.c: In function 'mf_select_tag':
mfoc.c:511: error: 'NM_ISO14443A_106' undeclared (first use in this function)
mfoc.c:511: error: (Each undeclared identifier is reported only once
mfoc.c:511: error: for each function it appears in.)
mfoc.c:511: warning: passing argument 5 of 'nfc_initiator_select_passive_target' from incompatible pointer type
mfoc.c: In function 'mf_anticollision':
mfoc.c:550: error: 'NM_ISO14443A_106' undeclared (first use in this function)
mfoc.c:550: warning: passing argument 5 of 'nfc_initiator_select_passive_target' from incompatible pointer type
make[2]: *** [mfoc.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

does someone have an idea what is wrong?
i'm running mfoc 0.09 with libnfc 1.3.9 using a Touchatag reader.

33 (edited by duoup 2010-10-30 11:36:08)

Re: Mifare Classic Offline Cracker

Hi!

I assume you have the latest "trunk"-version of libnfc. It was solved here when I explicit downloaded the "libnfc-1.3.9" tag.

They have changed the nfc_modulation_t enum into a struct defined by values of "nfc_modulation_type_t" and "nfc_baud_rate_t" (e.g. "NMT_ISO14443A" and "NBR_106").

The old enum was made of constants for defining modulation and baudrate as a single value (e.g. "NM_ISO14443A_106").

Just get http://libnfc.googlecode.com/svn/tags/libnfc-1.3.9 and you will be happy ;-)


OR: If you really have already the 1.3.9, then you haven't installed the library.


cya

Re: Mifare Classic Offline Cracker

thank you for your reply! smile

yes I tried the latest trunk-version of libnfc because when i'm trying to compile your version it gives the following error while trying 'make':

make  all-recursive
Making all in libnfc
Making all in chips
  CC     libnfcchips_la-pn53x.lo
  CCLD   libnfcchips.la
Making all in buses
  CC     libnfcbuses_la-uart.lo
  CCLD   libnfcbuses.la
Making all in drivers
  CC     libnfcdrivers_la-acr122.lo
acr122.c:38:22: error: winscard.h: No such file or directory
acr122.c:41:24: error: wintypes.h: No such file or directory
acr122.c:70: error: syntax error before 'SCARDHANDLE'
acr122.c:70: warning: no semicolon at end of struct or union
acr122.c:71: warning: type defaults to 'int' in declaration of 'ioCard'
acr122.c:71: warning: data definition has no type or storage class
acr122.c:72: warning: type defaults to 'int' in declaration of 'acr122_spec_t'
acr122.c:72: warning: data definition has no type or storage class
acr122.c:74: error: syntax error before '_SCardContext'
acr122.c:74: warning: type defaults to 'int' in declaration of '_SCardContext'
acr122.c:74: warning: data definition has no type or storage class
acr122.c:77: error: syntax error before '*' token
acr122.c:79: warning: return type defaults to 'int'
acr122.c: In function 'acr122_get_scardcontext':
acr122.c:81: warning: implicit declaration of function 'SCardEstablishContext'
acr122.c:81: error: 'SCARD_SCOPE_USER' undeclared (first use in this function)
acr122.c:81: error: (Each undeclared identifier is reported only once
acr122.c:81: error: for each function it appears in.)
acr122.c:81: error: 'SCARD_S_SUCCESS' undeclared (first use in this function)
acr122.c: In function 'acr122_free_scardcontext':
acr122.c:95: warning: implicit declaration of function 'SCardReleaseContext'
acr122.c: In function 'acr122_list_devices':
acr122.c:140: error: 'SCARDCONTEXT' undeclared (first use in this function)
acr122.c:140: error: 'pscc' undeclared (first use in this function)
acr122.c:155: warning: implicit declaration of function 'SCardListReaders'
acr122.c:155: error: 'SCARD_S_SUCCESS' undeclared (first use in this function)
acr122.c: In function 'acr122_connect':
acr122.c:196: error: syntax error before 'as'
acr122.c:197: error: 'pas' undeclared (first use in this function)
acr122.c:200: error: 'SCARDCONTEXT' undeclared (first use in this function)
acr122.c:200: error: 'pscc' undeclared (first use in this function)
acr122.c:208: warning: implicit declaration of function 'SCardConnect'
acr122.c:208: error: 'SCARD_SHARE_EXCLUSIVE' undeclared (first use in this function)
acr122.c:208: error: 'SCARD_PROTOCOL_T0' undeclared (first use in this function)
acr122.c:208: error: 'SCARD_PROTOCOL_T1' undeclared (first use in this function)
acr122.c:208: error: 'as' undeclared (first use in this function)
acr122.c:209: error: 'SCARD_S_SUCCESS' undeclared (first use in this function)
acr122.c:211: error: 'SCARD_SHARE_DIRECT' undeclared (first use in this function)
acr122.c:219: error: 'SCARD_IO_REQUEST' undeclared (first use in this function)
acr122.c: In function 'acr122_disconnect':
acr122.c:248: error: 'pas' undeclared (first use in this function)
acr122.c:248: error: syntax error before ')' token
acr122.c:249: warning: implicit declaration of function 'SCardDisconnect'
acr122.c:249: error: 'SCARD_LEAVE_CARD' undeclared (first use in this function)
acr122.c: In function 'acr122_transceive':
acr122.c:263: error: 'pas' undeclared (first use in this function)
acr122.c:263: error: syntax error before ')' token
acr122.c:281: error: 'SCARD_PROTOCOL_UNSET' undeclared (first use in this function)
acr122.c:283: warning: implicit declaration of function 'SCardControl'
acr122.c:284: error: 'SCARD_S_SUCCESS' undeclared (first use in this function)
acr122.c:289: warning: implicit declaration of function 'SCardTransmit'
acr122.c:296: error: 'SCARD_PROTOCOL_T0' undeclared (first use in this function)
acr122.c: In function 'acr122_firmware':
acr122.c:343: error: 'pas' undeclared (first use in this function)
acr122.c:343: error: syntax error before ')' token
acr122.c:347: error: 'SCARD_PROTOCOL_UNSET' undeclared (first use in this function)
acr122.c: In function 'acr122_led_red':
acr122.c:370: error: 'pas' undeclared (first use in this function)
acr122.c:370: error: syntax error before ')' token
acr122.c:374: error: 'SCARD_PROTOCOL_UNSET' undeclared (first use in this function)
acr122.c:377: error: 'SCARD_S_SUCCESS' undeclared (first use in this function)
make[3]: *** [libnfcdrivers_la-acr122.lo] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

this problem is also discussed here: http://www.libnfc.org/community/post/1308/ (i have the exact same problem)
when compiling the latest trunk, there's no problem at all and for example 'nfc-list' just works perfectly. any idea anyone?

Re: Mifare Classic Offline Cracker

Hi!

I just see three possible solutions:

1. Like in your posted link, check your libraries and follow this instruction:
http://www.libnfc.org/documentation/installation

2. If you don't need the ACS ACR122 driver, deactivate it and check whether the other drivers don't give an error while compiling.

3. Rewrite mfoc, to make it workable with the trunk-version.


Good Luck!

Re: Mifare Classic Offline Cracker

Or you can now use the development version of mfoc against development version of libnfc.

Enjoy!

Romuald Conty

Re: Mifare Classic Offline Cracker

Thanks Romuald and duoup!

the development version works like a charm on MacOS!
although it gives me errors, i wonder if it really influence the process of MFOC.

it gives me the following error in a row and it is the same issue that has been discussed here http://www.libnfc.org/community/topic/2 … parameter/

nfc_initiator_transceive_bytes: Invalid Parameter
nfc_initiator_transceive_bytes: Invalid Parameter
nfc_initiator_transceive_bytes: Invalid Parameter
nfc_initiator_transceive_bytes: Invalid Parameter
nfc_initiator_transceive_bytes: Invalid Parameter
nfc_initiator_transceive_bytes: Invalid Parameter

does it matter?

Re: Mifare Classic Offline Cracker

attrib wrote:

does it matter?

As said on the other topic, this is not a libnfc problem: when mfoc was released, libnfc doesn't have error handling functions... so the errors happends but not appears, now there are explained...
So, to remove these errors, its mfoc that needs to be fixed or maybe (I don't think so), errors are "normal".

Romuald Conty

Re: Mifare Classic Offline Cracker

something interesting happened when trying to make a dump file with mfclassic and the recovered keys (that i've got from MFOC).
while dumping the data blocks to a file, mfclassic returns a write error together with the same message I have with MFOC when it writes the recovered keys to a file. as I mentioned earlier this is what it says:
nfc_initiator_transceive_bytes: Invalid Parameter

so now it even shows in mfclassic! I think it has to do with MFOC that generates key files that are corrupt in a way.
I think this is a serious error that should be fixed in MFOC.

for the information, i tried this with MacOSX and my Debian machine using a Touchatag reader.
Both showed the same error.

40 (edited by attrib 2010-11-08 10:38:54)

Re: Mifare Classic Offline Cracker

alright, i tried to recover keys with mfcuk and this succeed without any errors.
now when i try to read out the data blocks with the recovered keys the same problem appears with nfc-mfclassic..

Connected to NFC reader: ACS ACR122U 00 00 / ACR122U102 - PN532 v1.4 (0x07)
Found MIFARE Classic 4k card with UID: cff21c44
Reading out 256 blocks |..................nfc_initiator_transceive_bytes: Invalid Parameter
!
Error: unable to read block 0x56

first off, I thought it was a mfoc problem because it showed me the same error messages. but when I tried mfcuk and it gave me no errors.
I am beginning to think it must be a libnfc problem. or is it a driver problem?

Re: Mifare Classic Offline Cracker

Hello,
First, I want to thank you to try many cases, that helps a lot !

attrib wrote:

first off, I thought it was a mfoc problem because it showed me the same error messages. but when I tried mfcuk and it gave me no errors.
I am beginning to think it must be a libnfc problem. or is it a driver problem?

I goes deeper in this problem and that error comes from the chip.
So, there is a bug... reported by the NFC chip, in "special" conditions... I'll report as soon as I found the problem source.

Romuald Conty

Re: Mifare Classic Offline Cracker

I got some help!

Using Mifare Classic, even if an Auth command pass (without errors), Read cmd can fail with "Invalid Params" if the key you are using don't allow you to read the block you ask.
So, mfoc and nfc-mfclassic have to be fixed in order to workaround this "bug".

Romuald Conty

Re: Mifare Classic Offline Cracker

no problem. i'd love to fool around with different versions and platforms. i just hope i can be of any help with just providing feedback..

btw, could you solve to problem? i've been busy these days and didn't have the opportunity to check it out. also i checked out the code but couldn't find any problems.

44 (edited by rconty 2010-11-17 09:11:59)

Re: Mifare Classic Offline Cracker

attrib wrote:

btw, could you solve to problem?

After some research, "Invalid Parameter" was not a correct error string. Since r825, its fixed and now you will have "Invalid Received Frame".

See http://code.google.com/p/libnfc/issues/detail?id=132

So, the libnfc is fixed now maybe we could enhance a bit nfc-mfclassic to handle the case..

Romuald Conty

Re: Mifare Classic Offline Cracker

I'm trying to compile the new mfoc Version 0.10 on a x64 based Gentoo System. If compiled and installed the libnfc Version 1.4.0. But every time i try to run ./configure for mfoc i got the following message:

configure: error: libnfc >= 1.4.0 is mandatory.

Ideas?

Re: Mifare Classic Offline Cracker

you need to have the latest libnfc installed.
you can get it here:

http://code.google.com/p/libnfc/downloa … n=2&q=

47 (edited by shell 2010-11-21 12:14:24)

Re: Mifare Classic Offline Cracker

As i wrote, libnfc 1.4.0 is installed properly. Any other idea?

EDIT:

config.log wrote:

configure:3760: $PKG_CONFIG --exists --print-errors "libnfc >= $LIBNFC_REQUIRED_VERSION"
Package libnfc was not found in the pkg-config search path.
Perhaps you should add the directory containing `libnfc.pc'
to the PKG_CONFIG_PATH environment variable

I 've two libnfc.pc files:
* /usr/local/lib/pkgconfig/libnfc.pc
* /usr/local/lib64/pkgconfig/libnfc.pc

Re: Mifare Classic Offline Cracker

You have posted problem and solution:

config.log wrote:

configure:3760: $PKG_CONFIG --exists --print-errors "libnfc >= $LIBNFC_REQUIRED_VERSION"
Package libnfc was not found in the pkg-config search path.
Perhaps you should add the directory containing `libnfc.pc'
to the PKG_CONFIG_PATH environment variable

so please read:

man 1 pkg-config

and you will see that works with something like:

PKG_CONFIG_PATH=/additionnal/path/ ./configure --your-options
Romuald Conty

Re: Mifare Classic Offline Cracker

Wow, this was very easy. Thanks for your  patience and your help.

Re: Mifare Classic Offline Cracker

Hi, I have an ACR122U207 - PN532 v1.6 (0x07) as well and MFOC kept crashing the card reader here, too. (Blocking USB communication; you'll have to unplug and re-plug the reader). So I started hacking around in MFOC and was able to filter out most of the problems. My personal MFOC will now run for some 20 minutes straight, without problems; and if it stops, it only stops because of I/O, it no longer crashes the reader.

So I have only two questions: are there any volunteers with crashing ACR122U207 readers out there? And where should I send the source?

Volunteers with non-crashing ACR122U207 readers are most welcome, too, because I would hate to see their readers crash now.