Netcat is a computer networking service for reading from and writing network connections using TCP or UDP
1
vote
1answer
117 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
0answers
67 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
1answer
198 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 > ...
4
votes
2answers
1k 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 ...
2
votes
2answers
1k 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
...
2
votes
1answer
1k 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] ...
7
votes
3answers
1k 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
219 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 ...
3
votes
2answers
2k 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
330 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 ...
3
votes
1answer
140 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
214 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
330 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
231 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.
...
5
votes
2answers
1k 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 ...