Nmap Development mailing list archives

netcat missing example (is this even possible?)


From: David Burrows <snadge () gmail com>
Date: Tue, 1 Jun 2010 23:33:32 +1000

Hi all,

I wish to use netcat to connect /dev/random to a tcp socket, and then
connect the other end of that socket to a pty device, such that reads from
the pty device, are tunneled through the tcp socket.  Eg.  Host A ->
/dev/random -> tcp socket -> ... Host B -> tcp socket -> /dev/newrandom.
For testing purposes, it is easiest to use /dev/urandom and localhost.

At first it would appear you could use netcat or socat to do this, but if
baffles me as to how.  I have tried the following with socat, somewhat
unsuccesfully:
socat /dev/urandom TCP4-LISTEN:12345
(in another terminal)
socat TCP4:localhost:12345 PTY,link=/dev/newrandom,wait-slave

This sort of works, in the sense that I can open /dev/newrandom, and get
data from it, but the reads return short and the first socat starts
continuously flooding the tcp socket as long as there is data in
/dev/urandom (which is always true).

I'm likely going about this entirely the wrong way, which is why I am
appealing for someone more knowledgeable to point out a better way to
achieve this?

Curiously,

David.
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: