nfc-tools / mfoc-hardnested

A fork of mfoc integrating hardnested code from the proxmark
GNU General Public License v2.0
201 stars 32 forks source link

Fix mistake in sector -> block conversion #19

Closed willem640 closed 1 year ago

willem640 commented 1 year ago

This piece of code didn't use the sector_to_block function and as such the hardnested attack was broken for 4k cards, because those have larger sectors at the end of the card.

willem640 commented 1 year ago

Don't mind the commits, but I found another file where this was happening so I made the function visible in a header and included it

t1nkershell commented 1 year ago

Love your effort @willem640 ! Just FYI this branch caused a segfault for me during an attempt to crack a Mifare Classic 4K card.

willem640 commented 1 year ago

That happened to me too, but also on the main branch. I'll run valgrind on it though before it should be merged

t1nkershell commented 1 year ago

This is embarrassing - please ignore my previous comment. The build I was running was from the main branch, not @willem640 's.

I was able to collect a further 8 or so keys with a build from this branch before it once again got stuck in the same loop of seemingly finding the same key over and over again (like with the main branch, only later this time). No segfaults.

t1nkershell commented 1 year ago

I spoke too soon once again, just experienced a segfault.

willem640 commented 1 year ago

Huh, that's interesting. I just got a few cards in the mail so I'll have to test it some more :P

t1nkershell commented 1 year ago

For reference, this was an OV-Chipkaart (Dutch public transport)

t1nkershell commented 1 year ago

Final update: after leaving it running overnight "just in case" the remaining keys were retrieved. Segfault issue seems unpredictable ¯_(ツ)_/¯

Thanks @willem640 !

willem640 commented 1 year ago

I can't get it to segfault anymore, but considering it also happens on the main branch (and the nature of the thing I edited), I don't think any of the code that was changed in this PR is segfaulting

tfduch commented 11 months ago

So finaly, buddy, is that 'code` have fixed 33 sector?

tfduch commented 11 months ago

...and as I see software can't to write dumps

willem640 commented 11 months ago

I’m not sure what you mean, could you try rephrasing?

tfduch commented 11 months ago

Well, buddy I successfully managed to open the S070 4K card which was stumbling while reading sector 33. So you did a great job! One thing - the code does not have a dump write function. Can you add write 4k dumps?

willem640 commented 11 months ago

Ah, in that case I recommend opening a separate issue on the project. You’re currently commenting on an unrelated (and closed) pull request