如何利用iptables在网关上对某个IP进行劫持

以源地址为10.0.0.0/8 目的地址为211.65.64.43的访问为例为例 把目标地址的80,443,44449访问全部转向219.230.144.XXX:80的80端口
[bash]iptables -A PREROUTING -p tcp -m tcp -j DNAT -s 10.0.0.0/8 -d 211.65.64.43 --match multiport --dports 80,443,44449 --to-destination 219.230.144.XXX:80 -t nat[/bash]
或者劫持他的某个端口范围
[bash]iptables -A PREROUTING -p tcp -m tcp -j DNAT -s 10.0.0.0/8 -d 211.65.64.43 --match multiport --dports 80:44449 --to-destination 219.230.144.XXX -t nat[/bash]
或者只劫持DNS协议
[bash]-A PREROUTING -s 10.0.0.0/8 -p udp --dport 53 -d 221.131.143.69 -j DNAT --to-destination 219.230.144.XXX:53[/bash]
[bash]iptables -A PREROUTING -s 10.0.0.0/8 -p udp --dport 53 -d ! 8.8.0.0/16 -j DNAT --to-destination 8.8.8.8 -t nat
iptables -A PREROUTING -s 10.0.0.0/8 -p udp --dport 53 -d ! 10.0.0.0/8 -j DNAT --to-destination 8.8.8.8 -t nat[/bash]

Author Info :
  • From:如何利用iptables在网关上对某个IP进行劫持
  • URL:https://blog.ihipop.com/2011/05/2378.html
  • Please Reserve This Link,Thanks!
  • 《如何利用iptables在网关上对某个IP进行劫持》上有3条评论

    发表回复

    您的电子邮箱地址不会被公开。 必填项已用*标注