Changeset 285


Ignore:
Timestamp:
01/27/2010 07:48:17 PM (3 years ago)
Author:
deity
Message:

Some cleaning up of perl warnings

Location:
trunk/plugins
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/nikto_core.plugin

    r281 r285  
    9797   }  
    9898   # print errors to STDERR 
    99    if ($line =~ /^+ ERROR\:/) { print STDERR "$line\n"; return; } 
     99   if ($line =~ /^\+ ERROR\:/) { print STDERR "$line\n"; return; } 
    100100    
    101101   # don't print to STDOUT if output file is "-" 
    102    if ($CLI{'file'} eq "-") { return; } 
     102   if ((defined $CLI{file}) && ($CLI{'file'} eq "-")) { return; } 
    103103 
    104104   # print to scan details to standard output if the users wants another format and is saving results to a file 
     
    619619 else                             { nprint("+ ERROR: Invalid output format"); exit; } 
    620620 
    621  if (($CLI{'file'} ne "") && ($CLI{'format'} eq "")) { nprint("+ERROR: Output file specified without a format"); exit; } 
     621 if ((defined $CLI{'file'}) && ($CLI{'format'} eq "")) { nprint("+ERROR: Output file specified without a format"); exit; } 
    622622  
    623623 # verify readable dtd  
     
    768768   my $host_ctr=1; 
    769769   my @hosts=split(/,/,$hostlist); 
    770    my @ports=split(/,/,$portlist); 
     770   my @ports=split(/,/,$portlist) if defined $portlist; 
    771771   my @checkhosts; 
    772772   my @results; 
     
    780780      if ($port =~ /-/) 
    781781      { 
    782          my $start, $end; 
     782         my ($start, $end); 
    783783         my @temp=split(/-/,$port); 
    784784         $start=$temp[0]; 
     
    11901190{ 
    11911191   my ($hostname, $ip, $port) = @_; 
    1192    my %m, %headers; 
     1192   my (%m, %headers); 
    11931193 
    11941194   $m->{hostname}=$hostname; 
     
    12711271               if ($torun_plugin eq "ALL" || 
    12721272                   $pluginhash->{name} eq $torun_plugin) { 
    1273                   $pluginhash->{run}=true; 
     1273                  $pluginhash->{run}="true"; 
    12741274               } 
    12751275            } 
     
    19941994   my ($mark, $uri, $method, $data, $headers, $noclean) = @_; 
    19951995   if ($CLI{'pause'} > 0) { sleep $CLI{'pause'}; } 
    1996    my %request, %result; 
     1996   my (%request, %result); 
    19971997   setup_hash(\%request, $mark); 
    19981998  
  • trunk/plugins/nikto_httpoptions.plugin

    r284 r285  
    4545   my $aoptions = "$headers{allow}, "; 
    4646   my $poptions = "$headers{public}, "; 
    47    my ($allow_methods, $public_methods, $txt); 
     47   my ($allow_methods, $public_methods); 
     48   my $txt = ""; 
    4849   my $dbarray; 
    4950 
  • trunk/plugins/nikto_msgs.plugin

    r275 r285  
    6464      # Computer name  
    6565      my $name=$CONTENT;  
    66       $name =~ s#(^.*<ComputerName>)([a-zA-Z0-9]*)(</ComputerName>.*$)#\2#;  
     66      $name =~ s#(^.*<ComputerName>)([a-zA-Z0-9]*)(</ComputerName>.*$)#$2#;  
    6767      my $eposerver=$CONTENT;  
    68       $eposerver =~ s#(^.*<ePOServerName>)([a-zA-Z0-9]*)(</ePOServerName>.*$)#\2#;  
     68      $eposerver =~ s#(^.*<ePOServerName>)([a-zA-Z0-9]*)(</ePOServerName>.*$)#$2#;  
    6969      add_vulnerability($mark,"Web server is a McAfee ePO agent, showing the hostname is $name and the ePO server is $eposerver.",80100,0);       
    7070   }  
     
    8181         {  
    8282            $name=$line;  
    83             $name =~ s#(^.*System Management Homepage for )([a-zA-Z0-9]*)(</font>.*$)#\2#;  
     83            $name =~ s#(^.*System Management Homepage for )([a-zA-Z0-9]*)(</font>.*$)#$2#;  
    8484         }  
    8585         if ($line =~ "new ObjectIpAddresses")  
    8686         {  
    8787            my $ipaddr=$line;  
    88             $ipaddr =~ s#(^.*new ObjectIpAddresses\(")([\d\.]+)("\);.*$)#\2#;  
     88            $ipaddr =~ s#(^.*new ObjectIpAddresses\(")([\d\.]+)("\);.*$)#$2#;  
    8989            nprint("$ipaddr");  
    9090            $ipaddrs .= " $ipaddr";  
  • trunk/plugins/nikto_report_html.plugin

    r279 r285  
    196196} 
    197197 
    198 sub nikto_reports { }    # so core doesn't freak 
    199  
    2001981; 
  • trunk/plugins/nikto_report_text.plugin

    r269 r285  
    5353{ 
    5454   my ($handle, $mark) = @_; 
    55    my $curr_host, $curr_port; 
     55   my ($curr_host, $curr_port); 
    5656   print $handle "+ Target Host: $mark->{hostname}\n"; 
    5757   print $handle "+ Target Port: $mark->{port}\n"; 
Note: See TracChangeset for help on using the changeset viewer.