nothing is impossible!!!!

nothing is impossible!!!!

Thursday, August 7, 2008

What is Netcat?

Netcat is a featured networking utility which reads and writes data across network connections, using the TCP/IP protocol.

It is designed to be a reliable "back-end" tool that can be used directly or easily driven by other programs and scripts. At the same time, it is a feature-rich network debugging and exploration tool, since it can create almost any kind of connection you would need and has several interesting built-in capabilities.

It provides access to the following main features: 
- Outbound and inbound connections, TCP or UDP, to or from any ports. 
- Featured tunneling mode which allows also special tunneling such as UDP to TCP, with the possibility of specifying all network parameters (source port/interface, listening port/interface, and the remote host allowed to connect to the tunnel. 
- Built-in port-scanning capabilities, with randomizer. 
- Advanced usage options, such as buffered send-mode (one line every N seconds), and hexdump (to stderr or to a specified file) of trasmitted and received data. 
- Optional RFC854 telnet codes parser and responder.

Some of the potential uses of netcat: 
Script backends
Scanning ports and inventorying services
Backup handlers
File transfers
Server testing and simulation
Firewall testing
Proxy gatewaying
Network performance testing
Address spoofing tests
Protecting X servers

Transferring files using netcat:
When we want to send a file from a host to another with netcat, it is quite simple. We set up the receiving host to listen on a specific port and put all the data received into a file. We need to set a timeout so the listener notices when there is no more data coming and it can close gracefully. 

-l = listens for incoming connections 
-p = what port to listen on 
-v = verbosity level, use twice for more information 
-w = timeout 
-n = dont resolve IPs 

On the senders end we simply connect to the receivers listening port and give the file as input. The filetransfer goes smoothly as long as you remember to initiate the sending before the timeout. 

Listener: nc -vvn -l -p 3000 -w 3 > file 

Sender: nc -vvn xxx.xxx.xxx.xx 3000 <>

Netcat Commands

Netcat also know as the swiss army knife of network tools, provides a plethora of functions that can be used for good as well as motives that are negative.

No comments: