Connect to the target device's host OS, and create the system-proxy
directory:
mkdir -p /mnt/boot/system-proxy/
On the target device (ssh into the hostOS) create this file and replace the with the one of the host which will have the proxy server (your development machine for example):
cat <<'EOF'>> /mnt/boot/system-proxy/redsocks.conf
base {
log_debug = off;
log_info = on;
log = stderr;
daemon = off;
redirector = iptables;
}
redsocks {
type = http-connect;
ip = <SERVER IP>;
port = 8123;
local_ip = 127.0.0.1;
local_port = 12345;
}
EOF
Finally, reboot the device under test with reboot
.
Note: for QEMU images, you have to use the IP of the host (and you get it by running
route
and checking for the gateway), for example:
root@087ce64:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 10.0.2.2 0.0.0.0 UG 100 0 0 enp0s3
here it would be that you need to use
10.0.2.2
.For physical devices, you can use your development machine's local network IP, or
<hostname>.local
if you are using Avahi. (Note thatip =
can take both an IP address and hostname).
On a server host machine (your development machine for example) located in the same network, install the glider.
Start a mixed SOCKS/HTTP proxy with running:
glider -listen :8123 -verbose
Wait until the device appears online in the dashboard and then hit CTRL+C to stop the above command.
- a - On the server (your development machine for example), restart the proxy:
glider -listen :8123 -verbose
After starting the proxy, the device should appear online, allowing you to ssh to it and continue with the following step.
- b - Execute on the target device (on the hostOS) to remove the proxy settings:
rm -rf /mnt/boot/system-proxy && reboot
You should now stop the proxy on your development machine.
The device should reboot and remain offline in the dashboard.
Once the proxy has been started on the development machine, the device should appear as online in the dashboard.
In the proxy logs should see lines like:
2018/04/10 10:48:01 proxy-https 127.0.0.1:36624 <-> 159.122.19.148:80
where the key is seeing proxy-https
to signal that the connection is over HTTP(S).
When pressing CTRL+C, the device should go offline.
- a - Once the proxy has been re-started, the device should appear as online in the dashboard.
- b - The device should reboot and then appear online in the dashboard once booted up.