scripts folder

This commit is contained in:
evilsocket 2019-09-24 15:50:27 +02:00
parent 83aef1fc75
commit fb3ddfe2ce
No known key found for this signature in database
GPG Key ID: 82E42E7F3B34C97E
3 changed files with 23 additions and 1 deletions

@ -42,7 +42,7 @@ For hackers to learn reinforcement learning, WiFi networking and have an excuse
#### Automatically create an image
You can use the `create_sibling.sh` script to create an - ready to flash - rasbian image with pwnagotchi.
You can use the `scripts/create_sibling.sh` script to create an - ready to flash - rasbian image with pwnagotchi.
```shell
usage: ./create_sibling.sh [OPTIONS]
@ -56,6 +56,10 @@ usage: ./create_sibling.sh [OPTIONS]
-h # Show this help
```
#### Host Connection Share
If you connect to the unit via `usb0` (thus using the data port), you might want to use the `scripts/linux_connection_share.sh` script to bring the interface up on your end and share internet connectivity from another interface, so you can update the unit and generally download things from the internet on it.
### UI
The UI is available either via display if installed, or via http://10.0.0.2:8080/ if you connect to the unit via `usb0` and set a static address on the network interface.

@ -0,0 +1,18 @@
#!/bin/bash
# name of the ethernet gadget interface on the host
USB_IFACE=${1:-enp0s20f0u1}
USB_IFACE_IP=10.0.0.1
USB_IFACE_NET=10.0.0.0/24
# host interface to use for upstream connection
UPSTREAM_IFACE=${2:-enxe4b97aa99867}
ip addr add $USB_IFACE_IP/24 dev $USB_IFACE
ifconfig $USB_IFACE up
iptables -A FORWARD -o $UPSTREAM_IFACE -i $USB_IFACE -s $USB_IFACE_NET -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -F POSTROUTING
iptables -t nat -A POSTROUTING -o $UPSTREAM_IFACE -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward