iptables / nftables
Configure the Linux firewall.
KaliParrotLinuxmedium
pkg: iptables
iptables/nftables manage packet-filtering rules — essential for redirecting traffic during MITM and for host hardening.
Syntax
iptables -t {table} -A {chain} {rule}
Example
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8080
Redirects inbound HTTP to a local proxy (e.g. for sslstrip).
Options & flags
What each switch does. Toggle them in the builder below to assemble a command.
Command builder
Tick options (and fill any values) to build a ready-to-copy command.
iptables
Usage examples
iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8080
Redirect HTTP to a local proxy (MITM).
iptables -L -n -v
List all current rules.
Advantages
- Fine-grained traffic control
- Core to MITM setups
Disadvantages
- Easy to lock yourself out
- Syntax is unforgiving
Tags
#firewall#networking
Official docs: netfilter ↗
Related commands
Frequently asked questions
What is iptables / nftables used for?
iptables/nftables manage packet-filtering rules — essential for redirecting traffic during MITM and for host hardening.
What is an example iptables / nftables command?
A common example is: iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 8080 — Redirects inbound HTTP to a local proxy (e.g. for sslstrip).
Is iptables / nftables part of Kali Linux?
Yes. iptables / nftables ships with Kali Linux (and Parrot OS). If missing, install it with: sudo apt install iptables.
What category of security tool is iptables / nftables?
iptables / nftables is a Core Linux tool with a medium-risk profile when run against a live target.
Try recon tools live
Run real scans against a domain you control, stage by stage.