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

0
votes
2answers
644 views

How do I send and receive simultaneously with netcat?

I need to test a TCP server by connecting with netcat as a client sending a stream from /dev/random and at the same time pipe the output to /dev/null. Receiving: nc 127.0.0.1 3000 > /dev/null ...
0
votes
3answers
980 views

How do I make netcat receive UDP packets from any host?

Is there a way to make netcat receive UDP packets from any ip:port? I don't want it to bind to a specific host as the first packet comes. I can consider alternatives, but they have to be bash ...
0
votes
1answer
1k views

netcat and tee redirection via a bash script

Quick question that has been haunting me all day.. I have a bash script that includes this line: nc -l 8044 | tee nc-output & The output from netcat is never being written to nc-output. If I ...
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.
2
votes
1answer
3k 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 ...
0
votes
0answers
1k views

Port forwarding on D-link DIR-615 router

I'm attempting to configure my router to forward a port to my Linux machine. The Linux computer has a static IP (192.168.0.185) Right now I'm just experimenting to make sure I can forward a port, so ...
0
votes
1answer
775 views

Can I use nc and/or stunnel to make a transparent SSL proxy such that I can specify the outgoing source port?

I've been playing around a bit with different variations and can't seem to find something that quite works. I want to be able to 'bridge' an SSL connection across a particular gateway node in the ...
1
vote
2answers
402 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
541 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 ...
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: ...
1
vote
1answer
227 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 ...
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 ...
0
votes
1answer
265 views

cat file that contains escaped characters to netcat

I'm trying to test a webserver with some HTTP request written in a file. GET / HTTP/1.1\r\n\r\n Right now I'm feeding that file to netcat like this: cat files | nc localhost 80 However, the \r\n ...
2
votes
1answer
183 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 ...
2
votes
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 ...
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 ...
0
votes
3answers
1k views

Using nc (netcat) to emulate NTP server response

I want to test some security on an NTP client developed in-house and would like to use netcat to do it. I have packets captured with Wireshark from previous NTP exchanges that I tried to feed to the ...
1
vote
1answer
133 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?
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 ...
2
votes
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 ...
0
votes
1answer
535 views

How to purge connections left open by SSH ProxyCommand?

I have a webserver WWW1 and a front-facing proxy PRX. I use SSH ProxyCommand to connect to WWW1's internal IP (private IP) via PRX (private+public IP). For some connections (not all) I see a network ...
7
votes
4answers
13k 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 ...
5
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 ...
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 ...
1
vote
1answer
478 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
779 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 ...
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 ...
0
votes
2answers
1k views

nc or socat: How to read data from remote:/dev/ttyACM0?

I have a device running at a remote computer on /dev/ttyACM0 Now I want to read that data on my computer. I can connect to it over ssh. Unfortunately I am a nc/socat rookie and no howto covered this. ...
6
votes
1answer
17k 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?
8
votes
2answers
12k 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. ...
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 ...