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, you configured your firewall to allow TCP 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 distros. You can download the windows port of the tool at http://www.securityfocus.com/tools/139
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
[code]nc -L -p 80[/code]
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.
nc -l -p 8000 also works for me on Windows 7. It was the missing p switch which caused “local listen fuxored: INVAL” message for me.
Thx for sharing this information Sam.
Thanks, i was looking for it
reklama bielsko
nc -l -p 8000
… does not work for me on my Windows 7 Enterprise version. Is there a workaround ?
Thanks
J
John – You have to open the command prompt by using “Run as administrator”. Let me know if that fixes the issue.
I would like to download rcat, where is the link? please help [email protected]
Aby – I don’t think there is a windows binary for rcat. Do you have any details about this tool?
local listen fuxored: INVAL might means you’re already got something bound into the port. Check with netstat -ano | find “:8000” (last column is the pid binding the socket)
You say that you’ve already got something bound into the port with this error. But I’m trying to connect on that port’s protocol right, so shouldn’t I get in? Unless it’s blocked? Or are you saying there are two protocols set up on one port?
Jonathan – The port usage is irrespective of the protocol.
– V
i try to down load above link but its shows error message ,how can i down load link please guide me any one
Bharani – you can get a version from this link.
https://eternallybored.org/misc/netcat/
Good luck.
Is it possible to run netcat command silently ?
Madav – What do you mean by silently?
I have an error ‘Can’t grab 0.0.0.0.80 with bind’.
How can it be resolved in windows 10?
Hello, How to send contents of a text file to IP address using a batch script/Netcat.
example:
//C:\Users\Desktop\test.txt —> IP: 192.168.xx.xx port 65000
thanks in Advance
Henn
Thanks for the help