Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- *** Pwnagotchi Build Guide for Pi 3 b+ /4 connected via NIC***
- # Description:
- # My collective notes for building my pwnagotchi
- #
- # Last Updated: May 2022
- *** Hardware: ***
- * Raspberry Pi 3 b+
- * Inland 3.5 TFT display
- * Anker 4000 external battery
- * DIYmall VK-172 USB GPS Dongle (U-blox 7)
- * Samsung EVO Micro SDXC 256GB (UHD, UHS-I, U3, A2, V30)
- *** Kudos and Special Thanks: ***
- # Reddit User "u/DigitalDangerNoodle", for their Pwnagotchi Build Guide, https://pastebin.com/bTkXiZ52. This document is based on their build with changes to allow for NIC access, essentially the changes are in STEP 6.
- # Reddit User "u/panoptyk", for their "Guerrilla guide to Pwnagotchi [v1.5.5/2022]:
- # Link: https://www.reddit.com/r/pwnagotchi/comments/sl2rv1/guerrilla_guide_to_pwnagotchi_v1552022/?utm_source=share&utm_medium=web2x&context=3
- # Reddit User "u/my_life_is_suffering" for the information (and support) on getting the Inland 3.5 TFT working
- # Link: https://www.reddit.com/r/pwnagotchi/comments/s92wly/after_many_weeks_of_trial_and_error_finally_a/
- #
- # The Pwnagotchi Reddit Community:
- # Link: https://www.reddit.com/r/pwnagotchi/
- #
- # The "Pwnagotchi Unofficial" Discord Community:
- # Link: https://discord.gg/8fV5Ka32
- #
- # GaelicThunder on GitHub, for their Exp Plugin:
- # Link: https://github.com/GaelicThunder/Experience-Plugin-Pwnagotchi
- #
- # Hanna.Diamond on GitHub, for their Age Plugin and Waveshare 3.7" e-ink display Plugin:
- # Link: https://github.com/hannadiamond/pwnagotchi-plugins
- #*** Build Instructions Below: ***
- Step 1) Download Pwnagotchi image from pwnagotchi.ai
- # Note: version 1.5.5 is the latest version as of April 2022
- # Many have recommended instead to flash version 1.5.3
- # in order to avoid reported bugs regarding AI mode not starting.
- # once installed, version 1.5.3 will automatically update to 1.5.5
- # with an established internet connection (host connection sharing or bt-tether)
- #Download version 1.5.3 to avoid having to fix AI Mode.
- # Remediation guidance for v1.5.5 AI Mode bug is available from u/panoptyk on Reddit. See Link in Kudos section above.
- Step 2) Flash pwnagotchi image to microSD.
- # Note: Recommended to use "balenaEtcher" to flash the image.
- # Several tutorials exist online (Google or YouTube) that
- # provide instructions for flashing an image to a microSD.
- Step 3) Build your initial config.toml
- # Note: your initial config.toml will contain the baseline configuration
- # for your pwnagotchi, such as the name of the device. It is recommended to avoid
- # trying to configure all of your plugins at this stage, and only focus on the
- # essential plugins, such as 'bt-tether'.
- ######## start of config.toml ########
- #Main settings
- main.name = "pwnagotchi"
- main.lang = "en"
- main.custom_plugins = "/usr/local/share/pwnagotchi/custom-plugins/"
- main.whitelist = [
- "Other...",
- ]
- #Reporting results to PwnGRID
- main.plugins.grid.enabled = true
- main.plugins.grid.report = true
- main.plugins.grid.exclude = [
- "Other..."
- ]
- #Display configuration
- ui.display.enabled = false #set to false for now
- ui.display.type = "waveshare37inch" #"waveshare37inch" doesn't exist (yet). To be created later...
- ui.display.color = "black"
- #Reduce Writes to preserve SD Lifespan
- fs.memory.enabled = true
- fs.memory.mounts.log.enabled = true
- fs.memory.mounts.data.enabled = true
- #bt-tether settings
- main.plugins.bt-tether.enabled = true
- main.plugins.bt-tether.devices.ios-phone.enabled = true
- main.plugins.bt-tether.devices.ios-phone.search_order = 1
- main.plugins.bt-tether.devices.ios-phone.mac = "CH:AN:GE:XX:MM:EE" #mobile Bluetooth MAC
- main.plugins.bt-tether.devices.ios-phone.ip = "172.20.10.6" #custom static IP for iPhone PAN
- main.plugins.bt-tether.devices.ios-phone.netmask = 24
- main.plugins.bt-tether.devices.ios-phone.interval = 1
- main.plugins.bt-tether.devices.ios-phone.scantime = 10
- main.plugins.bt-tether.devices.ios-phone.max_tries = 10
- main.plugins.bt-tether.devices.ios-phone.share_internet = true
- main.plugins.bt-tether.devices.ios-phone.priority = 1
- ######## end of config.toml ########
- Step 4) Copy config.toml to MicroSD (boot)
- # Note: Insert the microSD card flashed in Step 3.
- Open the new drive titled "boot", and copy over your config.toml
- Step 5) Boot pwnagotchi for the first time, connected via USB (will boot into MANU Mode).
- # WARNING: BE PATIENT. The First boot will take longer than average due to key generation.
- # NOTE: If you specified settings for bt-tether plugin, ensure your mobile device is
- # nearby and listening for new bluetooth devices to pair.
- # Ensure Internet sharing via Personal Hotspot is enabled.
- Your mobile device will be prompted to pair with your pwnagotchi.
- Step 5)** Boot pwnagotchi for the first time, connected via NIC (will boot into local mode). Use local access (eg, connected monitor, and keyboard).
- Step 6) Configure network/internet/DNS access for RPI 3 b+ / 4
- #Comment out the entirety of the /etc/network/interfaces.d/usb0-cfg network config file.
- sudo nano /etc/network/interfaces.d/usb0-cfg
- #Add your eth0 configuration
- sudo nano /etc/network/interfaces.d/eth0-cfg
- #Add information specific to your network. My network is 10.0.0.0 and desired IP is 10.0.0.94.
- allow-hotplug eth0
- iface eth0 inet static
- address 10.0.0.94
- netmask 255.255.255.0
- network 10.0.0.1
- broadcast 10.0.0.255
- gateway 10.0.0.1
- dns-nameservers 8.8.8.8
- # Configure DNS
- #The resolveconf program is responsible for auto-generating the resolve.conf file during boot based on the files in /etc/network/interfaces.d/
- sudo nano /etc/network/interfaces.d/eth0-cfg
- # add "dns-nameservers 8.8.8.8" under the final 'Gateway' line
- #(NOTE: This step was already completed above, I only add it here for clarity)
- sudo nano /etc/resolv.conf
- # modify "nameserver 127.0.0.1" to be "nameserver 8.8.8.8"
- sudo nano /etc/dnsmasq.conf
- # add "server=8.8.8.8@eth0"
- sudo systemctl disable dnsmasq
- sudo su
- sudo chattr +i /etc/resolv.conf
- # make file immutable
- sudo reboot
- ping Google.com #test for network connection
- Step 7) Install Inland 3.5 TFT :CD Touch Screen Monitor
- #https://www.microcenter.com/product/632693/inland-35-inch-tft-lcd-touch-screen-monitor
- #https://community.microcenter.com/discussion/9216/how-to-enable-the-inland-3-5-tft-lcd-touchscreen-monitor-with-raspberry-pi
- #https://www.waveshare.com/wiki/3.5inch_RPi_LCD_(A)
- #Essentially, we are using the configuration files for the 'spotpear24inch' screen and re-writing the variables for the inland 3.5.
- #remove existing drivers
- sudo rm -rf LCD-show
- #Install drivers for your device: Inland 3.5" TFT LCD Touchscreen Monitor
- git clone https://github.com/waveshare/LCD-show.git
- cd LCD-show/
- chmod +x LCD35-show
- ./LCD35-show lite
- #Make sure you use "./LCD35-show lite" instead of "./LCD35-show"
- #Screen config process
- #Edit config.toml to enable external display
- sudo nano /etc/pwnagotchi/config.toml
- ui.display.enabled = true
- ui.display.rotation = 180
- ui.display.type = "spotpear24inch"
- ui.display.color = "black"
- ##Edit the spotpear24inch.py configuration file to match the parameters of the inland 3.5 inch tft screen
- sudo nano /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/spotpear24inch.py
- #Remove all lines of code, replace with parameters from pastebin.com/tMuuLTx3
- **Initialize to new display
- sudo systemctl restart pwnagotchi.service
- Step 8) Install custom plugins
- #Consider this step OPTIONAL, unless you would like these custom plugins. Otherwise, proceed to Step 10.
- cd ~
- sudo mkdir /usr/local/share/pwnagotchi/custom-plugins/
- #make custom-plugins directory defined in config.toml, if not done so already.
- Step 8.1) aircrackonly plugin
- sudo pwnagotchi plugins install aircrackonly
- sudo nano /etc/pwnagotchi/config.toml
- # add the following lines to config.toml:
- main.plugins.aircrackonly.enabled = true
- main.plugins.aircrackonly.face = "(>.<)"
- Step 8.2) Exp plugin #Generates an "experiance" level and progress bar for your pwnagotchi.
- #Copy exp.py from git: https://github.com/GaelicThunder/Experience-Plugin-Pwnagotchi
- sudo nano /usr/local/share/pwnagotchi/custom-plugins/exp.py #paste contents of exp.py from github to exp.py on your pwnagotchi.
- sudo nano /etc/pwnagotchi/config.toml
- #add the following to your config.toml:
- main.plugins.exp.enabled = true
- main.plugins.exp.lvl_x_coord = 0
- main.plugins.exp.lvl_y_coord = 81
- main.plugins.exp.exp_x_coord = 38
- main.plugins.exp.exp_y_coord = 81
- Step 8.3) Age plugin #Generates the pwnagotchi's "age" and "strength".
- #Copy exp.py from git: https://github.com/hannadiamond/pwnagotchi-plugins/blob/main/plugins/age.py
- sudo nano /usr/local/share/pwnagotchi/custom-plugins/age.py #paste contents of exp.py from github to exp.py on your pwnagotchi.
- sudo nano /etc/pwnagotchi/config.toml
- #add the following to your config.toml:
- main.plugins.age.enabled = true
- main.plugins.age.age_x_coord = 0
- main.plugins.age.age_y_coord = 32
- main.plugins.age.str_x_coord = 67
- main.plugins.age.str_y_coord = 32
- sudo systemctl restart pwnagotchi.service #reload pwnagotchi with new plugins
- Step 9) Update everything. #OPTIONAL. I'm just obsessive about updating everything...
- sudo pwnagotchi plugins update
- sudo pwnagotchi plugins upgrade
- sudo apt-get update --allow-releaseinfo-change
- #Troubleshooting: Some repos for "re4son-kernel.com/re4son kali-pi" might present an error resembling the following: "The following signatures were invalid: EXPKEYSIG 11764EE8AC24832F Carsten Boeving <[email protected]>"
- wget -O - https://re4son-kernel.com/keys/http/archive-key.asc | sudo apt-key add -
- sudo apt-get upgrade #This will take a while (~45 minutes). Be patient.
- #Troubleshooting: You might encounter an error that looks similar to:
- # Errors were encountered while processing:
- # /var/cache/apt/archives/kalipi-kernel_5.4.83-20211204_armhf.deb
- # E: Sub-process /usr/bin/dpkg returned an error code (1)
- sudo mv /boot/overlays/ overlaysbackup
- #rename the existing overlays in /boot/. The renamed overlays can be safely deleted later
- sudo apt-get upgrade #attempt upgrade again.
- Step 10) Change all the default passwords
- # Change "pi" password. Default "raspberry"
- psswd
- # Change "root" password:
- sudo su
- psswd
- # Change pwnagotchi Web UI password. Default "changeme"
- sudo nano /etc/pwnagotchi/config.toml
- # locate and update the values for:
- ui.web.username = "changeme"
- ui.web.password = "changeme"
- # Update bettercap password. Default "pwnagotchi"
- sudo nano /etc/pwnagotchi/config.toml
- # locate and update the values for:
- bettercap.username = "pwnagotchi"
- bettercap.password = "pwnagotchi"
- sudo nano /usr/local/share/bettercap/caplets/pwnagotchi-auto.cap
- #modify the bettercap username & password to match config.toml
- sudo nano /usr/local/share/bettercap/caplets/pwnagotchi-manual.cap
- #modify the bettercap username & password to match config.toml
- sudo systemctl restart pwnagotchi.service #reload pwnagotchi for config changes to apply.
- Step 11) Back up all your hard work!
- Download the Backup script from Github.
- # Link: https://github.com/evilsocket/pwnagotchi/blob/master/scripts/backup.sh
- Append the "FILES_TO_BACKUP" section of the backup script to include the following additional files that have been added or modified as a result of this guide:
- /usr/bin/pwnlib \
- /etc/systemd/system/pwngrid-peer.service \
- /usr/local/share/pwnagotchi/custom-plugins/ \
- /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/libs/waveshare/v37inch/ \
- /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/waveshare37inch.py \
- /usr/local/lib/python3.7/dist-packages/pwnagotchi/utils.py \
- /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/display.py \
- /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/components.py \
- /usr/local/lib/python3.7/dist-packages/pwnagotchi/ui/hw/__init__.py
- # Note: The last entry in the list must include an end quotation mark. Be sure to relocate this to the end of the list before saving.
- sudo chmod +x backup.sh # make backup.sh executable
- sudo ./backup.sh
- Step 12 - Optional) Accessing your handshakes
- #create file to access handshakes
- sudo nano cph.sh
- insert these lines into the file
- #/bin/bash
- cp -r /root/handshakes/* /home/pi/handshakes/
- chown pi:pi /home/pi/handshakes
- chown pi:pi /home/pi/handshakes/*
- sudo chmod +x cph.sh
- #To run file, execute 'sudo cph.sh'. This will copy your handshakes into the /home/pi/handshakes directory
- Step - Optional) May be required if you are having troubles with bluetooth
- # We need to add something into our profile which is in our root directory, hidden.
- sudo su
- cd /root
- sudo nano ~/.profile
- #add the following at the bottom of the file.
- # attempt to restart bluetooth
- sudo systemctl restart bluetooth
- #save using crtl + x and then hit enter.
- #Comment out an if-else-statement.
- sudo nano /usr/bin/btuart
- #At the first if-else-statement you see, comment it out like you you see below.
- #if grep -q "raspberrypi,4" /proc/device-tree/compatible; then
- BDADDR=
- #else
- SERIAL='cat /proc/device-tree/serial-number | cut -c9-'
- B1='echo $SERIAL | cut -c3-4'
- B2='echo $SERIAL | cut -c5-6'
- B3='echo $SERIAL | cut -c7-8'
- BDADDR='printf b8:27:eb:%02x:%02x:%02x $((0x$B1 ^ 0xaa)) $((0x$B2 ^ 0xaa)) $((0x$B3 ^ 0xaa))'
- #fi
- #save it using crtl + x and then hit enter.
- sudo reboot
- #### Enjoy your new Pwnagotchi, and please support the Pwnagotchi community on Reddit and Discord! ####
Add Comment
Please, Sign In to add comment