Commit graph

47 commits

Author SHA1 Message Date
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
marshmellow42 2767fc0291 lf cleaning
remove unneeded code/functions
fix lfdemod askmandemod bug with maxErr=0
silence output for getting samples in lf search
2015-04-05 00:58:57 -04:00
Martin Holst Swende 699bb9dc27 Removed some dev- printouts 2015-02-13 19:59:28 +01:00
Martin Holst Swende 31abe49fd3 Some more fixes to longer lf recordings. Now also supports longer snoops, and an additional command 'lf config' has been defined, instead of having to specify all params for every call 2015-01-30 23:03:44 +01:00
Martin Holst Swende f6d9fb173f Added client-side support for recording longer samples, fixed last (?) issues on device-side 2015-01-29 00:57:22 +01:00
iceman1001 b915fda392 FIX: a solution for the issue "hf mf esave - always saves 4K"
FIX: a solution for the issue "hf eload, esave, cload, save - filepath variable too short"
CHG: minor code clean up.
ADD: AES / CRC16 for lua. (and tnp3xx scripts.)
ADD: tnp3dump.lua  script to dump tnp3xx tags.
ADD: tnp3sim.lua script to let PM3 imitate an tnp3xx tag. Needs to be tested live
2015-01-07 22:00:29 +01:00
iceman1001 79544b28ad CHG: minor code clean up
ADD: added some  helper-functions in util.c
2015-01-07 20:52:03 +01:00
roel@libnfc.org 6c6d1ac1a6 fixed signed/unsigned problem 2013-03-26 20:42:18 +00:00
roel@libnfc.org cb64309e4b compiling on windows again 2013-02-28 21:36:09 +00:00
Merlokbr@gmail.com e0c635d19c hf mf sniff - working with emulator files 2012-07-17 11:28:12 +00:00
Merlokbr@gmail.com 55acbb2a39 improved command hf mf sniff. Now it cant decode nested authentication and cant write emulator files 2012-07-16 14:49:51 +00:00
roel@libnfc.org 81cd0474cb fixed a lot of simulation issues 2012-06-29 10:24:05 +00:00
douniwan5788 aea4d76687 Enhanced hf mf chk , add default key,support dic file and so on.
modify hf mf mifare to automatically use an invalid key'nt try again.
make some changes to support mifare classic 4k.
2012-05-30 03:45:55 +00:00
roel@libnfc.org 38c4979dae fix compiling under MAC OSX 2011-09-05 11:44:45 +00:00
Merlokbr@gmail.com 9ca155ba44 0. its alpha version!!!
1. commands changed from "hf 14a" to "hf mf" 
2. some code cleaning and small bugfixes
3. alpha version hf mf sim
4. added internal function GetTickCount() for time measuring
2011-06-10 13:35:10 +00:00
Merlokbr@gmail.com 873014de8a linux patch by Wil
http://www.proxmark.org/forum/profile.php?id=1639
2011-06-07 14:30:07 +00:00
Merlokbr@gmail.com f397b5cc87 1. fixed hf 14a mifare. added functionality to ignore one Nt
2. completed hf 14a nested
3. added hf 14a chk to check keys
5. added check keys to hf 14a mifare and hf 14a nested
6. added debug level to mifare commands
7. small bugs and improvements
2011-06-07 12:35:52 +00:00
Merlokbr@gmail.com f89c705002 improved version of "hf 14a mifare" command
with merge with utility nonce2key
2011-05-31 11:31:20 +00:00
Merlokbr@gmail.com 20f9a2a1d5 1. Mifare read block command
2. Mifare read sector (via 1)
3. Mifare write block
4. fixed several bugs in iso 14443 select
added
Issue 23
Issue 26
2011-05-26 12:55:15 +00:00
adam@algroup.co.uk 534983d735 iso14a reader patches [Hagen Fritsch] 2010-07-13 13:39:30 +00:00