Skip to content
agrovista edited this page Mar 1, 2025 · 14 revisions

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.

Alternatively if you use a Pi4/5 you can connect it with an ethernet cable to your internet modem or router and skip to #Connecting.

Windows

RNDIS driver

Download and unpack/zip the following driver.

Look for the 'Setup Information' file right click and press 'Install'

Alternatively,

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

[1] 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 [2].

Press OK and close the remaining menus.

Alternatively,

Download the following script.

Click Download raw file, and accept any security risks

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.

MacOS

Assigning interface IP and Internet sharing

If the RNDIS/Ethernet Gadget does not automatically connect System settings>Network, Click on the 3 dots in the lower right corner, Add service, and select the RNDIS/Ethernet Gadget in the drop down menu. Name it whatever you want really. now continue to the next section.

Configuring the RNDIS/Ethernet

Click on the System settings>Network>service>Details>TCP/IP. Here you will configure your IP and subnet mask. Under the drop down menu for Configure IPv4, select Manually. For the IP address now you will set it to 10.0.0.1. For the Subnet mask it will be 255.255.255.0 Next we will set the DNS servers, Click on the service>Details>DNS, Add one, enter 8.8.8.8 Add another, enter 1.1.1.1

You can now ssh into your Pwnagotchi

To share internet to your Pwnagotchi

Currently, macOS’s built-in internet sharing seems to break ssh. The way I have found around this is using EvilSocket’s connection sharing script (Download here) To use this script you need your interface number, to obtain such number, use ifconfig. Note down your main interface (Usually en0 sometimes en1 if you use ethernet and wifi) You will also need to find the interface number of your pwnagotchi, find the interface with the IP of 10.0.0.1. Note that number, for me en7.

Now, in a new terminal window. Type sudo sh. Drag the script you downloaded previously into the window, space once. Now enter the interface you're sharing from, for me en0 followed by a space the the interface you are sharing to. For me the command would look like sudo sh /Users/ryan/Downloads/macos_connection_share.sh en0 en7 Once you run this command you will be prompted for your password, enter said password and enter, you will see errors,

sharing connecting from upstream interface en0 to usb interface en7 ... net.inet.ip.forwarding: 0 -> 1 No ALTQ support in kernel ALTQ related functions disabled pf enabled pfctl: Use of -f option, could result in flushing of rules present in the main ruleset added by the system at startup. See /etc/pf.conf for further details.

This is normal, it means it worked! Now you can go over to your Pwnagotchi and ping google.com to make sure everything has worked!

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

DO NOT run apt-get upgrade if you do you will need to reflash and start over

Windows

  • Open cmd.exe or a PowerShell session.
  • type ssh pi@10.0.0.2
  • Confirm the security message by entering yes
  • Enter the default password raspberry

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 pi@<IP_of_your_pwn> or ssh pi@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 pi@10.0.0.2
  • Confirm the security message by entering yes
  • Enter the default password raspberry

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 pi@<IP_of_your_pwn> or ssh pi@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 pi@10.0.0.2
  • Confirm the security message by entering yes
  • Enter the default password raspberry

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 pi@<IP_of_your_pwn> or ssh pi@pwnagotchi.lan

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

And then enter your password.

Previous: Installation Next up: Configuring your Pwnagotchi