Netcat is a simple but powerful utility program that reads and writes data across network connections, using TCP or UDP protocol, IPv4 or IPv6, with a variety of functions.

learn more… | top users | synonyms

13
votes
6answers
611 views

How can I verify that a 1TB file transferred correctly?

I frequently transfer VM images from hypervisors to an archive server for long term storage. I transfer using netcat since it is faster than scp, rsync, ect.. hypervisor$ cat foo.box | nc ...
9
votes
1answer
7k views

Can the Telnet/Netcat client communicate over SSL?

I would like to test client connections with IMAP over SSL, HTTPS, and other secure text-based Internet protocols over SSL/TLS, the same way I would using Telnet or Netcat if they were not tunneled ...
8
votes
2answers
11k views

Sending file via netcat

I'm using something like this to send file from one computer to another: To serve file (on computer A): cat something.zip | nc -l -p 1234 To receive file (on computer B): netcat server.ip.here. ...
6
votes
4answers
12k views

How can I pipe commands to a netcat that will stay alive?

echo command | netcat host port This results in the command being sent to the remote host and some data being read back. But after a few seconds, the connection closes. The -w parameter did not ...
6
votes
1answer
16k views

Netcat on Mac OS X

Is anybody else not able to get nc -lp 8888 working on Mac OS X? Is there another way to get this to work?
6
votes
1answer
2k views

How can I force netcat to send my input immediately, not just on newlines?

How can I force netcat to send my input immediately, not just on newlines? I want to test an HTTP parser manually and check how it behaves when header lines are spread across multiple packets.
6
votes
1answer
2k views

versions of netcat

I've tried the two main versions of netcat : GNU and BSD. (mine is BSD Version). On GNU version, the command $ nc -l -p 12345 works fine but with BSD, option -l (listen) can't be used in conjonction ...
4
votes
3answers
5k views

netcat as a multithread server

I use netcat to run a simple server like this: while true; do nc -l -p 2468 -e ./my_exe; done This way, anyone is able to connect to my host on port 2468 and talk with "my_exe". Unfortunately, if ...
4
votes
1answer
3k views

Why is “nc -l xxxx” not opening a port?

I'm trying to get netcat to listen on port 4444, but it doesn't seem to be working. I am checking to see if the port is open using nmap, but it doesn't pick it up and I can't figure out why. I have ...
4
votes
2answers
5k views

Netcat stops listening for UDP traffic

I am using netcat on some Linux machines (see this other question), but seeing some unexpected behavior. Unlike the guide in the accepted answer, I am not using UDP tunneling to do DNS queries. I ...
2
votes
1answer
3k views

Terminal command to send data (plain text string) to a port at a remote computer

I am trying to send data (plain text string) to a port at a remote computer using terminal utility. The string would be used to trigger something on the remote computer running a program that would ...
2
votes
1answer
5k views

Linux built-in or open source program to join multicast group?

I'm using tcpdump to capture multicast packets and had to code up a custom program to join multicast feeds so tcpdump will "see" the packets. Just wondering if netcat or any other applications can ...
2
votes
1answer
447 views

How to pipe the output of a linux command back into the predecesssing command

The linux command nc -l 8090 | (read METHOD URI PROTOCOL ; echo "method: $METHOD" ; echo "path: $URI" ; echo "prot: $PROTOCOL") listens to port 8090 and when I type something like ...
2
votes
1answer
619 views

Unix bidirectional pipe on commandline

I've been able to use this linux command to connect Netcat to a serial port: nc -l 80 <> /dev/ttyS0 I would like to be able to log this transaction. My backup plan is to use Wireshark to ...
2
votes
3answers
179 views

Use xargs to send requests to the same server in parallel with netcat

I am trying to devise a one-liner to send text to a simple echo server - but multiple connections in parallel. This is what I'm trying: echo -e A,B,C,D | xargs -d, -i -P 4 echo {} | nc localhost ...
2
votes
1answer
151 views

ncat only works in certain scenarios

I tried using ncat (a “much-improved reimplementation of netcat”) to chat with a friend (and ultimately want to send a large file, but I know I can get that working once I get chat to work). We both ...
2
votes
1answer
2k views

Sending text file contents to server using netcat?

