Beginning - V0r-T3x/pwnagotchi-fancygotchi GitHub Wiki
Basic Connectivity (SSH, FTP, Connection Sharing)
Connect to PC
Because I am running Windows 11 as a daily driver, this section will cover only Windows. For establishing a connection on Linux or MacOS refer to the official guide.
- connect RP0W data port to pc (Micro-USB to USB A)
- wait for the device to boot up for the first time (20+ Minutes)
- Check Device Manager for COM-Port - as described here
- If Windows didn't install the RP0W as an "Ethernet Gadget", download the corresponding driver on Windows Update
- Unpack the CAB
- In Device Manager select the COM-Device and update the driver with the one from the CAB
- make sure to check in Network Devices for the Interface and configure TCP/IP v4 to use 10.0.0.01 as its IP-address, 255.255.255.0 as Subnet and 10.0.0.1 as Gateway.
SSH-connection
Open PowerShell as Administrator
ssh [email protected]
default password is raspberry, it is generally recommended to immediately change it:
passwd
if you get the WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
, go to C:\Users\{user}\.ssh
, open known_hosts
and comment out (#) every line; save
connect again with pi (ssh [email protected]
); confirm/authorize (yes in terminal)
establish ftp support
this is optional, but makes installation way easier (imho). On Windows, I use WinSCP, ymmv.
First, enable password login for root (unsafe, should be disabled again after setup has finished).
passwd #change pi's password
sudo su
passwd root #change root's password
Then, enable SFTP support by executing
sudo nano /etc/ssh/sshd_config
uncomment and change the line #PermitRootLogin prohibit-password
to PermitRootLogin yes
then restart ssh by executing:
service ssh restart
login via FTP using:
host: 10.0.0.2
username: root
password: *password*
port: 22
solve DNS issues
sudo nano /etc/resolv.conf
change the entry behind nameserver "127.0.0.1" to "8.8.8.8".
Warning this is only temporary and will be overwritten on each reboot. There are several different fixes for this, see this thread. Short summary:
- adding dns-nameservers 8.8.8.8 under the gateway line in /etc/network/interfaces.d/usb0-cfg
- add: "server=8.8.8.8@usb0" to /etc/dnsmasq.conf
- systemctl disable dnsmasq
- sudo chattr +i /etc/resolv.conf makes file immutable (make sure beforehand there is 8.8.8.8 or 1.1.1.1 insted of 127.0.0.0)
Internet connection sharing for win10/11
The official script is named "win_connection_share.ps1" and can be copied via ftp from /usr/local/src/pwnagotchi/scripts once connected.
Execute this in Powershell:
1.) .\win_connection_share.ps1 -SetPwnagotchiSubnet
2.) # Reboot Windows
3.) .\win_connection_share.ps1 -EnableInternetConnectionSharing
if applicable: enable mobilehotspot on pc and turn off power saving mode for your hotspot or your wireless interface.
how to change the default internet sharing 10.0.0.1 ip on windows: https://forums.tomshardware.com/faq/how-to-change-default-internet-connection-sharing-ip-address-range.1606758/
Connecting more than one pwnagotchi to a pc
- Configure the usb0 file on the new pwnagotchi to connect:
nano /etc/network/interfaces.d/usb0-cfg
- Modify this file:
allow-hotplug usb0
iface usb0 inet static
address 10.0.0.2
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.1
metric 20
- With the ip of your choice:
allow-hotplug usb0
iface usb0 inet static
address 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
metric 20
-
Reboot.
-
Configure your network connection with the new ip, and you can now connect more than one pwnagotchi to your pc.
Upload initial config.toml
- Prepare your config.toml according to the official guide.
- connect through ftp and upload your config.toml to /etc/pwnagotchi/
- make directory /etc/pwnagotchi/custom-plugins for custom plugins to add to that directory later.
Enable Bluetooth connection
change BT settings in stock/default config
This is going to be dependent on your Bluetooth device, but necessary to enable internet access when connected to your Bluetooth device (do it if you didn't already supply your premade/working config in the previous step)
change following options:
- change this to iPhone, because that's my config
main.plugins.bt-tether.enabled = true
main.plugins.bt-tether.devices.android-phone.enabled = true
main.plugins.bt-tether.devices.android-phone.search_order = 1
main.plugins.bt-tether.devices.android-phone.mac = "CH:AN:GE:ME:HE:RE" #phone: settings-> about device -> status "bluetooth address"
main.plugins.bt-tether.devices.android-phone.ip = "192.168.44.44"
main.plugins.bt-tether.devices.android-phone.netmask = 24
main.plugins.bt-tether.devices.android-phone.interval = 1
main.plugins.bt-tether.devices.android-phone.scantime = 10
main.plugins.bt-tether.devices.android-phone.max_tries = 0
main.plugins.bt-tether.devices.android-phone.share_internet = true
main.plugins.bt-tether.devices.android-phone.priority = 1
then reboot pwnagotchi, either via ssh --> sudo reboot now
or through the web UI in your browser.
pair pwnagotchi with phone (IMPORTANT!)
make sure BT and BT tethering are activated on your phone. keep phone unlocked, pair phone.
If for some reason pwnagotchi stops connecting to your phone after some time, or wont connect at all, try this:
# RP0W data port <--> pc
ssh [email protected]
sudo su
bluetoothctl
scan on
discoverable on
paired-devices # copy device adress
untrust *device adress* #run this command a few times
remove *device adress* #run this command a few times
paired-devices #make sure list is empty, if not- run previous command until it is empty
pair *device adress* #*In short time (maybe not immediately) you will be prompted on the phone to allow connection from your pwnagotchi hostname- pair*
trust *device adress*
exit
after that, open cmd window with ssh session(!), and
ping google.com
if you cant ping, see section 2.3 for fixing the dns issues.
change passwords
bettercap
sudo nano /etc/pwnagotchi/config.toml
sudo nano /usr/local/share/bettercap/caplets/pwnagotchi-auto.cap
sudo nano /usr/local/share/bettercap/caplets/pwnagotchi-manual.cap
webui
sudo nano /etc/pwnagotchi/config.toml
# look for the lines
ui.web.enabled = true
ui.web.address = "0.0.0.0"
ui.web.username = "your_login_user"
ui.web.password = "your_password"
ui.web.origin = ""
ui.web.port = 8080
ui.web.on_frame = ""
Fix broken AI
In release 1.5.5 the AI won't start by itself. The expected behaviour for Pwnagorchi would be to start in AUTO mode and switch to AI as soon as the Neural network has been loaded.
armv6
wget https://www.piwheels.org/simple/numpy/numpy-1.21.4-cp37-cp37m-linux_armv6l.whl#sha256=826319c22f05d7b50c3637af5563234edbb02f5634a08d314d21ef00271a32fe
sudo pip3 install https://www.piwheels.org/simple/numpy/numpy-1.21.4-cp37-cp37m-linux_armv6l.whl
armv7
https://www.piwheels.org/simple/numpy/numpy-1.21.4-cp37-cp37m-linux_armv7l.whl#sha256=826319c22f05d7b50c3637af5563234edbb02f5634a08d314d21ef00271a32fe
https://www.piwheels.org/simple/numpy/numpy-1.21.4-cp37-cp37m-linux_armv7l.whl
if pwnagotchi still doesnt switch to AI after ~45min
sudo apt-get remove python-opencv
sudo apt-get install python-opencv