Flyagotchi - pwnagotchi meets drone

The flyagotchi? pwnagotchi-fly? drwnagotchi? Still shopping around names. Not the most practical use but still interesting concept I have been trying to get together.

Please let me know if there is a better way to do this. I have been playing around with pwnagotchi on Raspberry Pi 3 B+, 4, and 0w for a couple of weeks now. I have managed to get some different things running with some success, but my knowledge on Linux is very weak.

I am using a Raspberry Pi Zero W, Alfa AWUS036ACS wifi adapter with 9 dbi antenna and generic vilros usb adapter, and 1200 mAh Pisugar.

I am unable to tether with bluetooth on my phone because the carrier blocks it and since I am using the wifi adapter as the monitoring device I set up the internal wlan0 to connect to my home network or phone wifi sharing so that I could connect and monitor.

To set the alfa adapter to be used for monitoring modified the config.yml to use wlan1.

To then set the onboard wifi to connect to home wifi or phone wifi tether I used wpa_passphrase to set up the network config and then wpa_supplicant to connect to the network. I have 2 different wpa_passphrase files and bash scripts created for home network or phone and change the crontab to point to different scripts.

wpa_passphrase SSID PASSWORD > /home/pi/wpa_supplicant.conf
wpa_supplicant -I wlan0 -c /home/pi/wpa_supplicant.conf -d wext -B

I then created a bash script to connect to this network, pull dhcp, and set default route.

#!/bin/sh
# pwnwifiwlan0home.sh
#wait 20 seconds
sleep 20

#stop monitor on mon0 # from /usr/bin/pwnlib: ifconfig mon0 down && iw dev mon0 del
sudo /usr/bin/monstop

# connects wlan0 interface to WPA network defined in the conf file
sudo wpa_supplicant -i wlan0 -c /home/pi/wpa_supplicant.conf -d wext -B
sleep 5

# gets DHCP lease
sudo dhclient wlan0
sleep 5

#add default route for internet
sudo route add default gw 192.168.1.1 wlan0

To set this script to run on boot I added the following in crontab:

crontab -e

@reboot sh /home/pi/pwnwifiwlan0home.sh

I have had several issues with kernel panic and the system locking up. I disabled bluetooth since I am not using it with this line to the /boot/config.txt

#disable bluetooth
dtoverlay=pi3-disable-bt

I still have issues where about half the time on boot it will not initiate correctly.

I hung this from a DJI Mavic Pro and flew it around the neighborhood. I was only able to pick up a few new handshakes, but I think this was a combination of not loitering in a specific spot for too long and higher than optimal altitude. I am still trying to sort out somethings. I was having compass errors on the drone that I think may have been from the magnet on the Pisugar. I will try and suspend the pi a little further down to see if that helps.

This sort of works for me. Please let me know if there are better ways of doing this. I am really just trying to piece together something from my limited knowledge and google.

3 Likes