
Net::Netcat - A wrapper class for nc Swiss army knife of networking

A simple interface for using netcat command line utility. You can run TCP, UDP or UNIX domain servers and clients.

use Net::Netcat;
my $nc = Net::Netcat->new('/usr/bin/nc');
my $result = $nc->exec(); croak $nc->errstr unless $result;
$nc->exec();
$nc->options{ '-s' => 'source IP', '-p' => 'source port', };
$nc->exec()
# All options in OpenBSD netcat
ipv4only => '-4',
ipv6only => '-6',
staylistening => '-k',
listenmode => '-l',
nodns => '-n',
randomports => '-r',
md5sign => '-S',
rfc854telnet => '-y',
unixsocket => '-U',
udpsocket => '-u',
verbose => '-v',
scanmode => '-z',
tcprecvbuff => '-I length',
tcpsendbuff => '-O length',
delaypkt => '-i interval',
sourceport => '-p source_port',
sourceip => '-s source',
toskeyword => '-T tos',
timeout => '-w timeout',
port => '-port port',
dest => '-dest destination_to_connect_to'
$nc->options{'-v' => 1,'-4' => 1, '-l' => 1, 'port' => 2300};
$nc->exec();

Contructs Net::Netcat object.It takes a path of netcat command.
You can omit this argument and this module searches netcat command within PATH environment variable.
I tested and developed this on OpenBSD 5.2 netcat. This is
substantially different from Linux netcat. So kindly sene me bug
reports.
There seems to be a bug in netcat with UNIX domain sockets and
the verbose flag. So don't use that combo. Usually you have to
terminate the command with the Ctrl-C keyboard interrupt signal. You
could also redirect the output to a file if desired.
Specify netcat command options directly
Executes netcat command with specified options.
An alias of execute()
Get netcat command output to stdout.
Get netcat command output to stderr.
Specify output file name and output options.
Avaiable options are:
The destination IP address to connect to or in case of UNIX domain sockets the destination socket file to connect to
The port to connect to
Set the author.
Set the comment.

Girish Venkatachalam, <girish at gayatri-hitech.com>

Please report any bugs or feature requests to
C<bug-text-cowsay at rt.cpan.org>, or through the web interface at
L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=text-cowsay>.
I will be notified, and then you'll automatically be notified of progress on
your bug as I make changes.

You can find documentation for this module with the perldoc command.
perldoc Net::Netcat
You can also look for information at:
L<http://annocpan.org/dist/Net-Netcat>
L<http://cpanratings.perl.org/d/Net-Netcat>
L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-Netcat>
L<http://search.cpan.org/dist/Net-Netcat>

The author of Netcat Hobbit who remains anonymous to this day.

Copyright 2012 Girish Venkatachalam, all rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.