File: layer4.pl

package info (click to toggle)
libnet-write-perl 1.05-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze, wheezy
  • size: 120 kB
  • ctags: 32
  • sloc: perl: 412; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 491 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl
#
# $Id: layer4.pl 1636 2009-06-10 18:38:24Z gomor $
#
use strict;
use warnings;

my $target = shift || die("Specify an IPv4 address as a parameter\n");

use Net::Write::Layer qw(:constants);
use Net::Write::Layer4;

my $l4 = Net::Write::Layer4->new(
   dst      => $target,
   protocol => NW_IPPROTO_TCP,
   family   => NW_AF_INET,
);

use Net::Packet::TCP;
my $tcp = Net::Packet::TCP->new;
$tcp->pack;

print $tcp->print."\n";

$l4->open;
$l4->send($tcp->raw);
$l4->close;