Changeset 403


Ignore:
Timestamp:
05/04/2010 09:06:26 PM (3 years ago)
Author:
sullo
Message:

Fix for false positives when response is a redirect. A bit of fallout from getting rid of
some global variables, using %mark and not %response.

Location:
trunk/plugins
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/nikto_core.plugin

    r401 r403  
    5555############################################################################### 
    5656sub is_404 { 
    57     my ($uri, $content, $rescode) = @_; 
     57    my ($uri, $content, $rescode, $loc_header) = @_; 
    5858    $ext = get_ext($uri); 
    5959 
     
    6262    } 
    6363    elsif ($FoF{$ext}{'mode'} eq "REDIR") { 
    64         if ($result{'location'} eq $FoF{$ext}{'location'}) { 
     64        if ($loc_header eq $FoF{$ext}{'location'}) { 
    6565            return 1; 
    6666        } 
  • trunk/plugins/nikto_robots.plugin

    r344 r403  
    3737sub nikto_robots { 
    3838    my ($mark) = @_; 
    39     (my $RES, $CONTENT) = nfetch($mark, "/robots.txt", "GET", "", "", "", "robots"); 
     39    my %headers; 
     40    (my $RES, $CONTENT) = nfetch($mark, "/robots.txt", "GET", "", \%headers, "", "robots"); 
    4041 
    41     if (($RES eq 200) || ($RES eq $FoF{'okay'}{'response'}))    # got one! 
     42    if (($RES eq 200) || ($RES eq $FoF{'okay'}{'response'})) 
    4243    { 
    43         if (is_404("robots.txt", $CONTENT, $RES)) { return; } 
     44        if (is_404("robots.txt", $CONTENT, $RES, $headers{'location'})) { return; } 
    4445 
    4546        my ($DIRS, $RFILES) = ""; 
  • trunk/plugins/nikto_tests.plugin

    r390 r403  
    137137                # lastly check for a false positive based on file extension or type 
    138138                if (($m1_method eq "code") || ($m1o_method eq "code")) { 
    139                     if (is_404($uri, $content, $res)) { next; } 
     139                    if (is_404($uri, $content, $res, $headers{'location'})) { next; } 
    140140                } 
    141141 
Note: See TracChangeset for help on using the changeset viewer.