Netcat is a computer networking service for reading from and writing network connections using TCP or UDP

learn more… | top users | synonyms

1
vote
1answer
45 views

Need help using Netcat

I have a file on my server that has HL7 messages spread out by a space. Example below. I am wanting to send one of these messages at a time in a continual loop until stopping the script with ctrl+c. I ...
0
votes
1answer
25 views

Can you force netcat to succeed only if all ports in port range succeed?

I use nc as part of a verification script, and check the output of each nc command listed against what the expected output should be. e.g., nc -zvw1 serv1.host.com 443 | gawk '{print $7}' Expected ...
2
votes
1answer
56 views

Jumping ssh hosts without netcat

I have access to an intermediate server to which I can connect with ssh. From there I can connect to other servers: A→B→C, where A is my laptop, B is an intermediate server accepting connections from ...
0
votes
0answers
44 views

Using Ubuntu as a SOCKS Proxy for Torrents - How to allow UDP for trackers?

This is my build: 14.04 LTS (GNU/Linux 2.6.32-042stab094.7 x86_64). I'm a complete noob at linux but have some experience in bind and ISC DCHP on some old solaris boxes (to define the audience!). I ...
8
votes
4answers
1k views

Simplest way to send files over network

What is the simplest and most versatile way to send files over the network to other computers? By that I mean computers that other people are using at the moment. I don't think SSH works if the ...
0
votes
0answers
43 views

command line tool group chat utility under linux

I am working on mac osx Yosemite. I want to reach to a user under a certain IP address. (It might be local network or thru internet). I want to do it thru terminal using the default tools that ...
1
vote
2answers
149 views

nc command's -k option

man page of the nc command has following information -k Forces nc to stay listening for another connection after its current connection is completed. It is an error to use ...
1
vote
1answer
82 views

Write output from netcat to a file

I'm currently trying to write a scan port result to a text file Here is the command I tried to use: nc -vv -z localhost 1-80 > file.txt This doesn't work (that is, the error messages from nc ...
0
votes
0answers
40 views

netcat doesn't terminate when stdin closes

I'm trying to send a message through netcat. After sending the message, netcat must terminate. I've tried the following: cat tsmmessage.bin | nc -u localhost 4300 nc -u localhost 4300 < ...
1
vote
0answers
106 views

'nc' using ~100% CPU when transferring a FIFO file

On the server which is always connected I’m using this in a crontab: @reboot nc -k -l 1337 < /tmp/fifo.fifo On the client which is not always on the network or switched on I’m using this ...
0
votes
2answers
45 views

Is there a netcat like utility that uses unix sockets?

netcat is wonderful, let me count the ways -- is to much let me sum up -- tcp/ip4, udp/ip4, tcp/ip6, udp/ip6, but what I need is stream/unix. I could write it in half a day, but If someone has already ...
0
votes
1answer
81 views

Saving from arecord on a raspberry pi across a network to a mac

I've currently got a usb mic plugged into a Raspberry Pi B+ and am using the following code to record data: arecord --buffer-time=5000000 -D plughw:1,0 -f cd -t raw | lame -r - stream.mp3 I then ...
-1
votes
1answer
30 views

Can this be done in a one-liner? [duplicate]

Is there a way to do these two lines of code in one line? nc -l 17500 > listenToNetcat.txt chmod 754 listenToNetcat.txt
0
votes
0answers
158 views

/usr/bin/ld: cannot find -lc when compiling netcat

I'm trying to compile external-netcat (first for my system, then I'll try for an external embedded device, hence the 'external-netcat') When trying to compile it for my desktop, by running make ...
1
vote
0answers
47 views

Pipe a device via USB or wlan

I have an Android phone and I want to use some of its onboard device from PC. To be more clear, there is a node in /dev/ and I want to have on PC a file (or named pipe which is accessable as a file) ...
1
vote
1answer
58 views

What does the %h and %p do in this command?

$ ssh -o User=fred -o ProxyCommand="nc -X 5 -x localhost:9150 %h %p" server.example.org It's from http://en.wikibooks.org/wiki/OpenSSH/Cookbook/Proxies_and_Jump_Hosts I can't find any comments about ...
1
vote
1answer
62 views

NetCat never ending http session

I'm trying to use netcat to server some bash command results via a web interface, that stays running. The page is dynamic and needs to be updated upon loading. Just an example with what I'm using: ...
6
votes
4answers
443 views

