Adds random nonce (r) option to hf mf sim.

This makes the PM3 generate pseudo-random nonces rather than sequential
nonces, to make it act a bit more like a "real" MFC card.  A reader would
otherwise be able to detect the PM3 probing based on the predictable nonces
and throw different authentication challenges (or refuse to authenticate at
all).

The code includes an implementation of a rand-like function (prand), similar
to the one from libc, which is seeded automatically based on the time it
takes between the PM3 starting up and the first call to the RNG.

This isn't cryptographically random, but should be "good enough" to be able
to evade basic detection.
This commit is contained in:
Michael Farrell 2017-01-26 18:16:10 +11:00
parent 910ad5470d
commit f9c1dcd9f6
5 changed files with 42 additions and 2 deletions

View file

@ -217,6 +217,7 @@ typedef struct{
#define FLAG_7B_UID_IN_DATA 0x04
#define FLAG_10B_UID_IN_DATA 0x08
#define FLAG_NR_AR_ATTACK 0x10
#define FLAG_RANDOM_NONCE 0x20
//Iclass reader flags