-
Notifications
You must be signed in to change notification settings - Fork 0
/
netcat-io-enhancements.html
7 lines (7 loc) · 3.8 KB
/
netcat-io-enhancements.html
1
2
3
4
5
6
7
<html><body>
<head>
<title>Netcat I/O enhancements | Oracle Czech techie's adventures Blog</title>
<meta name="publish_date" content="2011-11-28 07:11:27">
</head>
<p>When <a href="http://blogs.oracle.com/vlad/entry/netcat_in_solaris">Netcat integrated into OpenSolaris</a> it was already clear <br/>that there will be couple of enhancements needed. The biggest set of the changes made after Solaris 11 Express was released brings<br/>various I/O enhancements to netcat shipped with <a href="http://www.oracle.com/us/solaris/index.html">Solaris 11</a>. Also, since <br/>Solaris 11, <a href="http://pkg.oracle.com/solaris/release/en/search.shtml?token=netcat&action=Search">the netcat package</a> is <br/>installed by default in all distribution forms (live CD, text install, ...).</p><p>Now, let's take a look at the new functionality:</p><br/><table cellspacing="8"><br/><tr><td>/usr/bin/netcat </td><td> alternative program name (symlink) </td><br/></tr><br/><tr><td> -b bufsize </td><td> I/O buffer size </td> <br/></tr><br/><tr><td> -E </td><td> use exclusive bind for the listening socket </td><br/></tr><br/><tr><td> -e program </td><td> program to execute </td> <br/></tr><br/><tr><td> -F<p style="text-indent:5em;"></p></td><td><p style="text-indent:5em;"></p> no network close upon EOF on stdin </td> <br/></tr><br/><tr><td> -i timeout </td><td> extension of timeout specification </td> <br/></tr><br/><tr><td> -L timeout<p style="text-indent:5em;"></p></td><td> linger on close timeout<p style="text-indent:5em;"></p></td><p style="text-indent:5em;"></p> <br/></tr><br/><tr><td> -l -p port addr </td><td> previously not allowed usage </td> <br/></tr><br/><tr><td> -m byte_count </td><td> Quit after receiving byte_count bytes </td> <br/></tr><br/><tr><td> -N file<p style="text-indent:5em;"></p></td><td> pattern for UDP scanning<p style="text-indent:5em;"></p></td><p style="text-indent:5em;"></p> <br/></tr><br/><tr><td>-I bufsize </td><td> size of input socket buffer </td> <br/></tr><br/><tr><td> -O bufsize </td><td> size of output socket buffer </td> <br/></tr><br/><tr><td> -R redir_spec </td><td> port redirection </td> <br/></tr><br/><tr><td> addr/port[/{tcp,udp}] </td><td>syntax of redir_spec </td> <br/></tr><br/><tr><td>-Z<p style="text-indent:5em;"></p></td><td><p style="text-indent:5em;"></p> bypass zone boundaries </td> <br/></tr><br/><tr><td> -q timeout </td><td> timeout after EOF on stdin </td> <br/></tr><br/></table><p>Obviously, the <a href="http://en.wikipedia.org/wiki/Netcat">Swiss army knife of networking tools</a> just got a bit thicker.</p><p>While by themselves the options are pretty self explanatory, their combination together with other options,<br/>context of use or boundary values of option arguments make it possible to construct small but powerful tools.<br/>For example:</p><ul><li><br/>the port redirector allows to convert TCP stream to UDP datagrams.<br/></li><li><br/>the buffer size specification makes it possible to send<br/>one byte TCP segments or to produce IP fragments easily.<br/></li><li><br/>the socket linger option can be used to produce TCP RST segments by setting the timeout to 0<br/></li><li><br/>execute option makes it possible to simulate TCP/UDP servers or clients with shell/python/Perl/whatever script<br/></li><li><br/>etc.<br/></li></ul><p>If you find some other helpful ways use please share via comments.</p><p>Manual page nc(1) contains more details, along with examples on how to use some of these new options.</p>
</body></html>