├── README.md └── pwn_rpi02w.sh /README.md: -------------------------------------------------------------------------------- 1 | # pwnagotchi Raspberry Pi Zero 2 W Fix 2 | 3 | Download the script 4 | `git clone https://github.com/isthisausername2/pwnagotchi_rpi_zero_2_fix.git` 5 | 6 | Enter the directory 7 | `cd pwnagotchi_rpi_zero_2_fix` 8 | 9 | Set the file as executable 10 | `chmod u+x ./pwn_rpi02w.sh` 11 | 12 | Run the script 13 | `sudo ./pwn_rpi02w.sh` or `./pwn_rpi02w.sh` if already root 14 | 15 | ### Creddit to akhepcat for making this script much bettter and adding many things to make it eaiser to use. 16 | -------------------------------------------------------------------------------- /pwn_rpi02w.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "This should fix pwnagotchi on you RPI Zero 2 w." 4 | sleep 1 5 | 6 | if [ ! \( \( "${USER}" = "root" \) -o \( -n "${EUID}" -a ${EUID} = 0 \) \) ] 7 | then 8 | echo "This script is designed to be run as root, or run with sudo." 9 | exit 1 10 | fi 11 | 12 | echo "If you are not running as root you have 5 seconds to stop this and run as root. If you are running as root just wait 5 seconds." 13 | sleep 5 14 | 15 | if [ ! -e /etc/apt/preferences.d/kali.pref ]; 16 | then 17 | cat </etc/apt/preferences.d/kali.pref 18 | Package: * 19 | Pin: release n=kali-pi 20 | Pin-Priority: 999 21 | EOF 22 | 23 | # this sets the correct priority for upgrades so we don't have to be so hacky! 24 | fi 25 | 26 | # stop running services 27 | systemctl stop pwnagotchi bettercap pwngrid-peer.service 28 | 29 | # work around release-info changes during the upgrade process 30 | apt --allow-releaseinfo-change update 31 | 32 | # Unhold, and upgrade these packages only from the kali-pi repo 33 | # apt install -y -t kali-pi libraspberrypi0 libraspberrypi-bin libraspberrypi-dev kalipi-bootloader kalipi-kernel 34 | 35 | # Packages get installed here, prefering kali-pi for all packages they provide; debian for all others 36 | apt full-upgrade -y 37 | 38 | # piZero-v2 doesn't support monitor mode https://github.com/seemoo-lab/nexmon/issues/500 39 | 40 | pip3 install --upgrade numpy 41 | 42 | # This is temporary, and gets us a working wifi driver, though without promiscuous monitor mode initially 43 | # We just want the 43436 driver; unless it already exists, and then future updates should handle it 44 | if [ ! -e /lib/firmware/brcm/brcmfmac43436-sdio.bin ] 45 | then 46 | mkdir /lib/firmware/brcm/old 47 | cp /lib/firmware/brcm/* /lib/firmware/brcm/old 48 | apt install -y firmware-brcm80211 49 | cp /lib/firmware/brcm/old/* /lib/firmware/brcm/ 50 | fi 51 | 52 | echo "Reboot required to fully apply changes" 53 | 54 | # Comands and reserch on fixing this done by github user skontrolle. I just put the comands in as script. 55 | # GitHub link to orignal issue https://github.com/evilsocket/pwnagotchi/issues/1046 56 | # Orignal messange from skontrolle 57 | # additional changes by ak_hepcat 58 | 59 | 60 | # I just retraced all of my steps with a clean 1.5.5 image to make sure I didn't have any issues with my backup config. 61 | 62 | # raw image doesn't boot on zero2 63 | # boot 0w 64 | # sudo apt update && sudo apt full-upgrade -y 65 | # swap card to zero2 66 | # boots but no wifi for bettercap 67 | # install firmware not upgraded in the full-upgrade sudo apt install firmware-brcm80211; reboot 68 | # pwnagotchi starts, mon0 interface up & can iwlist mon0 scan, numpy error in logs, all epochs are blind 69 | # update numpy sudo pip3 install --upgrade numpy to resolve [BUG] pwnagotchi numpy error #1015 70 | # with numpy fixed, all epochs are still blind, and the AI fails in import cv2 71 | # sudo apt install libavcodec58 libavformat58; these remove the kalipi-bootloader. reboot for good measure 72 | # epochs still blind, AI starts really quickly, pwnagotchi restarts after 50 blind epochs. 73 | # drop card back in 0w, everything works. 74 | --------------------------------------------------------------------------------