Last active
August 24, 2023 16:27
-
-
Save kleo/8c85c084e9c5ae86b3367716a463e793 to your computer and use it in GitHub Desktop.
Format usb flash drive and mount as sdcard for the WiFi Pineapple Nano
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#2018 - Zylla - ([email protected]) | |
#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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This will most likely fail if another pineapple will not use sdb as device. Use:
/dev/sdcard/sd1
andsd2
for swap.