Testing firewall rules with netcat

From EggeWiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

It's quite easy to test to see if a firewall will allow traffic on a specific port if you have control of the server behind the firewall. Example:

On the remote side, listen to a port: <geshi lang="bash"> echo 'OMG!' | nc -l -p 5152 </geshi>

On the local side, use telnet or nc to connect to the remote.

<geshi lang="bash"> telnet remote 5152 Trying 10.136.2.242... Connected to remote. Escape character is '^]'. OMG! </geshi>