shellcheck

This commit is contained in:
Clark Kent
2017-01-27 02:57:19 -06:00
committed by Clark Kent
parent bfc405e718
commit 3d32db17fa
2 changed files with 31 additions and 30 deletions
+5 -5
View File
@@ -21,12 +21,12 @@ while [ $keepTrying -eq 1 ]; do
echo "MFOC not possible, detected hardened Mifare Classic"
if [ "$mfocResult" -eq 9 ]; then
count=0
while read LINE; do
while read -r LINE; do
let count++
#echo "$count $LINE"
done < "$TMPFILE_UNK"
arr=(`echo $LINE | tr ';' ' '`)
arr=($(echo "$LINE" | tr ';' ' '))
#echo ${arr[0]}
#echo ${arr[1]}
#echo ${arr[2]}
@@ -38,8 +38,8 @@ while [ $keepTrying -eq 1 ]; do
knownKeyLetter=${arr[2]}
unknownSectorNum=${arr[3]}
unknownKeyLetter=${arr[4]}
knownBlockNum=$(($knownSectorNum * 4))
unknownBlockNum=$(($unknownSectorNum * 4))
knownBlockNum=$((knownSectorNum * 4))
unknownBlockNum=$((unknownSectorNum * 4))
echo "Trying HardNested Attack..."
mycmd=(libnfc_crypto1_crack "$knownKey" "$knownBlockNum" "$knownKeyLetter" "$unknownBlockNum" "$unknownKeyLetter" "$TMPFILE_FND")
echo "${mycmd[@]}"
@@ -51,7 +51,7 @@ while [ $keepTrying -eq 1 ]; do
cryptoCrackResult=$?
if [ "$cryptoCrackResult" -eq 0 ];then
while read LINE
while read -r LINE
do
echo "$LINE"
done < "$TMPFILE_FND"
+26 -25
View File
@@ -8,34 +8,35 @@ sudo apt-get install git libnfc-bin autoconf libnfc-dev
# install MFOC
[ -d mfoc ] || git clone https://github.com/nfc-tools/mfoc.git
cd mfoc
git reset --hard
git clean -dfx
# patch initially done against commit 48156f9b:
patch -p1 < ../mfoc_test_prng.diff
patch -p1 < ../mfoc_fix_4k_and_mini.diff
patch -p1 < ../mfoc_support_tnp.diff
patch -p1 < ../mfoc_support_2k.diff
autoreconf -vfi
./configure
make
sudo make install
cd ..
(
cd mfoc || exit 1
git reset --hard
git clean -dfx
# patch initially done against commit 48156f9b:
patch -p1 < ../mfoc_test_prng.diff
patch -p1 < ../mfoc_fix_4k_and_mini.diff
patch -p1 < ../mfoc_support_tnp.diff
patch -p1 < ../mfoc_support_2k.diff
autoreconf -vfi
./configure
make
sudo make install
)
# install Hardnested Attack Tool
[ -d crypto1_bs ] || git clone https://github.com/aczid/crypto1_bs
cd crypto1_bs
git reset --hard
git clean -dfx
# patch initially done against commit 957702be:
patch -p1 < ../crypto1_bs.diff
make get_craptev1
make get_crapto1
make
sudo cp -a libnfc_crypto1_crack /usr/local/bin
cd ..
(
cd crypto1_bs || exit 1
git reset --hard
git clean -dfx
# patch initially done against commit 957702be:
patch -p1 < ../crypto1_bs.diff
make get_craptev1
make get_crapto1
make
sudo cp -a libnfc_crypto1_crack /usr/local/bin
)
# install our script
sudo cp -a miLazyCracker.sh /usr/local/bin/miLazyCracker
echo "Done."