From e13ccb6b3ff004ecdcb19f6b27719dd4c3002a50 Mon Sep 17 00:00:00 2001 From: k02a Date: Fri, 22 Jul 2016 09:49:02 +0200 Subject: [PATCH 1/4] Inclusion of unused oem variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When compilation of the current source code, I am getting the warning of setting the unused variable "oem". I have included this, along with minor spelling corrections/language updates in the menu system. gcc -std=c99 -O3 -mpopcnt -march=native -g -I. -I../include -I../common -I../zlib -I/opt/local/include -I../liblua -Wall -DHAVE_GUI -DZ_SOLO -DZ_PREFIX -DNO_GZIP -DZLIB_PM3_TUNED -c -o obj/cmdlfhid.o cmdlfhid.c cmdlfhid.c: I funktion "CmdHIDWiegand": cmdlfhid.c:292:11: varning: variabeln "oem" sätts men används inte [-Wunused-but-set-variable] uint32_t oem; ^ Before: pm3 --> lf hid wiegand 0 101 2001 HID 26 bit | FC: 101 CN: 2001 | Wiegand Code: 0000002004CA0FA2 [...] HID 40 bit | FC: 101 CN: 2001 | Wiegand Code: 0000000000000FA2 After: pm3 --> lf hid wiegand 0 101 2001 HID 26 bit | OEM: 0 FC: 101 CN: 2001 | Wiegand code: 0000002004CA0FA2 [...] HID 40 bit | OEM: 0 FC: 101 CN: 2001 | Wiegand code: 0000000000000FA2 --- client/cmdlfhid.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/client/cmdlfhid.c b/client/cmdlfhid.c index 5bdeea6d9..00a4722a3 100644 --- a/client/cmdlfhid.c +++ b/client/cmdlfhid.c @@ -22,26 +22,26 @@ static int CmdHelp(const char *Cmd); int usage_lf_hid_wiegand(void){ - PrintAndLog("Usage: lf hid wiegand [h] [oem] [FacilityCode] [cardnumber]"); - PrintAndLog("This command converts FC/Cardnum to wiegand code"); + PrintAndLog("Usage: lf hid wiegand [h] [OEM] [FC] [CN]"); + PrintAndLog("This command converts facility code/card number to Wiegand code"); PrintAndLog("Options:"); - PrintAndLog(" h - This help"); - PrintAndLog(" oem - Oem number"); - PrintAndLog(" facilitynum - Facility number"); - PrintAndLog(" cardnum - Card number"); + PrintAndLog(" h - This help"); + PrintAndLog(" OEM - OEM number"); + PrintAndLog(" FC - facility code"); + PrintAndLog(" CN - card number"); PrintAndLog("Examples:"); PrintAndLog(" lf hid wiegand 0 101 2001"); return 0; } int usage_lf_hid_brute(void){ - PrintAndLog("Enables bruteforce of HID readers with specified facility-code."); + PrintAndLog("Enables bruteforce of HID readers with specified facility code."); PrintAndLog("Different formatlength is supported"); PrintAndLog("This is a incremental attack against reader."); PrintAndLog(""); - PrintAndLog("Usage: lf hid brute "); + PrintAndLog("Usage: lf hid brute "); PrintAndLog("Options :"); - PrintAndLog(" - 26|33|34|35|37|40|44|84"); - PrintAndLog(" - 8-bit value HID facility code"); + PrintAndLog(" - 26|33|34|35|37|40|44|84"); + PrintAndLog(" - 8-bit value HID facility code"); PrintAndLog(""); PrintAndLog("Sample : lf hid brute 26 224"); return 0; @@ -303,7 +303,7 @@ int CmdHIDWiegand(const char *Cmd) { uint8_t ftmlen[] = {26,33,34,35,37,38,40}; for (uint8_t i = 0; i < sizeof(ftmlen); i++){ calcWiegand( ftmlen[i], fc, cardnum, &hi, &lo); - PrintAndLog("HID %d bit | FC: %d CN: %llu | Wiegand Code: %08X%08X", ftmlen[i], fc, cardnum, hi, lo); + PrintAndLog("HID %d bit | OEM: %d FC: %d CN: %llu | Wiegand code: %08X%08X", ftmlen[i], oem, fc, cardnum, hi, lo); } return 0; } @@ -332,7 +332,7 @@ int CmdHIDBrute(const char *Cmd){ fc = param_get8(Cmd, 1); if ( fc == 0) return usage_lf_hid_brute(); - PrintAndLog("Bruteforceing HID Reader"); + PrintAndLog("Brute-forcing HID reader"); PrintAndLog("Press pm3-button to abort simulation or run another command"); for ( uint16_t cn = 1; cn < 0xFFFF; ++cn){ @@ -362,13 +362,13 @@ int CmdHIDBrute(const char *Cmd){ } static command_t CommandTable[] = { - {"help", CmdHelp, 1, "This help"}, - //{"demod", CmdHIDDemod, 1, "Demodulate HID Prox Card II (not optimal)"}, - {"fskdemod",CmdHIDDemodFSK, 0, "['1'] Realtime HID FSK demodulator (option '1' for one tag only)"}, - {"sim", CmdHIDSim, 0, " -- HID tag simulator"}, - {"clone", CmdHIDClone, 0, " ['l'] -- Clone HID to T55x7 (tag must be in antenna)(option 'l' for 84bit ID)"}, - {"wiegand", CmdHIDWiegand, 0, " -- convert facilitycode, cardnumber to Wiegand code"}, - {"brute", CmdHIDBrute, 0, " -- bruteforce card number"}, + {"help", CmdHelp, 1, "This help"}, +// {"demod", CmdHIDDemod, 1, "Demodulate HID Prox Card II (not optimal)"}, + {"fskdemod",CmdHIDDemodFSK, 0, "['1'] Realtime HID FSK demodulator (option '1' for one tag only)"}, + {"sim", CmdHIDSim, 0, " -- HID tag simulator"}, + {"clone", CmdHIDClone, 0, " ['l'] -- Clone HID to T55x7 (tag must be in antenna)(option 'l' for 84bit ID)"}, + {"wiegand", CmdHIDWiegand, 0, " -- convert facility code/card number to Wiegand code"}, + {"brute", CmdHIDBrute, 0, " -- brute force card number"}, {NULL, NULL, 0, NULL} }; From a360a90bb613c17bf6ee57f2e50d267579480b1b Mon Sep 17 00:00:00 2001 From: k02a Date: Fri, 22 Jul 2016 13:40:05 +0200 Subject: [PATCH 2/4] Improved compilation compability on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Compilation of Lua on a currently updated Slackware Linux 14.2 x86_64 vanilla distribution will cause some errors, due to a missing flags in the Makefile. I noticed that adding the termcap library solves the problem. I also found a thread (http://lua.2524044.n2.nabble.com/readline-termcap-ncurses-td5726148.html ) where other Linux distributions might have similar problems with Lua. Included version of liblua, derived from Lua 5.2.2, also seems to depend on the Termcap library and/or ncurses library. Output: bash-4.3$ make -C proxmark3 make: Går till katalogen "/home/github/iceman1001/proxmark3" make -C client all make[1]: Går till katalogen "/home/github/iceman1001/proxmark3/client" Compiling liblua, using platform linux cd ../liblua && make linux make[2]: Går till katalogen "/home/github/iceman1001/proxmark3/liblua" make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" make[3]: Går till katalogen "/home/github/iceman1001/proxmark3/liblua" gcc -O3 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX -c -o lapi.o lapi.c [...] gcc -O3 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX -c -o linit.o linit.c ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o ranlib liblua.a gcc -O3 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX -c -o lua.o lua.c gcc -o lua lua.o liblua.a -lm -Wl,-E -ldl -lreadline /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tputs' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgoto' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetflag' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `UP' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetent' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetnum' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `PC' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetstr' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `BC' collect2: fel: ld returnerade avslutningsstatus 1 Makefile:63: receptet för målet "lua" misslyckades make[3]: *** [lua] Fel 1 make[3]: Lämnar katalogen "/home/github/iceman1001/proxmark3/liblua" Makefile:106: receptet för målet "linux" misslyckades make[2]: *** [linux] Fel 2 make[2]: Lämnar katalogen "/home/github/iceman1001/proxmark3/liblua" Makefile:203: receptet för målet "lua_build" misslyckades make[1]: *** [lua_build] Fel 2 make[1]: Lämnar katalogen "/home/github/iceman1001/proxmark3/client" Makefile:12: receptet för målet "client/all" misslyckades make: *** [client/all] Fel 2 make: Lämnar katalogen "/home/github/iceman1001/proxmark3" --- liblua/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/liblua/Makefile b/liblua/Makefile index 12be8e83d..89a11e71f 100644 --- a/liblua/Makefile +++ b/liblua/Makefile @@ -103,7 +103,7 @@ freebsd: generic: $(ALL) linux: - $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline" + $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -ltermcap -lncurses" macosx: $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_MACOSX" SYSLIBS="-lreadline" From 39814f19abaa972dec4831bfc0f8eb207e098437 Mon Sep 17 00:00:00 2001 From: k02a Date: Fri, 22 Jul 2016 13:52:12 +0200 Subject: [PATCH 3/4] Addition of depending library flags... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Inclusion of termcap library or ncurses library solves the compilation errors on some Linux distributions, for example a currently updated Slackware Linux 14.2 x86_64 vanilla distribution (which I run). Output: bash-4.3# make -C proxmark3 [...] g++ -DQT_SHARED -I/usr/lib64/qt/include/QtGui -I/usr/lib64/qt/include/QtCore -Wall -O3 obj/proxmark3.o obj/uart.o obj/util.o obj/sleep.o obj/nonce2key/crapto1.o obj/nonce2key/crypto1.o obj/nonce2key/nonce2key.o obj/nonce2key/crypto1_bs.o obj/loclass/cipher.o obj/loclass/cipherutils.o obj/loclass/des.o obj/loclass/ikeys.o obj/loclass/elite_crack.o obj/loclass/fileutils.o obj/mifarehost.o obj/parity.o obj/crc.o obj/crc16.o obj/crc64.o obj/iso14443crc.o obj/iso15693tools.o obj/data.o obj/graph.o obj/ui.o obj/cmddata.o obj/lfdemod.o obj/cmdanalyse.o obj/cmdhf.o obj/cmdhf14a.o obj/cmdhf14b.o obj/cmdhf15.o obj/cmdhfepa.o obj/cmdhflegic.o obj/cmdhficlass.o obj/cmdhfmf.o obj/cmdhfmfu.o obj/cmdhfmfhard.o obj/cmdhfmfdes.o obj/cmdhftopaz.o obj/cmdhw.o obj/cmdlf.o obj/cmdlfio.o obj/cmdlfhid.o obj/cmdlfawid.o obj/cmdlfem4x.o obj/cmdlfhitag.o obj/cmdlfti.o obj/cmdparser.o obj/cmdmain.o obj/cmdlft55xx.o obj/cmdlfpcf7931.o obj/cmdlfviking.o obj/cmdlfpresco.o obj/cmdlfpyramid.o obj/cmdlfguard.o obj/cmdlfnedap.o obj/pm3_binlib.o obj/scripting.o obj/cmdscript.o obj/pm3_bitlib.o obj/aes.o obj/protocols.o obj/sha1.o obj/sha256.o obj/cmdcrc.o obj/reveng/preset.o obj/reveng/reveng.o obj/reveng/cli.o obj/reveng/bmpbit.o obj/reveng/model.o obj/reveng/poly.o obj/reveng/getopt.o obj/tea.o obj/prng.o obj/radixsort.o obj/bucketsort.o obj/proxgui.o obj/proxguiqt.o obj/proxguiqt.moc.o -L/opt/local/lib -L/usr/local/lib -lreadline -lpthread -lm ../liblua/liblua.a -ldl -L/usr/lib64/qt/lib -lQtGui -lQtCore -o proxmark3 /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetstr' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tputs' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `BC' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetent' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetflag' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgoto' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `UP' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `tgetnum' /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/../../../../lib64/libreadline.so: undefined reference to `PC' collect2: fel: ld returnerade avslutningsstatus 1 Makefile:172: receptet för målet "proxmark3" misslyckades make[1]: *** [proxmark3] Fel 1 make[1]: Lämnar katalogen "/home/github/iceman1001/proxmark3/client" Makefile:12: receptet för målet "client/all" misslyckades make: *** [client/all] Fel 2 make: Lämnar katalogen "/home/github/iceman1001/proxmark3" --- client/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/client/Makefile b/client/Makefile index 616a2a744..7b9a65fdf 100644 --- a/client/Makefile +++ b/client/Makefile @@ -58,6 +58,7 @@ else CXXFLAGS = $(shell pkg-config --cflags QtCore QtGui 2>/dev/null) -Wall -O3 QTLDLIBS = $(shell pkg-config --libs QtCore QtGui 2>/dev/null) LUALIB += -ldl + LDLIBS += -ltermcap -lncurses MOC = $(shell pkg-config --variable=moc_location QtCore) # Below is a variant you can use if you have problems compiling with QT5 on ubuntu. see http://www.proxmark.org/forum/viewtopic.php?id=1661 for more info. #MOC = /usr/lib/x86_64-linux-gnu/qt4/bin/moc From b82c2f85e457f361b119d21a31f3263ac3489cc8 Mon Sep 17 00:00:00 2001 From: Iceman Date: Thu, 28 Jul 2016 18:38:20 +0200 Subject: [PATCH 4/4] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1d6776b0c..7f3b327d7 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,9 @@ Use only container tag [1.6.1] ##Buying a proxmark3 The Proxmark 3 device is available for purchase (assembled and tested) from the following locations: - * http://www.elechouse.com (new and revised hardware package 2015) + * http://proxmark3.tictail.com/ (For buyers in EU, most likely in Sweden) + + * http://www.elechouse.com/ (new and revised hardware package 2015, located in China) I recommend you to buy this version.