Giter Site home page Giter Site logo

Comments (7)

aluminum-ice avatar aluminum-ice commented on July 3, 2024

I've not seen this as an issue. Are you sure you are connecting to the OTG port. Only one of them provides power and data lanes. The other only provides power. In every test I've done, OTG USB connectivity is available right out of the box.

from pwnagotchi.

shir0tetsuo avatar shir0tetsuo commented on July 3, 2024

Yes, the OTG data port (middle port) is being used. I assume that it's doing something, but Ubuntu doesn't like it for some reason?
image

from pwnagotchi.

shir0tetsuo avatar shir0tetsuo commented on July 3, 2024

By the way, I'll note that my network is 10.0.0.* 255.255.255.0 as well, maybe that is conflicting with the connection. Is there a way to force a specific IP on the device from the Micro SD directly? That may work.

from pwnagotchi.

aluminum-ice avatar aluminum-ice commented on July 3, 2024

By the way, I'll note that my network is 10.0.0.* 255.255.255.0 as well, maybe that is conflicting with the connection. Is there a way to force a specific IP on the device from the Micro SD directly? That may work.

Oh it might be interfering. See the original instructions here from evilsocket. I wonder if you're getting a conflict because your network matches the network pwnagotchi tries to set up locally.

from pwnagotchi.

shir0tetsuo avatar shir0tetsuo commented on July 3, 2024

I have run the linux connection script, however over time the connection drops automatically by whatever Ubuntu thinks is right, I believe being not connected to my local network may open up a window for SSH login; I think the first thing I'll try to do with it is change the default IP address on the device.. Finicky at best but now there is possibility of connecting. Will have to come back with updated progress

from pwnagotchi.

shir0tetsuo avatar shir0tetsuo commented on July 3, 2024

By the way, I'll note that my network is 10.0.0.* 255.255.255.0 as well, maybe that is conflicting with the connection. Is there a way to force a specific IP on the device from the Micro SD directly? That may work.

Oh it might be interfering. See the original instructions here from evilsocket. I wonder if you're getting a conflict because your network matches the network pwnagotchi tries to set up locally.

After messing around for a little while I came up with a working solution. This might be useful infos for other people having similar issues being on the same network config I have being 10.0.0.0/24 on my home network:

  1. Disconnect from default internet connection.
  2. Remove all pre-existing configurations if necessary.
  3. Use the Linux connect script (on Ubuntu host machine), In my case, it was:
#!/usr/bin/env bash
set -e

# name of the ethernet gadget interface on the host
USB_IFACE=${1:-enxfec40b5b3a66}
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:-enp4s0}

ip addr add "$USB_IFACE_IP/24" dev "$USB_IFACE"
ip link set "$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
echo "The process completed successfully. Made changes to ip and iptables."
  1. SSH into the device with 10.0.0.2 (or hostname.local).
  2. Reconfigure the usb0 connection expecting a disconnect (at /etc/network/interfaces.d/usb0-cfg )
allow-hotplug usb0
iface usb0 inet static
  address 10.0.1.2
  netmask 255.255.255.0
  network 10.0.1.0
  broadcast 10.0.1.255
  gateway 10.0.1.1
  metric 20
sudo ifconfig usb0 10.0.1.2 netmask 255.255.255.0
  1. (On Ubuntu host machine):
#!/usr/bin/env bash
set -e

# name of the ethernet gadget interface on the host
USB_IFACE=${1:-enxfec40b5b3a66}
USB_IFACE_IP=10.0.1.1
USB_IFACE_NET=10.0.1.0/24
# host interface to use for upstream connection
UPSTREAM_IFACE=${2:-enp4s0}

ip addr add "$USB_IFACE_IP/24" dev "$USB_IFACE"
ip link set "$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
echo "The process completed successfully. Made changes to ip and iptables."
  1. Reconnect standard internet connection.

The device can now be pinged/connected while also simultaneously being connected to the internet.

from pwnagotchi.

shir0tetsuo avatar shir0tetsuo commented on July 3, 2024

I have resolved my connection issues please see the above for details 👍

from pwnagotchi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.