Changeset 334


Ignore:
Timestamp:
03/04/10 00:27:25 (3 years ago)
Author:
deity
Message:

Change to move mutate 1 into nikto_tests

Location:
trunk
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/docs/CHANGES.txt

    r326 r334  
     12010-03-03 
     2        - Mutate 1 now wrapped into nikto_tests and doesn't take up anywhere near the amount of memory! 
     32010-02-28 
     4        - Starting to deprecate mutate by replacing with plugin options. -mutate 2 (passfiles) is now implemented within tests and uses less memory. 
    152010-02-10 
    26        - Updated -check_updates to use nfetch instead of fetch 
  • trunk/plugins/nikto_tests.plugin

    r333 r334  
    176176      passchecks($mark); 
    177177   } 
     178   if ($parameters->{'all'}) { 
     179      allchecks($mark); 
     180   } 
    178181    
    179182   return; 
     
    213216   } 
    214217} 
     218 
     219sub allchecks { 
     220   my ($mark) = @_; 
     221    
     222   # Hashes to temporarily store files/dirs in 
     223   # We're using hashes to ensure that duplicates are removed 
     224   my (%FILES, %DIRS); 
     225 
     226   # build the arrays 
     227   nprint("- Loading root level files", "v"); 
     228   foreach my $checkid (keys %TESTS) { 
     229      # Expand out vars so we get full matches 
     230      my @uris=change_variables($TESTS{$checkid}{'uri'}); 
     231       
     232      foreach my $uri (@uris) { 
     233         my $dir  = LW2::uri_get_dir($uri); 
     234                my $file = $uri; 
     235 
     236                if ($dir ne "") { 
     237            $DIRS{$dir} = ""; 
     238            $dir =~ s/([^a-zA-Z0-9])/\\$1/g; 
     239            $file =~ s/$dir//; 
     240         } 
     241                if (($file ne "") && ($file !~ /^\?/)) { 
     242            $FILES{$file} = ""; 
     243                } 
     244      } 
     245        } 
     246    
     247   # Now do a check for each item - just check the return status, nothing else 
     248   foreach my $dir (keys %DIRS) { 
     249      foreach my $file (keys %FILES) { 
     250         testfile($mark, "$dir$file", "all checks", 299999); 
     251      } 
     252   } 
     253}    
    215254 
    216255sub testfile { 
     
    226265      add_vulnerability( $mark, "$uri: file found during $name mutation", "$tid", "0", "GET"); 
    227266   } 
    228 } 
    229     
    230     
     267 
    231268 
    2322691; 
Note: See TracChangeset for help on using the changeset viewer.