Merge pull request #1650 from jacopo-j/master

Implement 14b sniff standalone mode
This commit is contained in:
Iceman 2022-04-03 06:16:32 +02:00 committed by GitHub
commit bbe4a6e2d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 59 additions and 1 deletions

View file

@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file.
This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log...
## [unreleased][unreleased]
- Added standalone mode for sniffing 14b (@jacopo-j)
- Fixed `hf 14a apdu` - now don't skip first P2 iteration (@iceman1001)
- Added `hf ntag424` - skeleton with SDM (@iceman1001)
- Updated hf_14a_i2crevive.lua - fixed broken apdus (@Equipter)

View file

@ -65,6 +65,8 @@ define KNOWN_STANDALONE_DEFINITIONS
| HF_14ASNIFF | 14a sniff to flashmem |
| (RDV4 only) | |
+----------------------------------------------------------+
| HF_14BSNIFF | 14b sniff |
+----------------------------------------------------------+
| HF_15SNIFF | 15693 sniff to flashmem (rdv4) or ram |
| | |
+----------------------------------------------------------+
@ -116,7 +118,7 @@ define KNOWN_STANDALONE_DEFINITIONS
endef
STANDALONE_MODES := LF_SKELETON LF_EM4100EMUL LF_EM4100RSWB LF_EM4100RSWW LF_EM4100RWC LF_HIDBRUTE LF_HIDFCBRUTE LF_ICEHID LF_PROXBRUTE LF_SAMYRUN LF_THAREXDE LF_NEXID
STANDALONE_MODES += HF_14ASNIFF HF_15SNIFF HF_AVEFUL HF_BOG HF_COLIN HF_CRAFTBYTE HF_ICECLASS HF_LEGIC HF_LEGICSIM HF_MATTYRUN HF_MFCSIM HF_MSDSAL HF_TCPRST HF_TMUDFORD HF_YOUNG HF_REBLAY DANKARMULTI
STANDALONE_MODES += HF_14ASNIFF HF_14BSNIFF HF_15SNIFF HF_AVEFUL HF_BOG HF_COLIN HF_CRAFTBYTE HF_ICECLASS HF_LEGIC HF_LEGICSIM HF_MATTYRUN HF_MFCSIM HF_MSDSAL HF_TCPRST HF_TMUDFORD HF_YOUNG HF_REBLAY DANKARMULTI
STANDALONE_MODES_REQ_BT := HF_REBLAY
STANDALONE_MODES_REQ_SMARTCARD :=
STANDALONE_MODES_REQ_FLASH := LF_HIDFCBRUTE LF_ICEHID LF_NEXID LF_THAREXDE HF_14ASNIFF HF_BOG HF_COLIN HF_ICECLASS HF_MFCSIM HF_LEGICSIM

View file

@ -57,6 +57,10 @@ endif
ifneq (,$(findstring WITH_STANDALONE_HF_14ASNIFF,$(APP_CFLAGS)))
SRC_STANDALONE = hf_14asniff.c
endif
# WITH_STANDALONE_HF_14BSNIFF
ifneq (,$(findstring WITH_STANDALONE_HF_14BSNIFF,$(APP_CFLAGS)))
SRC_STANDALONE = hf_14bsniff.c
endif
# WITH_STANDALONE_HF_15SNIFF
ifneq (,$(findstring WITH_STANDALONE_HF_15SNIFF,$(APP_CFLAGS)))
SRC_STANDALONE = hf_15sniff.c

51
armsrc/Standalone/hf_14bsniff.c Executable file
View file

@ -0,0 +1,51 @@
/*
* `hf_14bsniff` passively sniffs ISO14b frames.
* *
* On entering stand-alone mode, this module will start sniffing ISO14b frames.
* This will be stored in the normal trace buffer (ie: in RAM -- will be lost
* at power-off).
*
* Short-pressing the button again will stop sniffing and standalone mode will
* exit.
*
* LEDs:
* - LED1: sniffing
* - LED2: sniffed tag command, turns off when finished sniffing reader command
* - LED3: sniffed reader command, turns off when finished sniffing tag command
*
* This module emits debug strings during normal operation -- so try it out in
* the lab connected to PM3 client before taking it into the field.
*
* Caveats / notes:
* - Trace buffer will be cleared on starting stand-alone mode.
* - This module will terminate if the trace buffer is full.
* - Like normal sniffing mode, timestamps overflow after 5 min 16 sec.
* However, the trace buffer is sequential, so will be in the correct order.
*/
#include "standalone.h" // standalone definitions
#include "proxmark3_arm.h"
#include "iso14443b.h"
#include "util.h"
#include "appmain.h"
#include "dbprint.h"
#include "ticks.h"
#include "BigBuf.h"
void ModInfo(void) {
DbpString(" HF 14B SNIFF, a ISO14443b sniffer");
}
void RunMod(void) {
StandAloneMode();
Dbprintf(_YELLOW_("HF 14B SNIFF started"));
SniffIso14443b();
Dbprintf("Stopped sniffing");
SpinDelay(200);
Dbprintf("-=[ exit ]=-");
LEDsoff();
}