Ssh vpn remote hack

Aus Xinux Wiki
Zur Navigation springen Zur Suche springen

Raspberry

  • ssh -4 -f -N kali.xxxxx.de -p 8472 -R 7777:localhost:22

kali.xxxx.de

Local to Remote Tun Device

  • ssh -w 0:0 root@localhost -p 7777 -fN

Hochfahren der TUN Devices

  • ip link set tun0 up
  • ssh root@localhost -p 7777 ip link set tun0 up

IP Adressen an die TUN Devices

  • ip addr add 10.2.2.1/30 dev tun0
  • ssh root@localhost -p 7777 ip addr add 10.2.2.2/30 dev tun0

ROUTE auf die Gegenseite

  • ip route add 192.168.4.0/24 via 10.2.2.2

MASKIERUNG auf der LAN Schnittstelle

  • ssh root@localhost -p 7777 iptables -t nat -A POSTROUTING -s 10.2.2.0/24 -j MASQUERADE

Test

  • ping 192.168.4.100