<div dir="ltr"><br><div>Andando al sodo,</div><div><br></div><div>da casa mia mi collego in ssh al pc del mio ufficio e da questo, tramite una sock in python e una regola nat di iptables in PREROUTING ottengo un VPN proxy :)</div>
<div><br></div><div>Il server ssh necessita solo di iptables e python per fare tutto,</div><div>tramite iptables dirotta tutto il traffico TCP/IP su una sock creata in python che nel computer che ospita ssh sfrutta la tabella di routing e le sue interfacce per una navigazione &quot;orizzontale&quot;.<br>
</div><div><br></div><div><br></div><div><div>root@maker:/home/wert# sshuttle -r <a href="http://wert@160.97.12.22:222">wert@160.97.12.22:222</a>  <a href="http://172.17.87.0/16">172.17.87.0/16</a></div><div><a href="mailto:wert@160.97.12.224">wert@160.97.12.224</a>&#39;s password: </div>
<div>Connected.</div><div>server: warning: closed channel 1 got cmd=STOP_SENDING len=0</div><div>server: warning: closed channel 2 got cmd=STOP_SENDING len=0</div><div>server: warning: closed channel 4 got cmd=STOP_SENDING len=0</div>
<div>server: warning: closed channel 6 got cmd=STOP_SENDING len=0</div><div>server: warning: closed channel 3 got cmd=STOP_SENDING len=0</div></div><div><br></div><div>in iptables succede questo:</div><div><br></div><div>
<div><br></div><div>root@maker:/home/wert# iptables -t nat -L -n</div><div>Chain PREROUTING (policy ACCEPT)</div><div>target     prot opt source               destination         </div><div>sshuttle-12300  all  --  <a href="http://0.0.0.0/0">0.0.0.0/0</a>            <a href="http://0.0.0.0/0">0.0.0.0/0</a>           </div>
<div><br></div><div>Chain INPUT (policy ACCEPT)</div><div>target     prot opt source               destination         </div><div><br></div><div>Chain OUTPUT (policy ACCEPT)</div><div>target     prot opt source               destination         </div>
<div>sshuttle-12300  all  --  <a href="http://0.0.0.0/0">0.0.0.0/0</a>            <a href="http://0.0.0.0/0">0.0.0.0/0</a>           </div><div><br></div><div>Chain POSTROUTING (policy ACCEPT)</div><div>target     prot opt source               destination         </div>
<div><br></div><div>Chain sshuttle-12300 (2 references)</div><div>target     prot opt source               destination         </div><div>REDIRECT   tcp  --  <a href="http://0.0.0.0/0">0.0.0.0/0</a>            <a href="http://172.17.0.0/16">172.17.0.0/16</a>        TTL match TTL != 42 redir ports 12300</div>
<div>RETURN     tcp  --  <a href="http://0.0.0.0/0">0.0.0.0/0</a>            <a href="http://127.0.0.0/8">127.0.0.0/8</a>         </div><div><br></div></div><div><br></div><div>e come socketstream mi trovo:</div><div><br>
</div><div><div>python    18799        root    3u  IPv4 5260614      0t0  TCP <a href="http://127.0.0.1:12300">127.0.0.1:12300</a> (LISTEN)</div><div>python    18800        root    3u  IPv4 5260614      0t0  TCP <a href="http://127.0.0.1:12300">127.0.0.1:12300</a> (LISTEN)</div>
</div><div><br></div><div><br></div><div>provare per credere, io sul mio browser vado su:</div><div><br></div><div><a href="https://172.17.87.9/system.cgi">https://172.17.87.9/system.cgi</a><br></div><div><br></div><div>che è collegato sullo stesso switch della mia rete in ufficio :)</div>
<div><br></div><div>pensiamoci.</div><div><br></div><div>esponendo su ogni super nodo, ove possibile, la connessione alla porta ssh dal router adsl domestico, possiamo - previa installazione di python-minimal su openwrt - amministrare le antenne con flessibilità.</div>
<div><br></div><div>apt-get install sshuttle</div><div><br></div><div>bye,</div><div>G</div><div><br></div></div>