There is a daemon process listening on port 5144, which I cannot to modify. I want to use netcat to send the contents of a text file to the server, but this causes netcat to hang the terminal until I ...
2
votes
1answer
2k views

How to get the WAN IP from a router using UPnP/SSDP

I'm trying to find a way to get my router to report back my WAN IP using UPnP/SSDP, but so far I have been unable to even get a list of UPnP supporting internet access devices on my network. Here's ...
2
votes
1answer
2k views

bidirectional socat functionality with nc

This is question is somehow related to How is it called when listening(connecting) two sockets and exchanging data between them? In the test setup I have three terminal windows open I run in Term1: ...
2
votes
0answers
37 views

DNS tunneling through an SSH connection looses connectivity

In the article 'UDP traffic through SSH tunnel', it is described how to tunnel DNS trough a SSH tunnel: client# ssh -N -L 6667:localhost:6667 user@server server# mkfifo /tmp/fifo server# nc -k -l ...
2
votes
2answers
932 views

Use netcat as a proxy to log traffic

I want to use netcat as a proxy to log http requests and responses to files, then tail these to inspect traffic. Think wireshark. Tried the following where 'fifo' is a named pipe, 'in' and 'out' are ...
2
votes
1answer
182 views

Monitoring incoming requests on a web hosting server

I have a web hosting account with GoDaddy (its a Linux based hosting). Can I install applications like netcat to monitor all incoming requests to my website on a certain port? If not, is there any ...
1
vote
3answers
107 views

Quick way to scan for opened ports on local network according to a list

How can I quickly find out whether port 80 is open/listening on a server via a bash script? Normally on all workstations the daemon is running, but sometimes it fails. I use the following command to ...
1
vote
1answer
3k views

Can I pipe/redirect a console application through netcat so it can be used remotely?

Is it possible to 'pipe' an instance of a console application through netcat, so netcat is listening for a new connection and redirects the stdin and stdout over the network connection.
1
vote
2answers
942 views

How to download a URL from internet by netcat?

I can use netcat to transfer files between two computers. # Server nc -l -p 8080 < file # client nc 192.168.1.101 8080 > file Can I use netcat to download a URL from Internet like wget?
1
vote
2answers
6k views

Netcat/socat behavior with piping and UDP?

I guess this is close to linux - Netcat stops listening for UDP traffic - Super User, but I thought I'd better ask anyways As far as versions of netcat I'm using Ubuntu 11.04 and the default netcat ...
1
vote
1answer
354 views

Listen to port continuously and dump data to file

I use this command to listen to port and dump data to file: while : ; do nc -l 0.0.0.0 10000 > log.txt & done First request works perfect, it's dumped in log.txt but after first request, ...
1
vote
2answers
362 views

Why can't nc / netcat sniff http port traffic easily?

I'm NOT looking for advice such as "try wireshark." I'm trying to understand what netcat is and isn't. When I try to listen (-l) to port 80, it says "address already in use." Can netcat not listen to ...
1
vote
2answers
392 views

How to set up a secure chat using netcat

I use netcat to chat in LAN. PC1 listen port 8080 $ nc -l -p 8080 PC2 connect to PC1:8080 $ nc 192.168.10.1 8080 Unfortunately, this is not secure. Anyone sniffing packets can intercept my ...
1
vote
1answer
139 views

Saving Live Video received through Netcat

I'm using the following command to stream a video which I receive through Netcat. nc -l -p 5001 | mplayer -fps 31 -cache 1024 - (On Windows CMD) This command opens the MPlayer and plays the live ...
1
vote
1answer
221 views

X11Forwarding using SSH and Netcat

From my machine, I must connect through nodes A, B, and C, to reach target: localhost -> A -> B -> C -> target Machine A is configured to refuse X11 Forwarding, so I guess I shouldn't ...
1
vote
1answer
64 views

DDNS and NetCat

I'm messing around with netcat(windows) and i'm trying to configure netcat listening to external connections.My ISP provides me dynamic IP so i gotta find a way to have netcat connecting back to me no ...
1
vote
1answer
137 views

Netcat stops when in a detached session

I want to use netcat to dump a number of blocks of strings to a file. I've been running this in my linux terminal and everything works very well until I try to detach my command line. If I run my ...
1
vote
2answers
282 views

Nested Redirection in BASH

