A splash on firewalls

July 7, 2010, by | Start Discussion

I’m sure you all know that almost all operating system have a kind of inbuilt firewall. Windows has “Windows firewall” whereas the Linux has “iptables”.

In this issue of command line gyan, we’ll see how can we play around & see allowed/ disallowed activities via these firewalls

Windows

On a windows box if we want to see all the ports which are allowed through, all we need to do is type following command

C:> netsh firewall show

To see the applications allowed communicating through firewall

C:> netsh firewall show

To view all the configuration of windows firewall, try

C:> netsh firewall show

This NETSH is really cool & we’ll surely cover the whole NETSH sometime soon.

Linux

Ok! as we have always seen Linux is much easier on command line, let’s see how we can achieve the same outputs on Linux.
To see a complete config, the easiest way is

#iptables –L

To make it little fast (and avoid reverse lookup)

#iptables –nL

-n here will stop the command to do a reverse lookup & hence increasing the performance .

To make it more specific
 

# iptables -t nat -nL

# iptables -t mangle -nL

# iptables -t  filter -nL

# iptables -t raw –nL

These will list (-L) the specific (-t) chain without reverse lookup (n).

More in future issue.
Happy finding your firewall holes

bio data - Rohit Srivastwa

Leave a Reply