Changeset 776


Ignore:
Timestamp:
07/04/2012 10:05:19 AM (12 months ago)
Author:
deity
Message:

Fix for #246. Stupid perl design fault.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/nikto_cookies.plugin

    r680 r776  
    5555 
    5656    foreach my $c (@{ $result->{'whisker'}->{'cookies'} }) { 
    57         $c =~ /(?:\b|[^0-9])([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)(?:\b|[^0-9])/; 
    58         my $ip = $1; 
    59         my ($valid, $internal, $loopback) = is_ip($ip); 
    60         if ($valid && !$loopback) {  
     57                # This is due to the way that reg exps are scoped in perl: the results of match 
     58                # are valid as the first successful match, until the end of the block 
     59                # so we have to manually terminate the block to stop the results carrying on and 
     60                # getting a false positive. 
     61                my $ip; 
     62                { 
     63                        $c =~ /(?:\b|[^0-9])([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)(?:\b|[^0-9])/; 
     64                        $ip = $1; 
     65                } 
     66                my ($valid, $internal, $loopback) = is_ip($ip); 
     67                if ($valid && !$loopback) {  
    6168            if ($ip ne $mark->{'ip'}) { 
    6269                my $msg   = ""; 
Note: See TracChangeset for help on using the changeset viewer.