Tagged Questions

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

learn more… | top users | synonyms

1
vote
2answers
25 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
1answer
19 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
85 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
20 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
19 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
29 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 ...
2
votes
2answers
306 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
59 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
89 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
74 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
118 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
30 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
34 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 ...
0
votes
1answer
135 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
437 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
124 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
301 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
43 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
144 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
3k 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
774 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
120 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
917 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
652 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 ...
9
votes
3answers
8k 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 ...
11
votes
1answer
3k 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 ...
2
votes
1answer
2k 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 ...
1
vote
1answer
3k 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
118 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
677 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 > ...
12
votes
2answers
8k 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 ...
3
votes
2answers
3k views

SSH jumping over socks(4/5) proxy chain. Host -> socks proxy -> socks proxy -> destination

I got a great answer for my previous question about connecting from Machine A to Machine C via Socks proxy located on Machine B. Say Machine B Ip is 218.62.97.105 and it is listening on port 1080 ...
3
votes
1answer
4k views

netcat in shell script giving invalid connection

I have a shell script that uses netcat to listen to localhost on port 1111 for web requests. Every time I try accessing localhost:1111/index.html for example I get: invalid connection to [127.0.0.1] ...
8
votes
3answers
5k views

Using in/out named pipes for a TCP connection

I've been fiddling with getting this to work for a while now, so I suspect some sort of fundamental misunderstanding about how pipes work is the root cause of my troubles. My goal is to initiate a ...
2
votes
3answers
805 views

How can I read lines at a fixed speed?

I need to read a large log file and send it over a local network using (netbsd) netcat between two VMs on the same host workstation. I know that netcat has an interval, but as far as I can tell, the ...
4
votes
2answers
6k views

How to make netcat use an existing HTTP proxy

I can access a web page just fine by directly hitting my web server as follows: $ echo "GET /sample" | nc web-server 80 This is contents of /sample... $ Now, I would like netcat to go via a Squid ...
3
votes
2answers
607 views

Different redirection styles with netcat and tee giving different results

In trying to trace a simple HTTP GET request and its response with nc, I'm running into something strange. This, for example, works fine: the in file ends up containing the HTTP GET request and the ...
4
votes
2answers
486 views

is it possible to send the remote connector ip via netcat?

Actually I want to make something like ifconfig.me functionality but only for my internal network. I see it the way smth on server listens some port and send ip of connected remote machine. Seems nc ...
4
votes
2answers
548 views

Why does this shell snippet to check if hosts are up using netcat stop prematurely?

Q: Why does the second iteration exits after 10.175.192.16? Can someone explain that? Or I just found a "while/netcat" bug? a.txt's content: $ cat a.txt 10.175.192.14 10.175.192.16 10.175.192.17 $ ...
2
votes
3answers
469 views

Servers running from chrooted Ubuntu on HP TouchPad? [closed]

The problem: servers appear to be broken inside my Ubuntu chroot. No matter what kind of server I try to run, they all seem unresponsive (VLC server won't respond to client, mkRemote doesn't move the ...
1
vote
1answer
386 views

netcat throughput low but iperf high [closed]

I was testing the throughput between two pcs connected on the same router: one with 100mbps lan, the other with 54mbps wifi. I tested both netcat and iperf and the throughtput I get is only 2.6mb/s. ...
6
votes
2answers
3k views

Howto create a permanent client connection with netcat?

I'm writing a bash script that constantly read a folder in a loop to send data to a server at a defined time interval. I'm using netcat as the tool to connect to the server and send the data. My ...