This is a script to share your internet connection with your Pwnagotchi in Linux
The original version of this script can be found at Linux Pwnagotchi Connection Share on SourceForge. All credit for the original creation goes to @DoctorX.
The script has been modified to:
- Ask probing questions to gather and select information to automate the creation of the connection share.
- Allow the user to choose a DNS IP address, suggesting popular choices.
- Automatically scan for USB Ethernet Gadget interfaces and provide a selection for the user.
- Scan for and allow the user to choose non-Ethernet gadget interfaces for the upstream connection.
- Added command-line argument support for advanced users:
-u
or--username
: Set the username for the Pwnagotchi.-d
or--dns
: Set the DNS IP address to use.-p
or--pwnagotchi
: Set the Pwnagotchi USB Ethernet device name.-w
or--upstream
: Set the upstream device name.--config
: Specify a configuration file.
- Implemented a help function to display usage instructions.
-h
or--help
- Improved logging to provide detailed progress and error information.
- Included validation to ensure appropriate permissions for modifying iptable rules.
- Added fallback to interactive selection if command-line arguments are not provided.
- Refactored code to improve readability and maintainability.
- Automatic loading of configuration from
gotchi_connshare.conf
if present in the same directory. - Error handling for SSH connections to the Pwnagotchi device.
- Prompt to connect to the Pwnagotchi via SSH after setup completion.
To use this script:
- Clone the repo:
git clone https://github.com/ludothegreat/pwnagotchi-connshare.git cd pwnagotchi-connshare
- Make the script executable:
chmod +x gotchi_connshare.sh
- Run the script:
sudo ./gotchi_connshare.sh
- Optional - Run the script in your terminal with arguments:
example:
sudo ./gotchi_connshare.sh -u <username> -d <dnsserver> -p <pwnagotchiusbethdevicename> -w <upstreamdevicename>
sudo ./gotchi_connshare.sh -u pi -d 1.1.1.1 -p enp0s20fu8 -w wlan0
- Connect to your Pwnagotching:
Save as gotchi_connshare.conf
and place it in the same directory as the main script
# Enter your Pwnagotchi's username
username="pi"
# Enter your prefered DNS server
YOUR_DNS="1.1.1.1"
# Enter your Pwnagotchi's ethernet interface
pwnagotchi_iface="usb0"
# Enter your computers internet interface
upstream_iface="wlan0"