How to grep netcat output

I'm trying to grep live text stream from netcat, but it doesn't work for me: netcat localhost 9090 | grep sender returns nothing, but I'm sure that it should. If I redirect the netcat output to a ...
3
votes
0answers
128 views

Remote Mouse netcat (/dev/input/mice)

I was playing around with nc and I'm discovering how powerful and versatile this tool is. I was wondering how the file /dev/input/mice works because when I do cat /dev/input/mice you see the output, ...
1
vote
2answers
42 views

Using netcat to launch a program? [duplicate]

Assume I let netcat listen on some port on PC1 (IP:10.0.0.1) with: PC1:~$ nc -l 9999 I connect from PC2 (IP:10.0.0.2) and send some strings: PC2:~$ nc 10.0.0.1 9999 hello touchit test ...
1
vote
2answers
70 views

Capturing data from a Fluke 1620a via netcat

I am trying to pull temperature and humidity data from Fluke DewK 1620a thermo-hygrometers and write the temp/humidity readings to a log. I can connect to the device via netcat with a simple 'nc ...
0
votes
2answers
700 views

How can I use netcat (nc) for chat client server model?

enter code hereI am trying to write a daemon using bash. I will enter my partners IP address and the connection will start using nc partner_ip 2015, likewise on the server I will start the connection ...
0
votes
2answers
28 views

net cat client and server model

I tried to make server client model as below on one shell nc -l -p 8080 this works as a server and on another nc 127.0.0.1 8080 and this works as a client all of this is fine ... the ...
0
votes
1answer
28 views

Getting filetype of netcat output?

