vk496 / mfoc

Mifare Classic Offline Cracker with Hardnested support

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compilation issues on ARM architecture?

UltrashRicco opened this issue · comments

Hello, I am new to GitHub, with close to no experience in coding, so please excuse me if this message is irrelevant.

Thank you for putting this fork together! It is extremely convenient (automated keys recovery and full dump), as MFOC would perform, only with the added benefit of the hardnested attack.

I could verify that the implementation of the attack is much quicker with this fork thant with say miLazyCracker. Similar speeds as with the ProxMark3 device, actually.

I am facing an issue where the Proxmark hardnested attack requires more memory than a Rapsberry Pi 3 can allocate. miLazyCracker works fine though.

I would like to speed things up a bit by using this fork of MFOC, but I am unable to get it to compile either on the latest and updated Raspbian (Debian) 32 bits or Kali Linux 64 bits for ARM architecture.

I am getting the same error when running the ./configure command.

I am using the following commands:

sudo apt-get update
sudo apt-get install git binutils make csh g++ sed gawk autoconf automake autotools-dev libglib2.0-dev libnfc-dev liblzma-dev libnfc-bin

git clone https://github.com/vk496/mfoc
cd mfoc
git checkout hardnested

autoreconf -is
./configure
make

I am getting warnings running autoreconf -is
image

and this is the output when running ./configure
image

Then the ouptut of make
image

So, mfoc is not even generated due to the aforementionned compilation errors.
It does compile fine in Debian or Kali for x64 (amd64),and works fine !

Any idea regarding the issue and how to sort it out? Anything I can investigate?
I am a beginner, sorry if my post is irrelevant, please let me know!
Thanks again,
Eric.

Same problem, tried on raspberry pi 3b

Hi,

the problem is that the Raspberry Pi does not support AVX/MMX/SSE2 or any other x86-specific CPU-Instructions-Extensions, you can probably edit Makefile.am to compile without any SIMD extensions:

  • delete from line 15 until the end of the file and replace it with
MULTIARCHOBJS = hardnested/hardnested_bf_core_NOSIMD.o hardnested/hardnested_bitarray_core_NOSIMD.o

hardnested/%_NOSIMD.o : hardnested/%.c
	$(CC) $(DEPFLAGS) $(CFLAGS) -c -o $@ $<

that should only compile non-SIMD code,

it will make the hardnested attack very slow though and i don't have my raspi handy to check if it actually works.

Best regards,

Earthnuker

Hello,

thank you for your help @earthnuker !

It does compile fine now :
image

The attack does start, but fails in the same way as the attack with the Proxmark client, due to the Raspberry Pi not having sufficient memory!

image

So I guess it could work on the Raspberry Pi 4 with more than 1 GB of memory, or on other ARM-powered single-board computers! It would be great if someone could try it and report their findings. I don't have the hardware to test it right now, but I should purchase a Raspberry Pi 4 with more memory shortly.

What works on the Raspberry Pi 3B and 3B+ is miLazyCracker, but it is a bit slow though: https://github.com/nfc-tools/miLazyCracker

Thanks again!

The problem of compiling is related with #1 , and one way to "hack it" is what @earthnuker posted.

I've tried to fix it, but never made it work with automake syntax. Any help is really appreciated.

For the memory usage, maybe it could be fixed. We could add a extra parameter to use the hard drive instead the memory. It will have impact in the performance, but will not fail

Thank you @vk496 !
The manual fix in Makefile.am as @earthnuker suggested does work, and I am pretty sure it would run fine on ARM devices with sufficient memory.
I am sorry I cannot help any further with either issues (automatic compiling and less memory usage).
Congrats for coming up with this fork of MFOC.
How come it was not integrated in the main branch? It would be useful to many people I guess.

@UltrashRicco could you please verify that ARM devices work properly with the last commit (abd0be2)

Dear Valentin @vk496
I would love to but I am on a business trip without my Raspberry Pi at the moment.
I should be able to try "next year" in early 2020! ;)
I will let you know,
Thanks!!

Dear @vk496
I was able to compile the latest release with no modification/tweaking on a Raspberry Pi 3B+ and on a Pi 4B running Kali and Raspbian:

image

Same warnings with Kali and Raspbian, but seems to compile fine in either case.

However I am unable to test it, as currently have no hardened Mifare Classic card in my possession!

Could anyone check, please?
Thanks and have a great end-of-the-year!

@vk496
my bad, I actually do have a hardened card.

So, the latest release does compile on both Raspbian and Kali.

The hardnested attack does work on the Raspberry Pi 4B, using about 1,4 GB of memory:

image

Attack successful! Key reuse works as well of course.

image

However, it does fail on the Raspberry Pi 3B+ due to insufficient available memory:

image

So, I guess it should work on ARM-based devices with at least 2 GB of memory!

Thanks!

I guess I forgot to close the issue, sorry about that.
It stands resolved, yet the memory requirements are at leats 2GB.
Thanks again!