|
IP伪装是否有去无回??
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.1.0/24 -j SNAT --to-source 119.119.119.119
这样的话,可以看到效果Ping的话,可以看到来源ip是119.119.119.119(这个在网络中实际上是不存在的,转发NAT masquerading称为ip伪装,这个ip是否一定要是存在,一般的NAT其实是路由器对内网和外网进行转换,这是必须的。)
iptables -t nat -A PREROUTING -i eth0 -d 119.119.119.119 -j DNAT -to-destination 192.168.1.108
192.168.1.110( smallmantou) 是我机器的ip。
似乎,在debain机器ping 192.168.123.1.110的时候,不会和正常显示一样,在terminal没有看到收到回复
865 packets transmitted, 0 received, 100% packet loss, time 864028ms
但是在win下看到
10:13:43.145462 IP smallmantou > 119.119.119.119: icmp 64: echo reply seq 85
10:13:44.145240 IP 119.119.119.119 > smallmantou: icmp 64: echo request seq 86
10:13:44.145275 IP smallmantou > 119.119.119.119: icmp 64: echo reply seq 86
10:13:45.145151 IP 119.119.119.119 > smallmantou: icmp 64: echo request seq 87
10:13:45.145186 IP smallmantou > 119.119.119.119: icmp 64: echo reply seq 87
10:13:46.145048 IP 119.119.119.119 > smallmantou: icmp 64: echo request seq 88
10:13:46.145084 IP smallmantou > 119.119.119.119: icmp 64: echo reply seq 88
10:13:47.144954 IP 119.119.119.119 > smallmantou: icmp 64: echo request seq 89
10:13:47.144988 IP smallmantou > 119.119.119.119: icmp 64: echo reply seq 89
似乎这里是对的
windump -i 2 tcp port ! 22 and host 119.119.119.119
windump -i 2 tcp port ! 22 and host 192.168.1.110
看到的结果都是这样, 然后我windump看我 ping 其他机器,看到的结果也是这样。
--
接着我 tcpdump tcp port ! 22 and host 119.119.119.119
10:41:01.347825 IP 119.119.119.119 > 192.168.1.110: icmp 64: echo request seq 152
10:41:01.348145 IP 192.168.1.110 > 119.119.119.119: icmp 64: echo reply seq 152
10:41:02.347676 IP 119.119.119.119 > 192.168.1.110: icmp 64: echo request seq 153
10:41:02.348003 IP 192.168.1.110 > 119.119.119.119: icmp 64: echo reply seq 153
10:41:03.347520 IP 119.119.119.119 > 192.168.1.110: icmp 64: echo request seq 154
10:41:03.347844 IP 192.168.1.110 > 119.119.119.119: icmp 64: echo reply seq 154
10:41:04.347371 IP 119.119.119.119 > 192.168.1.110: icmp 64: echo request seq 155
10:41:04.347705 IP 192.168.1.110 > 119.119.119.119: icmp 64: echo reply seq 155
10:41:05.347221 IP 119.119.119.119 > 192.168.1.110: icmp 64: echo request seq 156
10:41:05.347545 IP 192.168.1.110 > 119.119.119.119: icmp 64: echo reply seq 156
tcpdump tcp port ! 22 and host 192.168.1.108(smallmantou)
似乎没有截获到数据, 怀疑这跟SNAT已经将源IP已经改掉了有关
请指教 |
|