> ## Content Index
> Fetch the complete content index at: https://kudithipudi.org/llms.txt
> Use this file to discover other available public pages before exploring further.

# HOW TO : Use netcat (nc) on Windows 7
- URL: https://kudithipudi.org/how-to-use-netcat-nc-on-windows-7/
- Published: 2011-07-14T16:28:27.000Z
- Updated: 2011-07-14T16:28:27.000Z
- Description: netcat is a swiss army tool for network/security professionals. You can use it to listen on certain ports or connect to certain ports. For example, say,...
- Author: admin
- Tags: HOWTO, Networking, Technology, Uncategorized, Windows, #wp, #wp-post, #Import 2026-08-23 02:32

[netcat](http://netcat.sourceforge.net/?ref=kudithipudi.org) is a swiss army tool for network/security professionals. You can use it to listen on certain ports or connect to certain ports. For example, say, you configured your firewall to allow [TCP](http://en.wikipedia.org/wiki/Transmission%5FControl%5FProtocol?ref=kudithipudi.org) 80 traffic to your web server. But your web server is not built yet and you want to validate the rule. You can run netcat on your workstation to listen on port 80, assign the IP address of the web server to your workstation and test the rule.

If I am not mistaken, nc comes as a default tool in most of the [Linux](http://en.wikipedia.org/wiki/Linux?ref=kudithipudi.org) distros. You can download the windows port of the tool at [http://www.securityfocus.com/tools/139](http://www.securityfocus.com/tools/139?ref=kudithipudi.org)

The command to have netcat listen on a specific port is “nc -l PORT\_NUMBER”. If you run this on a Windows 7 machine, you will get this dreaded message “local listen fuxored: INVAL”. The fix is to run it with a -L option. So the command would like this

```
nc -L -p 80
```

The -L means “listen harder, re-listen on socket close” :).. Have to dig deeper and see what it really means though. I will leave that for another blog post.

And if you want to validate that netcat is indeed listening on that port, you can connect to that port from another workstation by using [nmap](https://kudithipudi.org/scan-udp-ports-using-nmap/).