xct's notes
Search…
Networking

Route Windows through Linux VM

Give both VMs a network adapter on the same network. On Windows, set the Linux VM as default gateway. On Linux run the following commands (assumes eth1 incoming, eth0 outgoing):
1
sudo sysctl net.ipv4.ip_forward=1
2
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
3
sudo iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
4
sudo iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
Copied!

Transparent Proxy

1
sudo sysctl net.ipv4.ip_forward=1
2
sudo iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 80 -j REDIRECT --to-port 8080
3
sudo iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 443 -j REDIRECT --to-port 8080
Copied!
If you use burp make sure to check the "invisible" proxy option.

Show open ports without netstat

1
grep -v "rem_address" /proc/net/tcp | awk '{x=strtonum("0x"substr($3,index($3,":")-2,2)); for (i=5; i>0; i-=2) x = x"."strtonum("0x"substr($3,i,2))}{print x":"strtonum("0x"substr($3,index($3,":")+1,4))}'
Copied!
Last modified 7mo ago