I have a scenario where I want to filter log files. To do this I am wanting to follow the last 10 lines or so of a log file and as new lines are read in, pipe them through an awk program and then ...
1
vote
1answer
223 views

Can I use dd to clone two drives from two machines simultaneously?

To clarify, I have two machines: Machine1 and Machine2. Each machine has 2 disks (Machine1 has Disk1-1 and Disk1-2; simiarly, Machine2 has Disk2-1 and Disk2-2). Can I use 'dd' to clone Disk1-1 to ...
1
vote
1answer
1k views

Netcat file transfer problem

I have two custom scripts I just wrote to facilitate transferring files between my VPS and my home server. They are both written in bash (short & sweet): To send: #!/bin/bash SENDFILE=$1 PORT=$2 ...
1
vote
1answer
276 views

How to wait for a response on the inbound side of the socket using NC command under BusyBox?

I am having problems using the Netcat that comes with BusyBox 1.1.3 to make an HTTP request and then receive the response. The NC command seems to quit out as soon as it reaches the end of the request ...
1
vote
0answers
66 views

Create duplex TCP tunnel in Windows with netcat

I need to create a TCP tunnel in Windows, I tried by chaining netcat: ncat -l 3333 | ncat 192.168.0.110 4015 This creates a single direction tunnel, though, as only the first netcat's STDOUT ...
1
vote
0answers
85 views

nc connection refused even on loopback

I'm working on an embedded linux system, which appears to be networked correctly and is running ssh (dropbear) and rpcbind. I'm setting up a server application on it, and every single thing I try ...
1
vote
1answer
130 views

Netcat connection over dynamic IP

I was playing around with netcat on my lan , had PC1 configured as a netcat client and PC2 configured as a netcat server into a reverse netcat TCP connection.This whole reverse TCP connection works ...
1
vote
2answers
283 views

netcat output into separate files using string delimiters

I want netcat to pipe the output of a tcp/ip connection to commands that examine the output and split it into distinct files separated by the strings "msg" and "/msg" from the output, something like ...
1
vote
0answers
1k views

how to bypass this error : “port range not valid”?

I have a port number that I want to connect to it via net-cat. previously I was working with windows and it was working perfect; but now in Ubuntu when I want to run the Net-Cat it's show me this ...
1
vote
1answer
71 views

Two hop SSH with multiple user names

I am trying to set up an ssh proxycommand, where the user name at the final host is different from the user name at the original host. I am logged in on firstHost as username and want to effectively ...
1
vote
1answer
600 views

Cygwin netcat nc doesn't resolve hosts through /etc/hosts

I'm trying to use ssh to log into remote servers, and I have a ProxyCommand setup in ~/.ssh/config to use a proxy (setup through PuTTY to connect to a VPN). The ProxyCommand uses nc to connect ...
1
vote
1answer
529 views

Can I stop a netcat tar pipe and continue later without overriding existing files?

I'm trying to copy a lot of files from my NAS to my server, about 2TB. I found that using a netcat tar pipe to copy the directories goes pretty fast, about 40mb/s. It seems to work faster than rsync ...
1
vote
1answer
131 views

How to upload a file to windows through a netcat session

I have a netcat session and I want to upload a binary to the target windows machine. How can I do so? Is there a native "wget" in windows?
1
vote
1answer
2k views

Unix : `nc` on Ubuntu vs Redhat (netcat)

nc -q -1 local host ${PORT} ${CMD} In Ubuntu, nc may be used as above, with the -q option. See manpage. -q after EOF on stdin, wait the specified number of seconds and then quit. If ...
1
vote
1answer
477 views

Simple secured SFTP tunnel?

I'd like to setup an sftp tunnel so that I can connect to an IP-secured SFTP server through a gateway computer from anywhere, and download the files to anywhere. I was thinking of using a combination ...
1
vote
1answer
773 views

Bash RTSP client with netcat - keep connection open while parsing sent data with sed?

I am trying to make a RTSP client in bash. Problem is that I must make only one connection to the server through which it will send video frames. I can keep it on one connection up to the point at ...
0
votes
3answers
659 views

How to make netcat support ssl by combining openssl?

Original netcat doesn't support ssl. ncat from nmap project does. In linux, we can connect multiple commands with pipeline. Is it possible to combine netcat and openssl to create a ncat?