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

learn more… | top users | synonyms

3
votes
1answer
21 views

How to redirect a udp response with netcat

Similar question to How to get a udp response with netcat except the OP was satisfied with using nc interactively (and I don't have the reputation to comment yet!) I need to be able to code some bash ...
4
votes
2answers
119 views

Sending a file from Docker container to host using nc: Why does host nc close the connection too early?

The following BASH script downloads and builds mpv (https://github.com/mpv-player/mpv-build) in a Docker container, and sends the file to the host using netcat (the host is listening using netcat): ...
2
votes
1answer
90 views

netcat closes established connection between docker containers

I am on coreos and have started three containers. docker run --rm -ti -p 80 --name one ubuntu /bin/bash docker run --rm --link one:one -p $HOST_IP::80 -ti --name two ubuntu /bin/bash docker run --rm ...
1
vote
2answers
172 views

Send Text String to a Socket In Windows

I have a server that has an open socket that listens for a particular text string on it in order to perform an action. Our linux machines send this data via: echo "text_string" | nc -w 2 ...
0
votes
1answer
54 views

When copying VM filesystem over netcat, dd copies double the disk size

I'm attempting to copy the disk of a working headless virtualbox VM (VM1) on one server to a new VM (VM2) on a vCloud server. I don't have access to the host of VM2. The OS is Windows Server 2003 ...
1
vote
1answer
68 views

Netcat UDP File Transfer Between Two Servers Times Out?

I'm testing file transfer speeds between two Red Hat servers that are connected to the same switch within the data center and I decided to use netcat to eliminate protocol overhead as much as ...
-1
votes
3answers
215 views

Can't pipe echo to netcat?

I have the following command: echo 'HTTP/1.1 200 OK\r\n' | nc -l -p 8000 -c and when I curl localhost:8000 I am not seeing HTTP/1.1 200 .. being printed. I am on mac os x with netcat 0.7.1 Any ...
3
votes
1answer
296 views

Difference between /dev/udp and netcat

I have a syslog server listening on localhost:514 as UDP and would like to write messages to it on that port. (Using Ubuntu 14.04) If I run either of these commands this from bash it prints the date ...
2
votes
1answer
158 views

How to test nagios send_nsca with netcat

I am trying to write a unit test of send_nsca using nc but it is failing. I want to start nc to listen to the nsca port and then use send_ncsa to send a message to that port. In one terminal I am ...
1
vote
1answer
51 views

Why Socat is sending back the input to client?

I am using this command socat -lm -d -d TCP4-LISTEN:5555,reuseaddr,fork EXEC:/bin/myscript,chroot=/root/,su=root,pty,stderr to start a server but when i send the i connect to it through netcat and ...
0
votes
1answer
357 views

How to send 0x80 byte to a tcp port using netcat or similar tool?

I'm trying to make a Memcached server respond as if I where using binary protocol. If possible just command line answers pls, no code spinet in any programming language.
0
votes
1answer
1k views

Send echo message to graylog2 via GELF TCP 12201 port

I need to send a message to graylog2 server via echo to test if the %{@type} for facility is corrent, but once I do the echo thats in GELF support does not arrive in to my graylog2 server. If it ...
1
vote
0answers
1k views

How to execute a reverse “Powershell shell” using ncat or netcat?

I am using ncat to execute a reverse "cmd" shell from one machine to another and without any issues using the commands: In my machine: ncat -l 443 In the remote machine: ncat <my ip> ...
0
votes
0answers
108 views

Postfix mailbox_command + netcat + nodejs

I use Node.js script to process incoming emails and pipe them from Postfix via netcat in mailbox_command (namely: nc 127.0.0.1 3002). Node is listening on port 3002 and calls socket.destroy() once ...
3
votes
1answer
477 views

Apache piping log to netcat fails

I want to send my Apache log in a custom format (GELF) to a UDP receiving server (running Graylog2). I was sure everything was working fine but then after a little while, I got an alert, my server was ...
0
votes
1answer
136 views

How to query a munin plugin via netcat?

I want to query a present Munin plugin from Nagios. As I would like to do some calculations and aggregations (the plugin reports data over a period of time) and not just look at the last values, the ...
0
votes
1answer
81 views

Netcat: connection lost before transfer is complete

Interesting thing with Netcat (nc) in CentOS 5 or 6 (nc-1.84-10.fc6 or nc-1.84-22.el6.x86_64). How can I work it around? I can't find a bug about this, but It models a file transfer to a remote ...
0
votes
1answer
110 views

Why isn't nc -vv -l -n -p 8080 working?

I can't get the command working, it should listen to 8080 I am out of idea's with this, any support on this matter?
0
votes
1answer
127 views

Redirect telnet “interactivity” from host 3 to host 1 through host 2 (proxy?)

My network configuration: host 1 [h1] - User machine connected via VPN to the main host (host 2). (Win 7) host 2 [h2] - The gate through other machines of my network. No firewall, no ip rules. (Win ...
0
votes
1answer
299 views

SSH-Connection through gateway nc not working

I have the following problem: I want to connect from a Windows 7 client to a remote Debian 7 Server via an SSH Gateway running on a SLES 11.3 Server. To test the connection I use plink with the ...
0
votes
0answers
96 views

Netcat relay issues

I have a legacy database application that can be accessed via ODBC on port 3000. I have set up a simple netcat relay on a bastion host so that this ODBC access can be done via the bastion host: ...
1
vote
1answer
2k views

Netcat issue, getaddrinfo: Name or service not known

I am trying to use netcat to relay SSH traffic (bidirectionally) from port 2222 on one host to port 22 on a different host. For test purposes, I redirect to 127.0.0.1:22 here instead of the remote ...
2
votes
1answer
972 views

Automatically close netcat connection

I am executing the following command from a script: echo '{"hostUp": true}' | sudo /usr/local/bin/netcat localhost 8001 However, the netcat client stays open indefinitely. How can I close the ...
2
votes
1answer
2k views

How can I configure netcat (or some other stock linux utility) to listen on a specific port on a secondary IP address?

CentOS 5.9 For testing purposes, I want my CentOS server to listen on a secondary virtual IP (eth0:0). I'm familiar with nc -l -p <port> but it only listens on the primary. Is there a way I ...
1
vote
1answer
75 views

Resend the same file simultaneously with netcat in listening mode

I want to set up netcat in listening mode so that many clients can connect and they all receive the same file. The clients should be able to connect simultaneously... Is this possible?
5
votes
1answer
1k views

nc (netcat) hangs, waiting for more data, in UDP mode.

I'm trying to send a small string to statsd via nc inside of a read block: while read line; do printf "folder.counter:value|1c" | nc -q 0 -u $host $port done Unfortunately, when in UDP mode, nc ...
1
vote
1answer
372 views

How do telnet-based programs report their terminal type to a socket server?

I've written a script called by tcpserver that heavily utilizes tput and similar commands. These commands need to know how to correctly write to the terminal and rely on the TERM variable to obtain ...
0
votes
2answers
305 views

Netcat output pipe, json parsing

What I want is this: netcat to the server, which streams json formatted loglines. pipe the output of nc to "something" that will format the json as plaintext, in a customizable format (thinking ...
0
votes
1answer
159 views

netcat and file transfer

How do I actualy use netcat to transfer files over network? IIRC something like that nc -l -p 12345 > destfile(on the receiving end) + dd if=/dev/sourcedevice| nc ipaddress 12345(on the sending ...
0
votes
2answers
270 views

Using rsyslogd on only 1 of 2 systems

I have two systems. One is a laptop and has rsyslog. The other is embedded system that doesn't have rsyslog. What I'd like to do is log messages from the embedded system on the laptop. I've ...
3
votes
3answers
920 views

Can Netcat talk to an encrypted port?

I am doing some trouble shooting on an application that listens on tcp 443. This particular application talks via SSL. I wanted to connect to it with netcat. Is this possible? Note: I'm not asking ...
4
votes
1answer
3k views

Proxy with netcat forever

I am proxying a VNC TCP server port with netcat. The proxy machine runs linux. This is the comand I use: mkfifo backpipe nc -l 5902 0<backpipe | nc 10.1.1.116 5902 1>backpipe 10.1.1.116 is ...
1
vote
1answer
197 views

netcat doesn't transfer complete file when using UDP

I use the following in order to transfer bigfile (11GB): cat bigfile | pv -L 11m | nc -u 10.0.0.1 3333 After 1.6GB the client stop to transfer (in the target machine i dont see packets ) This is ...
1
vote
2answers
2k views

How can I see sent/received data by netcat?

I follow this post to check speed with netcat , but in his blog when he do ctrl-c ,he get data on sent received bytes. In the post he ran : time yes|nc -v -v -n 192.168.0.8 2222 >/dev/null than ...
1
vote
2answers
743 views

Using nc.exe (NetCat) to send emails to secured SMTP server (TLS)

I used to send emails to unsecured SMTP servers using nc.exe utility (Windows port of NetCat) and now I need to send the same emails to a secured SMTP server (TLS). What additional parameters do I ...
0
votes
1answer
504 views

Banner Grabbing DNS? [closed]

How does one banner grab DNS? I'm able to banner grab other services such as HTTP/FTP/SMTP but for DNS it's not immediately obvious. Typically for HTTP I use nc with HEAD / HTTP/1.1 {ENTER}{ENTER}. ...
0
votes
1answer
444 views

Chrome rejecting connections to netcat webserver

I have a very simple netcat webserver set up to display the /etc/motd file for some machines, which works fine in Firefox, but intermittently fails in Chrome. I suspect it's an HTTP header / caching ...
3
votes
1answer
2k views

What is the purpose of netcat's “-w timeout” option when ssh tunneling?

I am in the exact same situation as the person who posted another question, I am trying to tunnel ssh connections through a gateway server instead of having to ssh into the gateway and manually ssh ...
2
votes
2answers
307 views

How do I log tls-encrypted smtp traffic?

I'd like to know what my local postfix says to the Amazon SES smtpd after the STARTTLS. In plain text, so I can understand it. Amazon SES requires TLS, so I can't temporarily turn it off. I currently ...
2
votes
2answers
2k views

Examining Multiple Ports When Running NetCat (nc)

I am looking to test if specific ports are on a host are open. I am using: nc -z host 22 nc -z host 80 nc -z host 443 nc -z host 8080 which works, but it would be nice to use a one-liner like: nc ...
2
votes
1answer
629 views

Netconsole not working

I've gotten netconsole setup on a server that's been having a variety of kernel panics lately and I'm trying to log kernel messages to another server. I've tested netconsole after setting it up on the ...
0
votes
1answer
1k views

How do I make ncat not send a line-feed?

I'm on Windows 7 Powershell and have ncat from http://nmap.org/ncat/ I'm trying to send "foo" to some network device PS> ncat -u 192.168.1.255 6061 foo but it sends "foo\n" (66 6f 6f 0a) and ...
6
votes
5answers
11k views

Netcat (nc) traditional package for RHEL 6.x?

I'm trying to use the Percona Apache Monitoring [Cacti] Template for Memcached. They do indeed warn that you can't use the openbsd version of the package and provide a solution for Ubuntu/Debian ...
2
votes
2answers
3k views

Netcat UDP File Transfer?

Is there any way to send a file (picture or video) using Netcat and UDP. It defaults as TCP, but I would like to send using UDP. I tried simply adding -u to the nc command, but that didn't work. Here ...
0
votes
2answers
535 views

How do you redirect (one way only) udp packets to another host using netcat?

How do you redirect (one way only) udp packets to another host using netcat? nc -l -u 0.0.0.0 12345 | nc -u 192.168.1.128 12345 stops after successfully redirecting the first packet. (Note: an ...
1
vote
3answers
352 views

What is Juniper's equivalent to netcat/nc command?

On Linux there is a nice tool for testing connections, bandwidth, opening temp. connections etc: nc What is equivalent on Juniper firewalls?
2
votes
1answer
242 views

quick check of open port

The following is working as expected. (do not want to use nmap) I need to use nc (or any other built-in centOS) command in shell script to check the port 6379 of a remote server. I want the script to ...
4
votes
5answers
6k views

echo server with netcat or socat

I want a UDP echo server to get packets, and reply exactly what it has received. How can I simply do this using netcat or socat? It should stay alive forever and handle packets coming from several ...
0
votes
1answer
194 views

Communication problems on secondary interface tap0

I am using UDP over ipv6 as communication stack. I have network client running on secondary virtual interface tap0. It generates messages for server which is supposed to run on the same interface but ...
1
vote
3answers
1k views

Automate hop by hop telnet to Cisco router

I need to automate telnet to a Cisco router and get a "show version" result. The problem is, I need to first to telnet to A, from there telnet to B and then only be able to telnet to the Cisco router. ...