O'Reilly logo

Penetration Testing with Perl by Swizec Teller

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Enabling packet forwarding

Packet forwarding is the relay of packets from one node on the network to another. In our case, we will relay packets from the victim to the gateway and vice versa. To allow packet forwarding from our system to the Internet, set the value located in the file /proc/sys/net/ipv4/ip_forward on most modern GNU-Linux systems to 1. This enables IP forwarding as a GNU-Linux kernel function. We can then tell iptables to route the traffic from port to port. For instance, the following command can be used in conjunction with the previously mentioned SSLStrip utility to redirect the victim's traffic coming into port 80 to our local port 10000:

iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-ports 10000 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required