Topic: Simple shell script for reading and writing
Some of my friends had a hard time figuring out how libnfc works so I wrote a simple shell script.
It includes cracking a card with mfoc, reading and writing a card with nfc-mfclassic.
Certainly not complete just something simple.
$ cat > menuui
#
#
#
#
while :
do
clear
echo "-------------------------------------"
echo " Main Menu "
echo "-------------------------------------"
echo "[1] Check if card is detected"
echo "[2] Crack card with mfoc"
echo "[3] Read card with known keys"
echo "[4] Write card"
echo "[5] Help"
echo "[6] Exit/Stop"
echo "======================="
echo -n "What do you want? [1-6]: "
read yourch
case $yourch in
1) nfc-list;
echo "Press a key . . .";
read ;;
2) echo -n "Enter name dump file: " ;
read fdump;
echo -n "Enter number of probes: (600 is good)";
read fprobes;
echo -n "Enter tolerance: (Default is 20 but if it crashes put it on about 2)";
read ftol;
gnome-terminal --tab -e "mfoc -P $fprobes -T $tol -O $fdump";
read ;;
3) echo -n "Enter name dump file: " ;
read fdump;
echo -n "Enter name key file: ";
read fkey;
nfc-mfclassic r b $fdump $fkey;
echo "Press a key . . .";
read ;;
4) echo -n "Enter name of file to be written: ";
read fdump;
echo -n "Enter name of key file: ";
read fkey;
nfc-mfclassic w b $fdump $fkey;
echo "Press a key . . .";
read ;;
5) echo "-------------------------------------";
echo "Help";
echo "-------------------------------------";
echo "**Cracking a card with mfoc";
echo "Use this for a new card";
echo "**Read a card with known keys";
echo "Use this if you have cracked the card before.";
echo "For key file give the name of and old dump of this card.";
echo "**Write a card";
echo "For key file give the name of the original dump of this card.";
echo "-------------------------------------";
echo "Press a key. . .";
read ;;
6) exit 0 ;;
*) echo "Very funny, choose something that does exist!";
echo "Press a key. . ." ;
read ;;
esac
doneSo for new people, just create a new file. Paste this stuff and save it. Then do the following
chmod 755 "name of the script"
./"name of the script"Hope this helps