From 3050db1d3beee37582e3579adcb85bdb8e076633 Mon Sep 17 00:00:00 2001 From: evilsocket <evilsocket@gmail.com> Date: Thu, 19 Sep 2019 15:51:33 +0200 Subject: [PATCH] misc: small fix or general refactoring i did not bother commenting --- README.md | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b261556..2a2ece1 100644 --- a/README.md +++ b/README.md @@ -24,9 +24,36 @@ If instead you are a boring person, you can disable the AI and have the algorith - [Waveshare eInk Display](https://www.waveshare.com/2.13inch-e-paper-hat.htm) (optional if you connect to usb0 and point your browser to the web ui, see config.yml) - A decent power bank (with 1500 mAh you get ~2 hours with AI on) -### Random +### Random Info - `hostname` sets the unit name. +- At first boot, each unit generates a unique RSA keypair that can be used to authenticate advertising packets. +- **On a rpi0w, it'll take approximately 30 minutes to load the AI**. +- `/var/log/pwnagotchi.log` is your friend. +- if connected to a laptop via usb data port, with internet connectivity shared, magic things will happen. + +Magic scripts that makes it talk to the internet: + +```sh +#!/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=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 +``` ### Software