Nmap Development mailing list archives

Re: Your favorite Ncat/nc/Netcat trick?


From: David Fifield <david () bamsoftware com>
Date: Mon, 16 Feb 2009 13:40:48 -0700

On Fri, Feb 13, 2009 at 12:09:53AM +0000, Brandon Enright wrote:
What's your favorite Ncat trick? Did it (or nc, etc.) ever get you out
of a jam? Do you have any experiences that would make good examples
for the users' guide?

I often use socat+netcat+perl to unwrap a SSL service and/or modify the
traffic.  For example, to turn IMAPS into IMAP, save the results, and
even mess with what is being sent via a perl script you'd do something
like:

$ mkfifo backpipe
$ while [ 1 == 1 ]; do socat OPENSSL:popmaster.ucsd.edu:993,verify=0 \
STDIO 0<backpipe | nc -l -p 143 | ./filter.pl | tee -a out 1>backpipe; done

Now, I suspect ncat could replace socat for this job.  It certainly
could replace nc.  It could also probably replace the while loop.

I put a trick based on this one in the documentation.

http://nmap.org/ncat/guide/ncat-tricks.html#ncat-unwrap-ssl

David Fifield

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


Current thread: