Skip to content

Instantly share code, notes, and snippets.

@kbeflo kbeflo/format.sh
Last active Apr 8, 2019

Embed
What would you like to do?
Format usb flash drive and mount as sdcard for the WiFi Pineapple Nano
#!/bin/bash
#2018 - Zylla - (adde88@gmail.com)
#Format usb flash drive as sdcard for the WiFi Pineapple Nano
#Source https://forums.hak5.org/topic/39096-mana-attack-for-the-pineapple/?do=findComment&comment=303054
#You can also manually partition your usb flash drive on your computer
[[ -f /tmp/usb_format.progress ]] && {
exit 0
}
touch /tmp/usb_format.progress
umount /sd
swapoff /dev/sdb2
sleep 2
cat /pineapple/modules/Advanced/formatSD/fdisk_options | fdisk /dev/sdb
sleep 2
umount /sd
mkfs.ext4 /dev/sdb1
sleep 2
mkfs.ext4 /dev/sdb2
mkswap /dev/sdb2
mount /dev/sdb1 /sd
swapon /dev/sdb2
rm /tmp/usb_format.progress
config global
option anon_swap '0'
option anon_mount '0'
option auto_swap '1'
option auto_mount '1'
option delay_root '5'
option check_fs '0'
config mount
option target '/sd'
option device '/dev/sdb1'
option fstype 'auto'
option options 'rw,sync'
option enabled '1'
config swap
option device '/dev/sdb2'
option enabled '1'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.