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

1
vote
2answers
515 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 ...
18
votes
4answers
13k 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 ...
3
votes
1answer
2k views

Differences in nc (netcat) options on Ubuntu vs RedHat

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 seconds is ...
1
vote
1answer
34 views

how to make a batch file close automatically

I have a .bat file which its content is like this: @echo off nc x.x.x.x 23 < commands.txt exit in which nc is a .exe file in the same directory nc.exe known as NetCat. The commands.txt file ...
2
votes
1answer
48 views

Probing a port for RDP

I use an ssh tunnel to RDP into my home computer ("home"). Occasionally, the tunneling software running on home crashes and the RDP port stops getting tunneled. I've attempted to resolve this by ...
0
votes
0answers
19 views

Creating a proxy with netcat

I'm trying to setup a permanent proxy server for one of my servers to reroute connections having issues. The proxy server is running Centos 7 x86 User -UDP or TCP-> Proxy -> Server I am am ...
1
vote
1answer
666 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 ...
0
votes
1answer
65 views

automatically start netcat on localhost and remote-host and keep it active

I found this answer by @jeremytrimble on Stack Overflow which explains how you can read a FIFO file over network. I wonder if it’s possible to start these netcat commands automatically, e.g. in a ...
1
vote
1answer
23 views

Using netcat to connect to znc

I'm trying to send status updates to my IRC channel on irc.foo.com My limitations are.. The msg has to be sent to irc.foo.com from my ZNC account on znc.bar.com (znc is connected to irc.foo.com) ...
0
votes
1answer
34 views

Bash - Parsing XML output of nmap

I am trying to write a bash script that will take port id I retrieve from an nmap command, and then use those ports to send a file using netcat. So I got some basic knowledge using this link, How can ...
9
votes
4answers
14k 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. ...
0
votes
0answers
27 views

Give a command HTTP proxy auth access

I'd like to let a command (wsimport) access a URL through an HTTP proxy with authentication. It can be configured to use a proxy, but not with auth. I was wondering if a tool such as netcat, or any ...
0
votes
0answers
23 views

How to connect two debian VMs using vmware workstation so that one acts as a web server and the other as web client

I want to connect two virtual machines running using VMWare workstations - Debian Linux and I have setup private DNS server on one VM named "Server" and other VM is named "client". I am trying to ...
9
votes
1answer
3k 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.
0
votes
0answers
17 views

How to send OUTGOING to 1 netcat connection whilst reading INCOMING in a while loop?

I'm currently using netcat to grab the incoming lines of data with following: nc 192.168.1.1 1234 | while read line; do echo $line done I need to send outgoing data to the same connection, ...
0
votes
0answers
23 views

SImple server to run program and return result

I am attempting to create a minimal local listen server that takes an input request, pipes the input to a program and then returns the result of the command. What I have at the moment is the program ...
0
votes
1answer
20 views

OS X LoginHook - nc exits prematurely for no apparent reason

I'm trying to use loginhook to download large amounts of data and I've been having problems which I've nailed down to nc exiting prematurely for no apparent reason. This is a simplified test script: ...
1
vote
2answers
269 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 ...
2
votes
3answers
1k 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 ...
0
votes
0answers
40 views

Port bridge with iptables

is there a way to achieve the same thing than bidirectional socat functionality with nc mkfifo backpipe nc localhost 42042 0<backpipe | nc localhost 1042 1>backpipe But only by using iptables ...
0
votes
0answers
38 views

Netcat doesn't detect open port with ngrok

I'm using ngrok 5002 to open up a port on my computer. I then do netcat -z xxx.xxx.xx.xxx 1-65000 with xxx.xxx.xx.xxx being my external ip I found via some web service. However, I expected ...
0
votes
0answers
79 views

Netcat redirect remote console application

I have a windows interactive command line application ('pianobar', Pandora client) that I'm running on a Win2k8 server that I would like to control remotely, possibly using netcat. I need to be able ...
4
votes
1answer
5k 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 ...
2
votes
0answers
13 views

Using DJB's tcpclient or tcpcat bidirectionally

Can someone post an example on how to use DJB's tcpclient bidirectionally? We need to read from Tor's ControlPort as well as write to Tor's ControlPort. A "file" that is open for both, reading and ...
4
votes
2answers
4k 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 ...
7
votes
1answer
336 views

Multiple unix pipes not working

This first pipeline works fine (printing "c"): echo "a" | sed 's/a/b/' | sed 's/b/c/' This one does not do what I expect (nothing gets printed when I feed an "a" into my fifo ): mkfifo fifo; cat ...
0
votes
1answer
1k views

Netcat error: Can't grab 0.0.0.0:80 with bind

When I tried to listen on port 80 in Windows 7 with netcat, I get this error: C:\Users\sashoalm>echo "hello, world" | netcat.exe -l -p 80 Can't grab 0.0.0.0:80 with bind On the other hand, ...
-3
votes
1answer
50 views

Quickest way to upload to a server?

I am looking for a way to upload a large file (1gb) to a server. So far I have used scp, nc and sftp. Initially I start with a nice upload speed of around 2 mbps, but this quickly slows down to around ...
0
votes
1answer
252 views

How to send message both to netcat and other script?

I'm trying to make some client-server interface. Think of it as one-on-one chat. What I want to achieve are two horizontal views. Bottom for my (server) input, top for client output and my input. ...
8
votes
4answers
18k 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 ...
3
votes
0answers
88 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 ...
0
votes
1answer
530 views

Unable to transmit stream through OpenVPN tunnel

We are trying to transmit a video-stream via netcat from a OpenVPN server to a client. The server is a Raspberry Pi with Pidora running on it. The client is a Notebook with Ubuntu 12.04 and has a ...
4
votes
2answers
6k 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 ...
1
vote
3answers
206 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
2k 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
1answer
391 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 ...
13
votes
6answers
2k 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 ...
1
vote
1answer
781 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
1answer
136 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?
0
votes
1answer
279 views

Why is Udcast is many times faster than Netcat?

I use Netcat once in a while to copy files or disk images over the network. While it does the job I always felt like it was always on the slow sluggy side regardless of using ssh, no ssh, compression ...
0
votes
2answers
1k views

Why is the '-e' option missing from netcat-openbsd?

Why is the -e option missing from the netcat-openbsd package? There is a netcat-traditional package but it has many features from the OpenBSD package missing. I am running Linux Mint 16. Does anyone ...
1
vote
0answers
117 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 ...
0
votes
1answer
232 views

Netcat: Should I use Ctrl+C to close the connection?

I've opened netcat, and I'm entering things from the keyboard. When I've finished and I want to close the connection, should I just hit "Ctrl+C"? I want the connection to be closed "normally", but I ...
0
votes
0answers
194 views

netcat command is not working in bidirectional mode

I am using netcat in Linux to send and receive data (using udp protocol) from a serial port to another device through the network. The command is : nc -u 192.168.10.12 < /dev/ttyUSB0 > ...
1
vote
2answers
608 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 ...
0
votes
1answer
52 views

Is it possible to set up my own DNS for my computer?

I don't know if I ask the right question but I hope this situation would give you the whole picture. I have my PC which located at my apartment. As usual, I get access to Internet using service ...
1
vote
0answers
171 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 ...
5
votes
3answers
7k 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 ...
0
votes
1answer
236 views

Keep Process Running after Quitting NetCat

I am using NetCat on Windows 7 Professional to connect to my linux machine at home. I need to run a process and make it keep running after I close NetCat (Cmd Console). However when I close and then ...
1
vote
1answer
431 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 ...