How can I use the file command on an output from netcat? For example: nc 192.168.1.1 1234 dGhpcyBpcyBhIHNhbXBsZSBzdHJpbmc= dGhpcyBpcyBhIHNhbXBsZSBzdHJpbmc= being the output, (sample base64 for ...
2
votes
2answers
67 views

How to write to a file with netcat? And set it to grow to a certain size and begin overwriting itself?

I'm currently writing a program that prints to a Zebra printer. Because my office doesn't have a zebra printer, we print to a linux VM running netcat with nc -k -l -p 9100 | tee labels.txt so that we ...
3
votes
3answers
3k views

Test if telnet port is active within a shell script

I am trying to create a script to test whether it is possible to login via telnet. I do not want to really log in; therefore, expect is not needed. I just want to see if I am able to get a login ...
1
vote
1answer
196 views

tcpdump and nc with udp

I don't understand the behaviour of netcat. Let's say that I have one host acting as server: [root@localhost tmp]# nc -u -l -p 670 Then I try to connect from a client: root@debian:/tmp# nc -u ...
1
vote
3answers
715 views

How can I pipe data over network or serial to the display of another linux machine?

I have a second monitor that I'd like to use for a text-based debugging log and/or console. I don't want to have it as part of my GUI / "desktop" / main system. I have this display connected to an ...
1
vote
2answers
148 views

netcat to capture ethernet

How can I make sure the result of the following command: nc eth0 &> capture.txt would capture the data + errors transmitted via eth0?
1
vote
3answers
337 views

nc not waiting for server disconnect on OS X

How to make nc client on OS X Mavericks keep socket open and read data until server disconnects the socket? I want to send data to a server through nc and then use the response. Problem is that nc ...
1
vote
0answers
38 views

How to make netcat print colourful text?

on my Mac I have an peripheral that sends text data to localhost:2332. Some of them are coloured, like this: "\e[1;31mRed text here\e[m normal text here", I use nc loacal host to monitor the data ...
0
votes
2answers
74 views

netcat from ubuntu

I'm trying to use netcat to catch kernel printing (netconsole) using nc -l -u -p 6666. But when I use this utility in Ubuntu, it immediately exits. Trying to figure out why, I see that in the manual ...
1
vote
1answer
1k views

netcat echo server - possible with pipes instead of commands as strings?

I want to create an echo server without specifying any of my commands inside strings. I want all commands to be connected by pipes. This doesn't appear possible because the response gets returned ...
0
votes
1answer
2k views

nc command not found on SuSE

I'm trying to use the nc command on SuSE Linux Enterprise Desktop 11. I executed this line: nc ­-4ul 192.0.2.2 50000 But I got this.- bash: nc: command not found This is the first time that I ...
2
votes
1answer
299 views

nc -l in background closes immediately (nc -l 1234 &)

When I put this nc -l 12345 >nc_out in a shell script, run it and then connect from other shell using telnet, it allows me to type some text and have it end up in nc_out. But if I start nc in ...
2
votes
1answer
1k views

Netcat (nc6) - Minimal IPv6 only TCP Server and Client

Im am trying to set up a basic IPv6 only echo-server using netcat (or rather nc6). Client and server are both in the same local network. However, the client quits immediately: IPv6-Server: $ nc6 ...
2
votes
2answers
48 views

Output of one command is piped to another one; how to close both?

I call Qt Assistant like suggested on stackoverflow: nc -lkU ~/.assistantfifo | assistant -enableRemoteControl & Qt Assistant window is opened, and if I call jobs, it returns: [1] + running ...
0
votes
1answer
216 views

Getting more output from NetCat

Currently I'm using the standard netcat -e /bin/sh to provide a remote shell for other computers to access. The problem is however that this shell is rather terrible, since it has limited output. For ...
2
votes
2answers
8k views

nc: bind failed: Address already in use

I am trying to execute nc command from a script , my script is executing nc command on different ports of Destination using the same source port. e.g: nc -p 8140 -z -v -n 10.X.X.9 9090 nc -p 8140 -z ...
2
votes
1answer
1k views

cat file to udp, pt 2: send 1 udp packet per ^C-delimited line

Yesterday I asked a question about catting a file over a UDP socket in bash. The solution we came up was netcat -c -w 1 -v -u -s 127.0.0.1 239.255.0.1 30001 < test.txt. This worked in the sense ...
2
votes
1answer
174 views

How to avoid sending EOF from a script parsing requests from and sending answers to netcat

I made a simple server using netcat and backpipe: mkfifo backpipe nc -l 8080 < backpipe | parseRequests.sh > backpipe The contents of "parseRequests.sh" is just: #!/bin/sh if [ "$1" = "1+1" ...
1
vote
1answer
1k views

Command line streaming string manipulation from netcat

I have a netcat udp connection listening with nc -l -u .... I've been trying to do a per packet manipulation of the incoming data with just command line, but it doesn't look like there is a flag in ...
2
votes
3answers
1k views

netcat doesn't work as expected when detached from console with nohup (Ubuntu/Debian 64bit)

I'm trying to leave netcat running and close the ssh session (even stop the ssh daemon). But it then exits before all of the data is written. I'm testing in a non-ssh (local) console: nohup nc -l -p ...
10
votes
3answers
17k views

convert a hex string to binary and send with netcat

I have a binary file that I can send with netcat: $ nc -l localhost 8181 < my.dat The file contains this: $ xxd my.dat 0000000: 0006 3030 3030 4e43 ..0000NC What I really ...
12
votes
1answer
5k views

Remote desktop over SSH reverse tunnel to replace TeamViewer

I want to open a remote desktop session from my laptop to desktop over my SSH (reverse) tunnel. That should be simple (or at least doable), right? Until now I've been using Team Viewer to log in to ...
3
votes
1answer
3k views

Stream Video using Netcat and VLC

I'm trying to use netcat on Linux server to stream video to my windows client using VLC I started running netcat on Linux: cat /media/HD1/myMovie.mkv | nc -l 8668 In VLC Windows Client I tried ...
2
votes
1answer
4k views

How to put value of echo pipe netcat commands into variable [duplicate]

I have this command succession: echo -ne "/dev/shm/test.sh" | netcat 89.196.167.2 4567 and let's say it return a string like, for example "Hello...bla". (on the 89.196.167.2 i have made a server ...
2
votes
1answer
133 views

Log from TCP Port breaking messages on characters other than newline

I'm working on a set of scripts to monitor some external services that log to a TCP port. function handleMessage { while read message do # Handle $message done } nc -d $ipadd $port | ...
2
votes
2answers
801 views

How to copy a partition over network

I want to copy a Windows 7 partition that came installed on my laptop to my desktop computer. I've tried: # bzip2 -c /dev/sda5 | nc 192.168.1.1 2222 # on laptop # nc -l 2222 | bzip2 -d > ...
13
votes
2answers
12k views

/dev/tcp listen instead of nc listen

With a netcat listener like: nc -l <port> < ~/.bashrc I can grab my .bashrc on a new machine (doesn't have nc or LDAP) with: cat < /dev/tcp/<ip>/<port> > ~/.bashrc My ...