From db8279a934824df040181f0f595ac5fe36292786 Mon Sep 17 00:00:00 2001 From: Michael Kuc Date: Sat, 5 Jan 2019 16:20:33 +0000 Subject: [PATCH] Added miLazyCracker. --- miLazyCracker/PKGBUILD | 36 ++++++++++++++ miLazyCracker/README.md | 12 +++++ miLazyCracker/miLazyCracker.sh.patch | 13 +++++ .../miLazyCrackerFreshInstall.sh.patch | 49 +++++++++++++++++++ 4 files changed, 110 insertions(+) create mode 100644 miLazyCracker/PKGBUILD create mode 100644 miLazyCracker/README.md create mode 100644 miLazyCracker/miLazyCracker.sh.patch create mode 100644 miLazyCracker/miLazyCrackerFreshInstall.sh.patch diff --git a/miLazyCracker/PKGBUILD b/miLazyCracker/PKGBUILD new file mode 100644 index 0000000..356f175 --- /dev/null +++ b/miLazyCracker/PKGBUILD @@ -0,0 +1,36 @@ +pkgname=miLazyCracker-git +pkgver=1.0 +pkgrel=1 +pkgdesc="Lazy NFC Mifare Classic breaker" +arch=('x86_64') +url="https://github.com/nfc-tools/miLazyCracker" +license=('unknown') +depends=('libnfc' + 'mfoc') +provides=('miLazyCracker') +epoch=1 +source=('git+https://github.com/nfc-tools/miLazyCracker.git' + 'miLazyCracker.sh.patch' + 'miLazyCrackerFreshInstall.sh.patch') +sha256sums=('SKIP' + '4cdce34e789860655f703d2958ca2e803312f47bd19251b3229a6f76101d4d4e' + '3ffcec68c5c145c14572196743f95d7e6fee6dce19bd54b63a12a3c587e3f5a2') + +prepare() { + cd "$srcdir/miLazyCracker" + patch < ../miLazyCracker.sh.patch + patch < ../miLazyCrackerFreshInstall.sh.patch +} + +build() { + : # Do nothing +} + +check() { + : # Do nothing +} + +package() { + cd "$srcdir/miLazyCracker" + DESTDIR="$pkgdir/" ./miLazyCrackerFreshInstall.sh +} diff --git a/miLazyCracker/README.md b/miLazyCracker/README.md new file mode 100644 index 0000000..d2ef1b6 --- /dev/null +++ b/miLazyCracker/README.md @@ -0,0 +1,12 @@ +# miLazyCracker +AUR-like automated build script for `nfc-tools/miLazyChacker` for `pacman` based distributions. + +## Perculiarities +Note that this build is not entirely automated. One must obtain the source-code libraries `craptev1-v1.1.tar.xz` and `crapto1-v3.3.tar.xz`. These were originally available at [original site](http://crapto1.netgarage.org/), [archive.org mirror](https://web.archive.org/web/20180317133525/http://crapto1.netgarage.org). +Since the license of these libraries restricts redistribution, it cannot be given freely. Instead, it is recommended that one ask the original producer at `blapost at gmail dot com`. +Alternatively, since I obtained my copy from a more thorough search of the internet, you can probably get it this way too. + +If none of these are suitable, it is possible to modify this build script, and the sources to use an alternative Crypto-1 bitsliced brute-forcer. + +## How to install +makepkg --install diff --git a/miLazyCracker/miLazyCracker.sh.patch b/miLazyCracker/miLazyCracker.sh.patch new file mode 100644 index 0000000..07eb0da --- /dev/null +++ b/miLazyCracker/miLazyCracker.sh.patch @@ -0,0 +1,13 @@ +diff --git a/miLazyCracker.sh b/miLazyCracker.sh +index 74d960f..f6f3858 100755 +--- a/miLazyCracker.sh ++++ b/miLazyCracker.sh +@@ -123,7 +123,7 @@ rm -f "$TMPFILE_UNK" "0x${myUID}_"*".txt" + if [ $mfocResult -eq 0 ]; then + echo -e "\n\nDump left in: $TMPFILE_MFD" + if ask "Do you want clone the card? Place card on reader now and press Y"; then +- nfc-mfclassic W a $TMPFILE_MFD ++ nfc-mfclassic w A u $TMPFILE_MFD + fi + else + rm -f "$TMPFILE_MFD" diff --git a/miLazyCracker/miLazyCrackerFreshInstall.sh.patch b/miLazyCracker/miLazyCrackerFreshInstall.sh.patch new file mode 100644 index 0000000..5897ac2 --- /dev/null +++ b/miLazyCracker/miLazyCrackerFreshInstall.sh.patch @@ -0,0 +1,49 @@ +diff --git a/miLazyCrackerFreshInstall.sh b/miLazyCrackerFreshInstall.sh +index 0c86797..7516b89 100755 +--- a/miLazyCrackerFreshInstall.sh ++++ b/miLazyCrackerFreshInstall.sh +@@ -7,32 +7,6 @@ fi + + set -x + +-# run this from inside miLazyCracker git repo +-if [ -f "/etc/debian_version" ]; then +- pkgs="" +- for pkg in git libnfc-bin autoconf libnfc-dev; do +- if ! dpkg -l $pkg >/dev/null 2>&1; then +- pkgs="$pkgs $pkg" +- fi +- done +- if [ "$pkgs" != "" ]; then +- sudo apt-get install $pkgs +- fi +-fi +- +-# install MFOC +-[ -d mfoc ] || git clone https://github.com/nfc-tools/mfoc.git +-( +- cd mfoc || exit 1 +- git reset --hard +- git clean -dfx +- # tested against commit 9d9f01fb +- autoreconf -vfi +- ./configure +- make +- sudo make install +-) +- + # install Hardnested Attack Tool + [ -d crypto1_bs ] || git clone https://github.com/aczid/crypto1_bs + ( +@@ -45,9 +19,9 @@ fi + mkdir crapto1-v3.3 + tar Jxvf ../crapto1-v3.3.tar.xz -C crapto1-v3.3 + make +- sudo cp -a libnfc_crypto1_crack /usr/local/bin ++ install -Dm755 libnfc_crypto1_crack "$DESTDIR/usr/local/bin/libnfc_crypto1_crack" + ) + + # install our script +-sudo cp -a miLazyCracker.sh /usr/local/bin/miLazyCracker ++install -Dm755 miLazyCracker.sh "$DESTDIR/usr/local/bin/miLazyCracker" + echo "Done."