Advertisement
Guest User

tunelling socks into interface

a guest
Oct 18th, 2024
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | Cybersecurity | 0 0
  1. sysctl -w net.ipv4.ip_forward=1
  2. sysctl -w net.ipv4.conf.all.route_localnet=1
  3.  
  4. iptables -F
  5. iptables -X
  6. iptables -t nat -F
  7. iptables -t nat -X
  8. iptables -t mangle -F
  9. iptables -t mangle -X
  10. iptables -t raw -F
  11. iptables -t raw -X
  12. iptables -P INPUT DROP
  13. iptables -P OUTPUT ACCEPT
  14. iptables -P FORWARD DROP
  15.  
  16. iptables -I INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
  17.  
  18. iptables -I INPUT -p icmp --icmp-type echo-reply -j ACCEPT
  19. iptables -I INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
  20. iptables -I INPUT -p icmp --icmp-type time-exceeded -j ACCEPT
  21. iptables -I INPUT -p icmp --icmp-type echo-request -j ACCEPT
  22.  
  23. iptables -t nat -A PREROUTING -i vboxnet0 -p tcp --dport 9050 -j DNAT --to-destination 127.0.0.1:9050
  24. iptables -A INPUT -i vboxnet0 -d 127.0.0.1 -p tcp --dport 9050 -j ACCEPT
  25.  
  26. iptables -I INPUT -i lo -j ACCEPT
  27.  
  28. iptables -I OUTPUT -o vboxnet0 -j DROP
  29. iptables -I OUTPUT -o vboxnet0 -p tcp --sport 9050 -j ACCEPT
  30. iptables -I OUTPUT -o vboxnet0 -p icmp --icmp-type echo-reply -j ACCEPT
  31. iptables -I OUTPUT -o vboxnet0 -p icmp --icmp-type destination-unreachable -j ACCEPT
  32. iptables -I OUTPUT -o vboxnet0 -p icmp --icmp-type time-exceeded -j ACCEPT
  33. iptables -I OUTPUT -o vboxnet0 -p icmp --icmp-type echo-request -j ACCEPT
  34.  
  35. iptables -I OUTPUT -o lo -j ACCEPT
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement