![]() |
Transparent socks proxy (shadowsocks and ssh tunnel)
redsocks, pdnsd, shadowsocks-libev and proxychains are uploaded to openrepos
pdnsd pdnsd is needed for dealing with dns poisoning sample config file for pdnsd (/etc/pdnsd.conf): Code:
global { shadowsocks is a lightweight and secure socks5 proxy. It can replace the ssh tunnel. Also shadowsocks-libev has ss-redir which works as a transparent proxy, so redsocks is not needed. :D sample config file for shadowsocks (/home/nemo/.shadowsocks/ss-config.json) Code:
{ iptables needs to be set up to redirect the network traffic to our socks proxy. CAUTION: MESSING UP WITH IPTABLES MAY JAM YOUR NETWORK:D a dirty script for iptables config (iptables-ss.sh) Code:
#!/bin/sh iptables-ss.sh start will (re-)start pdnsd and set up iptables rules iptables-ss.sh stop will do the reverse iptables-ss.sh stop-ss will kill the shadowsocks process (not really needed) redsocks If ssh tunnel is preferred then redsocks is used for creating the transparent proxy. sample config file (/home/nemo/.redsocks/redsocks.conf) Code:
base { a dirtier iptables script for redsocks :D (redsocks.sh) Code:
#!/bin/sh redsocks.sh start : start redsocks, pdnsd and set up iptables rules redsocks.sh stop : undo everything Proxychains proxychains is a hook preloader that allows to redirect TCP traffic of existing dynamically linked programs through one or more SOCKS or HTTP proxies. It can be used to launch a single app whose traffic will go through a chains of proxies defined in /etc/proxychains.conf (default is 127.0.0.1:9050 for tor). Domain names are resolved in the proxy side. Usage example: Code:
proxychains4 sailfish-browser issues No gui (yet) :p The network gets jammed after switching from wifi to 3g or vice versa. The iptables scripts need to be restarted after every network switching. Not sure about the cause, maybe the rules are messed up after all...:confused: |
Re: Transparent socks proxy through ssh tunnel
thanks, I will try this trick with my tor package :)
|
Re: Transparent socks proxy through ssh tunnel
shadowsocks-libev compiles and works out-of-the-box :D
|
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
bump for some update
|
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
great job
But still feel slightly more power consumption |
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
unfortunately the solution that works (tordns with iptables) gives another issue in my experience - it seems Store doesnt like it, I assume its due to tordns not having dns records for Jolla repositories.
So, the proxy/iptables or just having the browser using tor (like my package) seems to be the compromise ATM. |
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
Quote:
|
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
So I installed nieldk's Tor package from the warhouse store.
According to the package notes it'll setup a proxy for the webbrowser. Is it possible to make the phone completely transparant by using tordns and iptables? With the ability to switch between 3G and Wifi? |
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
Quote:
It seems there is no auto-switching. After network switching iptables have to be toggled off and on again manually. Haven't figure out why...:confused: |
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
Quote:
|
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
ahhh thanks nieldk!
I'll look into this. |
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
You will probably need to look at this, to ensure that services are indeed started AFTER network is UP ;)
Yeah, systemd has some issues (Linus is Yelling at the maintainer) http://www.freedesktop.org/wiki/Soft...NetworkTarget/ |
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
Thanks nieldk!
I'm a bit new to the Sailfish OS. So if I understand it correctly: The dhclient should always set 127.0.0.1 as nameserver (no matter what). This script: Code:
#!/bin/sh Then all outgoing traffic (except for localhost) will be routed trough Tor and I'll be able to resolve .onion names. Also I'll be flagged as an "extremist" by the NSA according to recent news :P |
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
Unfortunately I am not familiar with the ProxyCommand option. Maybe someone else here can help you out?
|
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
Perhaps you need to allow the traffic to the remote proxy, which your local proxy 127.0.0.1:3339 connects to.
|
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
Quote:
|
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
iptables -t nat -A REDSOCKS -d xxx.xxx.xxx.xxx -j RETURN
replace the xxx's with your remote proxy server |
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
Read up on iptables usage :)
For example: http://www.cyberciti.biz/faq/linux-p...with-iptables/ |
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
My guess, DNS is not setup correctly.
Either in DHCP its not given, or, iptables is blocking DNS requests. |
Re: Transparent socks proxy (shadowsocks and ssh tunnel)
I made a UI for this(the backend use gost https://github.com/ginuerzh/gost/blo...r/README_en.md )
https://openrepos.net/content/birdzh...gs-gost-button :D |
All times are GMT. The time now is 19:39. |
vBulletin® Version 3.8.8