Connecting To Your Pwnagotchi

Connecting To Your Pwnagotchi

Preparation

In order to make the first connection to your Pwnagotchi we need to prepare your computer to know how to locate your Pwnagotchi. It supports OTG, which requires a data USB cable.

You now have an SD card with Pwnagotchi flashed onto it, put the SD card in the appropriate slot of your Raspberry Pi. If you have a Pi0W or Pi02W connect the micro USB side to the port closest to your HDMI port, and insert the USB-A side into your computer. The Pi3 will require a USB-A to USB-A data cable. If you have a Pi4 or Pi5 you can use the USB-C port to connect to your computer.

Windows RNDIS driver

Download and unpack/zip the following Download.

In your Device Manager look for the following connection (COMx) with your RPi connected:

image

It may also be identified as an unknown USB device or something similar. When you disconnect the RPi the device should also disappear from the list, it is just a double check for the right connection. Now that you have the correct connection, right click it and select Update driver and select Browse computer and go to folder containing the driver you downloaded in the beginning. It should be recognized as follows:

image

Assigning interface IP and Internet sharing

 Open Control Panel > Network and Internet > View network status and tasks > Change Adapter Settings.

Right click the device with the sub-title 'USB Ethernet/RNDIS Gadget ##' [2] > Properties > Double click 'TCP/IPv4' and configure like below

image

Press OK and close the remaining menus.

To share internet to Pwnagotchi, open the control panel menu as above [1]. Select your main internet adapter (Wifi/Ethernet) right click, properties. Open the sharing tab at the top of the menu, enable the top tick button and select the new Ethernet adapter that Pwnagotchi is using.

Press OK and close the remaining menus.

Alternatively,

Download the following script.

Now you should open PowerShell as Administrator. And run the following commands.

cd ~\Downloads
Set-ExecutionPolicy -ExecutionPolicy Unrestricted
.\win_connection_share.ps1 -EnableInternetConnectionSharing

Answer the questions, and when it is done it may require a reboot.

Linux

connecting-1.png

  • Open a terminal session
  • type ifconfig and write down the device name of your wireless/ethernet adapter. The Pwnagotchi usually gets a name that starts with en or usb0.
  • wget https://raw.githubusercontent.com/jayofelony/pwnagotchi/master/scripts/linux_connection_share.sh
  • sudo chmod +x linux_connection_share.sh (this will make it executable)
  • Edit the script as shown in the image above:
  • USB_IFACE will be the USB device name (notice the starting -.)
  • UPSTREAM_IFACE will be your internet adapter name (notice the starting -)
  • Leave the rest as is
  • Run the script: sudo ./linux_connection_share.sh

You should know that the connection might fail/disconnect a couple of times before it actually sticks. If it does fail repeat the last step. The device name will remain the same.

Every time you (re)connect your USB cable to the computer it will get a new device name.

Connecting

I prefer SSH to connect as it will also stimulate me to learn how to use Linux commands and Linux OS in general. I hope you will also.

Connect to your Pwnagotchi with SSH

Default credentials are: pi/raspberry

Windows

  • Open cmd.exe or a PowerShell session.
  • type ssh <username>@10.0.0.2, <username> should be changed for either default username or the username you set in RPi Imager
  • Confirm the security message by entering yes
  • Enter the default password or the password you set in RPi Imager

If you are using a Pi4/5 and are connected with an ethernet cable, you can look up your device's IP and connect like this:

ssh <username>@<IP_of_your_pwn> or ssh <username>@pwnagotchi.lan

It will show a security message which you can confirm by typing yes.

And then enter your password.

Linux

  • Open a terminal session
  • type ssh <username>@10.0.0.2, <username> should be changed for either default username or the username you set in RPi Imager
  • Confirm the security message by entering yes
  • Enter the default password or the password you set in RPi Imager

If you are using a Pi4/5 and are connected with an ethernet cable, you can look up your device's IP and connect like this:

ssh <username>@<IP_of_your_pwn> or ssh <username>@pwnagotchi.lan

It will show a security message which you can confirm by typing yes.

And then enter your password.

MacOS

  • Open Terminal app
  • type ssh <username>@10.0.0.2, <username> should be changed for either default username or the username you set in RPi Imager
  • Confirm the security message by entering yes
  • Enter the default password or the password you set in RPi Imager

If you are using a Pi4/5 and are connected with an ethernet cable, you can look up your device's IP and connect like this:

ssh <username>@<IP_of_your_pwn> or ssh <username>@pwnagotchi.lan

It will show a security message which you can confirm by typing yes.

And then enter your password.

Back to blog