Commit graph

69 commits

Author SHA1 Message Date
pwpiwi
98a67bc908 Fix some printf/scanf format strings 2020-05-11 14:46:22 +02:00
Helio Machado
8f831ceb0b Fix #912 2020-02-09 18:04:46 +01:00
pwpiwi
e73c9f1bd4
fix 'hf iclass chk' (#894)
* Check for Credidt Keys as well
* reduce authentication tries from 6 to 3
* correct text in 'hf iclass clone' for 'l' parameter
* some reformatting and whitespace fixes
2019-12-09 08:27:42 +01:00
pwpiwi
0b4efbdef2
add: 'hf mf personalize' (personalize UID on Mifare Classic EV1 7byte UID cards)
* add/use some #defines
* whitespace fixes
* #include refactoring
* add line to CHANGELOG.md
2019-08-22 07:53:17 +02:00
pwpiwi
b8dd1ef649
upgrading 'hf mfu' (#830)
* chg: write new dump file format by @mceloff
* chg: rename 'hf mfu dump' option 'n' to 'f' to align with other commands and RRG repo
* chg: replace ISO14443A_CMD_READBLOCK by MIFARE_CMD_READBLOCK, same for WRITEBLOCK
* fix: mifare_ultra_readblock() returned 14 bytes instead of 16
* chg: param_gethex_ex() now checks maximum output buffer length
* chg: ul_comp_write() was incomplete and for magic testing only
* fix: 16bit ULC counter had been displayed as 32bit
* chg: add check for 7 Byte UID, drop check for ATQA in type identification GetHF14AMfU_Type()
* fix: send HALT instead of dropping field in order to maintain a defined state
* chg: DropField() when command ends
* chg: check for invalid page ranges in 'hf mfu dump'
* fix: print correct lock bits when page range is used
* fix: do not write (incomplete) dumpfile when page range is used
* add: use UID for filename when no filename is given (RRG repo)
* chg: don't clear trace on each ULC authentication, clear trace at beginning of each command
* fix: don't send (DESFire?) deselect command after authentication
2019-06-06 07:33:12 +02:00
pwpiwi
4be9f36ebe
start updating 'hf mfu' commands (#818)
* use PrintAndLogEx()
* fix some printouts
* some #include refactoring
* whitespace
2019-05-28 07:48:55 +02:00
pwpiwi
a9104f7e31
Add support for standard USB Smartcard Readers (#765)
* add PCSC interface (pcsc.c and pcsc.h)
* new command 'sc select' to choose an USB Smartcard Reader
* updated CI/.travis.yml accordingly
* remove TCK CRC check in i2c.c It is done in PrintATR() anyway
* Fix TCK CRC check in PrintATR()
* Add PCSC reader support to 'sc info'
2019-01-28 21:54:34 +01:00
Oleg Moiseenko
0bb514502a Fido2 (#727)
* add tinycbor
* add client/fido
* add test file with options for fido2
* hf fido commands
* add changelog
2018-12-07 16:42:37 +01:00
Fl0-0
03439be30f Fix util.c:116:2: error: unknown type name ‘va_list’ (#722) 2018-11-26 08:11:11 +01:00
Oleg Moiseenko
6b882a3918 Fido U2F complete (#716)
* add pkwrite
* asn1print
* asn1dump and CA
* added PrintAndLogEx for merge commits between repo easier than now
* changelog
2018-11-25 16:56:12 +01:00
Oleg Moiseenko
39cc1c879e FIDO U2F NFC authenticators (#697)
* `hf fido` command
* detects FIDO tag
* add new commands for fido u2f
* added changelog
* added fido2 info
2018-11-17 20:22:21 +02:00
Michael Farrell
82258709f6 Remove unused functions le32toh, le24toh, hextobinstring, binarraytobinstring, print_hex, print_hex_break, sprint_hex_ascii, sprint_ascii, SwapEndian64ex (#667)
* Remove unused method le32toh.
* Delete unused function le24toh
* Remove unused functions hextobinstring, binarraytobinstring
* Remove unused functions print_hex, print_hex_break
* Delete unused functions sprint_hex_ascii, sprint_ascii
* Remove unused function SwapEndian64ex
2018-09-17 08:35:45 +02:00
Fl0-0
00349d8204 Fix Gcc 8 warnings (#632) 2018-07-26 17:17:11 +02:00
pwpiwi
babca445ff
rework of GetFromBigBuf() (#597)
* this should fix crashes reported in issue #497
* don't allow receiver thread to write directly into arbitrary main thread's memory
* instead use cmdBuffer[] for CMD_DOWNLOADED_RAW_ADC_SAMPLES_125K as well
* add timeout and warning options to GetFromBigBuf(), same as in WaitForResponseTimeoutW()
* move GetFromBigBuf() from data.c to comms.c
* remove data.c and data.h
2018-05-08 07:54:49 +02:00
Oleg Moiseenko
edd4c8385b small fix util.c 2018-02-10 22:10:38 +02:00
Oleg Moiseenko
a37725facf add nested auth decoding to hf mf sniff 2018-02-09 15:50:55 +01:00
Pierre Pronchery
3ded0f97d3 Khorben/warnings (#519)
* Fix warnings and missing #include for <ctype.h>
* Avoid a warning in client/util.c
2017-12-28 17:56:18 +01:00
merlokk
66efdc1f64 part of changes 2017-11-25 12:58:50 +02:00
Oleg Moiseenko
3c5fce2ba7 Add: Emv first part of commands
* hf emv search
* hf emv pse
* hf emv select
* hf emv exec command - only part of functionality
2017-11-22 06:16:33 +01:00
Oleg Moiseenko
c95affa8d3 minor fixes
* fix timeout set in PR #481
* fix warning in util.c printf
2017-11-15 07:49:18 +01:00
William S. Moses
874572d419 Fix memory bounds error 2017-11-11 16:15:29 -05:00
merlokk
8019540b19 param parsing convert to procedures 2017-10-31 15:15:57 +02:00
Oleg Moiseenko
aa757f71d9 proxmark3 refactoring command line parameters (#417)
* add -c (execute command from command line)
* fix: sometimes proxmark executes command twice...
* fix: start proxmark from QT was in a strange way (if we issue command very fast - it hangs)
* added -l (execute lua script)
* rework help
* small memory management bugfix
* small fix in executing command files
* enable piping from STDIN
2017-10-20 06:49:53 +02:00
Oleg Moiseenko
3a05a1e739 reworking magic cheneese card wipe (#365)
Implement hf mf cwipe. Remove wipe parameter from hf mf csetuid.
2017-09-22 19:40:42 +02:00
marshmellow42
bf8243475b some coverity fixes plus fix fdx help (#328)
* coverity fixes

cmdhflegic- indications are the i in calls to data_buf[i] could = 1052
and overflow the array.
cmdhfmfhard - +1 to add space for string null terminator - should we add
the 0 terminator value too?
reveng.c - memory leak
util.c - fix potential overflow of array buf[]
util_posix.c - possible integer overflow

* fix help errors

* fix sprint_hex_ascii

again
and this function is not even used anywhere... yet...
2017-06-20 17:25:08 -05:00
pwpiwi
ec9c71129f Fix compile errors with MacOS (#312)
* Fix compile errors with MacOS
- _POSIX_C_SOURCE must not be defined for num_CPU()

* separate util_posix.c require changes in tools directory as well

* remove unnecessary self-include
2017-06-07 22:35:20 +02:00
pwpiwi
c48c4d7856 New: implementing hf mf hardnested
This implements the attack described in
	Carlo Meijer, Roel Verdult, "Ciphertext-only Cryptanalysis on Hardened
	Mifare Classic Cards" in Proceedings of the 22nd ACM SIGSAC Conference on
	Computer and Communications Security, 2015
It uses precomputed tables for many bitflip properties (not only two as in the paper)
and is therefore quite efficient. To prevent failing it doesn't do
differential analysis with several nonce bytes' Sum(a8) properties (each of them
may be wrongly guessed) - instead it concentrates on one nonce byte and tries all
Sum(a8) property guesses sequentially (ordered by probability). The brute force phase
makes use of aczid's bit sliced brute forcer (https://github.com/aczid/crypto1_bs).
Includes runtime CPU-detection to leverage modern (and old) SIMD instructions
with a single executable.
2017-05-31 07:30:56 +02:00
marshmellow42
b9957414a5 lf read adjustments
add parameter for # bits to read
auto get samples after lf read/snoop (don't need to do a `data samples`
anymore)
add safe function to get DemodBuffer
add some lf demod comments and apply new lf_read function instead of
read then get samples.
fixed output bug in lf t55xx config print
fixed small bug in lf t55xx detect during ST check
2017-04-07 17:28:12 -04:00
marshmellow42
b97311b1bd lf improvements
fix noralsy demod bug (st should be true)
fix sprint_bin_break bug (didn't print last bit)
add a function to save/restore demodbuffer
remove redundant countFC call in PSKDemod
clean up pskclockdetect functions
fix indala26decode bug (end of data sometimes not correct)
improve PSK detection / demodulation
improve NRZ detection
improve t55xx commands & fix a few bugs
add t55xx page1 detection - added it to lf search
added experimental t55xx testmode write
2017-04-04 11:52:10 -04:00
m2otech
1f1f1955dc Fixed compile error in MinGW (#260)
* Fixed compile error in MinGW

Some versions of MinGW miss some definitions. In order to be able to
compile I redefined a function and added an explicit include. It is only
a quick workaround, as other people also seemed to have the same
problem. It should be checked whether a better solution is possible.

* Removed _ftime_s redefine, calling _ftime directly
2017-03-30 03:39:39 +02:00
pwpiwi
8c0ccdef35 fix: ukbhit() for OS X
- don't use CMIN and CTIME
- corrected comments
2017-03-22 22:15:24 +01:00
marshmellow42
2d42ea1e4d add bitswap option for lf em 4x05write (#236)
default read mode of this chip outputs in reverse order...  so offer the
option to program in reverse order
2017-03-21 08:26:26 +01:00
pwpiwi
acf0582d53 Provide msclock() as Milliseconds timer for performance measures (#231)
- don't use clock(). It has different functionalities in Windows and Linux
- move sleep functions to util.h
2017-03-12 15:06:27 +01:00
James Chambers
d172c17ca4 make clean_ascii a util function 2017-03-03 18:04:58 -05:00
marshmellow42
59f726c989 EM4x05/EM4x69 continued + a couple of icemans utils. 2017-02-15 23:27:15 -05:00
marshmellow42
c872d8c177 update hf mf sim x attack mode - start 10byte uid..
..support  (some from @iceman1001)
(sim reader attack currently testing std mfkey32 vs mfkey32_moebius
version...)  possibly will remove one later.
2016-06-24 01:31:27 -04:00
marshmellow42
d1869c3336 Add LF ASK Sequence Terminator detection...
...and demodulate data beginning after the first ST
also add some type casts in print calls.
2016-02-16 12:49:30 -05:00
marshmellow42
8ea5706047 additional memory leaks, overflow and unchecked ...
return values fixed

thanks to iceman1001
2016-02-14 13:24:03 -05:00
marshmellow42
c4c3af7c16 some @iceman1001 s coverty scan fixes
great work!
2016-01-08 18:26:56 -05:00
marshmellow42
6ca1477c74 fix occasional strange printed clock value with...
...fskdemod
Fix Q5 tag detection in lf t55xx detect
Fix param_get8 reversed parameters
2015-12-14 16:51:11 -05:00
marshmellow42
7bc6fac3ce fix sprint_bin bug i made :( 2015-12-09 20:40:12 -05:00
marshmellow42
ace26dbdfd Fix printdemodbuffer length tests + add length...
parameter
increase askdemod MaxBits
fix util.c sprint_bin_break and increase buffer size (had memory
overflow possible before)
2015-12-07 21:18:30 -05:00
marshmellow42
709665b5d1 lf viking build / lf awid refactor / lfdemod.c debugMode==2
lf viking from other users - just put my spin on it
lf awid refactored code - possible to make it not 26bit specific now
with minor chanages
lfdemod.c now supports extra debug printing if `data setdebug` = 2 when
not on device (on client not arm)
2015-11-22 00:00:32 -05:00
marshmellow42
1a5a73abae Add mifare crypto trace decryption utility
allows manual decryption of hf 14a snoop traces of a mf card.
someday we should fix hf mf sniff...
2015-10-07 00:24:55 -04:00
marshmellow42
1c4c0b0681 add @Iceman1001 s sha1 scripting changes. 2015-05-30 21:51:15 -04:00
marshmellow42
4973f23d3c clean up mfu device side code
+ add xor calc to util (prep for desfire)
commented out MifareUWriteBlockCompat as it isn't used in client
currently (it is a command we could support..  but why?)
relabeled a few device side mfu functions to be clearer.
2015-05-27 12:24:13 -04:00
marshmellow42
e6432f0579 @iceman1001 s coverity scan fixes 2015-05-13 11:14:17 -04:00
marshmellow42
2b3af97df2 various bug fixes 2015-05-13 11:07:47 -04:00
marshmellow42
c585a5cf0b further MFU info updates (mainly icemans) 2015-05-06 22:15:41 -04:00
marshmellow42
f9848fd647 MFU dump UL-C with key
adding UL-C auth and keys to dump cmd
swapped endian for input of hf mfu crdbl to match output of hf mfu info
cmd and tag info app
2015-05-03 23:17:11 -04:00