Questions tagged [netcat]

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

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.
186 questions
12
votes
5 answers

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 users, i.e.: You need nc on the server. Some versions…
HTTP500
  • 4,833
  • 4
  • 23
  • 31
11
votes
1 answer

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 were using a binary protocol. If possible just command line answers pls, no code snippet in any programming language.
user120858
11
votes
3 answers

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 if netcat can encrypt its traffic.
Lexicon
  • 257
  • 1
  • 2
  • 10
10
votes
5 answers

make netcat listen for multiple UDP packets

If I run a simple UDP listener like this: nc -l -u -p 1234 Then I appear to only get the first inbound UDP packet. For example if I run: $ echo abc | nc -u localhost 1234 ["abc" appears in output of server as expected] $ echo abc | nc -u…
Alex Flint
  • 234
  • 1
  • 2
  • 7
10
votes
1 answer

Netcat not able to bind a listening socket

In my computer with Ubuntu 14.04 I can do things like this: $ nc -l 5349 -vvv Listening on [0.0.0.0] (family 0, port 5349) or this: $ nc -vvv -l 192.168.254.96 5349 Listening on [192.168.254.96] (family 0, port 5349) And a socket is opened to…
logoff
  • 255
  • 1
  • 3
  • 12
9
votes
6 answers

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 -z host 22 80 443 8080 which doesn't work. I would…
KM.
  • 1,786
  • 2
  • 18
  • 31
7
votes
3 answers

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): HOSTIP="192.168.1.100" PORT="62514" nc -v -l $PORT…
runeks
  • 131
  • 1
  • 7
7
votes
2 answers

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 host. Here is the command and the error I am…
Zek
  • 568
  • 3
  • 10
  • 24
7
votes
3 answers

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 are the two commands I'm using: cat File.jpg | nc…
Vinnie
  • 71
  • 1
  • 1
  • 2
6
votes
2 answers

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 after ctrl-c het get: sent 87478272, rcvd 0 real…
Avihai Marchiano
  • 612
  • 3
  • 16
  • 32
6
votes
1 answer

Netcat - Listen for Multiple UDP Connections

I'm trying to use netcat to debug SIP calls, which communicate over UDP. Is there a way to get the same netcat instance to listen to multiple UDP Connections? I've tried connecting to the same netcat session from two different hosts and the second…
c_oreills
  • 63
  • 1
  • 3
6
votes
7 answers

How can I know if netcat & dd are working?

I'm running on server A (Source): dd bs=16M if=/dev/sda|bzip2 -c|nc serverB.example.net 19000 On server B (Destination): nc -l -p 19000|bzip2 -d|dd bs=16M of=/dev/sdb Do I need to see some progress somewhere? (Server's A /dev/sda is 50GB) I've…
soulSurfer2010
  • 307
  • 4
  • 10
6
votes
3 answers

netcat -e: the GAPING_SECURITY_HOLE

Why does the BSD version 1.10 of nc disable the -e option found in other, so-called insecure distributions when the same dangerous feature could be trivially achieved as follows even with the 'secure' version of nc: $ # Machine A $ mkfifo pipe $ nc…
Harry
  • 403
  • 1
  • 5
  • 12
6
votes
4 answers

Netcat command line issues

I am trying to collect statistics from a memcached server using netcat. ~ $nc 10.251.170.80 11211 stats STAT pid 27508 STAT uptime 7940345 STAT time 1262949310 STAT version 1.2.4 STAT pointer_size 64 STAT rusage_user 1389.962693 STAT rusage_system…
zuzur
  • 103
  • 1
  • 1
  • 5
5
votes
1 answer

How can I set the source port for an SSH command-line client?

I am creating a web challenge, and due to a firewall, I need to be able to bind an SSH client source socket to a fixed port to pass its traffic through the firewall. Is there any way to do this using maybe netcat or Ubuntu settings? Or an ssh…
jonny b
  • 55
  • 1
  • 4
1
2
3
12 13