Changeset 333


Ignore:
Timestamp:
02/28/10 12:27:58 (3 years ago)
Author:
deity
Message:

Merged passfiles plugins into nikto_tests

Location:
trunk/plugins
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/nikto_core.plugin

    r330 r333  
    667667 } 
    668668 
    669  if (!defined $CLI{'plugins'}) 
     669 if (!defined $CLI{'plugins'} || $CLI{'plugins'} eq "") 
    670670 { 
    671671    $CLI{'plugins'}='@@DEFAULT'; 
    672672 } 
     673  
     674   # Mapping for mutate for plugins 
     675   if (defined $CLI{'mutate'}) { 
     676      nprint("- Mutate is deprecated, use -Plugins instead"); 
     677      if ($CLI{'mutate'} =~ /2/) { 
     678         $CLI{'plugins'} .= ';tests(passfiles)'; 
     679      } 
     680      if ($CLI{'mutate'} =~ /6/) { 
     681         $CLI{'plugins'} .= ';dictionary(dict:' . $CLI{'mutate-opts'} . ')'; 
     682      } 
     683   } 
    673684 
    674685 $NIKTO{'timeout'}=$CLI{'timeout'} || 10; 
     
    683694 if (defined $NIKTOCONFIG{'RFIURL'}) { 
    684695        $VARIABLES{'@RFIURL'} = $NIKTOCONFIG{'RFIURL'}; 
    685         } 
     696 } 
    686697 else { 
    687698        nprint("- ***** RFIURL is not defined in nikto.conf, which means no RFI tests will run *****");  
  • trunk/plugins/nikto_tests.plugin

    r300 r333  
    3838sub nikto_tests 
    3939{ 
    40    my ($mark) = @_; 
     40   my ($mark, $parameters) = @_; 
    4141 
    4242   # this is the actual the looped code for all the checks 
     
    172172   } # end check loop 
    173173    
     174   # Perform mutation tests 
     175   if ($parameters->{'passfiles'}) { 
     176      passchecks($mark); 
     177   } 
     178    
    174179   return; 
    175180} 
    176181 
     182sub passchecks { 
     183   my ($mark) = @_; 
     184   my @DIRS   = (split(/ /, $VARIABLES{"\@PASSWORDDIRS"})); 
     185   my @PFILES = (split(/ /, $VARIABLES{"\@PASSWORDFILES"})); 
     186   my @EXTS = qw(asp bak dat data dbc dbf exe htm html htx ini lst txt xml php php3 phtml); 
     187    
     188   nprint("- Performing passfiles mutation", "v"); 
     189 
     190   foreach my $dir (@DIRS) 
     191   { 
     192      foreach my $file (@PFILES) 
     193      { 
     194         next if ($file eq ""); 
     195 
     196         # dir/file 
     197         testfile($mark, "$dir$file", "passfiles", "299998"); 
     198 
     199         foreach my $ext (@EXTS) { 
     200            # dir/file.ext 
     201            testfile($mark, "$dir$file.$ext", "passfiles", "299998"); 
     202 
     203            foreach my $cgi (@CGIDIRS) 
     204            { 
     205               # dir/file.ext 
     206               testfile($mark, "$cgi$dir$file.$ext", "passfiles", "299998"); 
     207 
     208               # dir/file 
     209               testfile($mark, "$cgi$dir$file", "passfiles", "299998"); 
     210            } 
     211         } 
     212      } 
     213   } 
     214} 
     215 
     216sub testfile { 
     217   my ($mark, $uri, $name, $tid) = @_; 
     218   my ($result, $contents, $error) = nfetch( $mark, "$uri", "GET",  "", "", "", "Tests: $name"); 
     219   nprint("- $result for $uri","v"); 
     220   if ($error)  
     221   { 
     222      nprint("+ ERROR: $uri returned an error: $error");  
     223      return;  
     224   } 
     225   if ($result == 200) { 
     226      add_vulnerability( $mark, "$uri: file found during $name mutation", "$tid", "0", "GET"); 
     227   } 
     228} 
     229    
     230    
     231 
    1772321; 
Note: See TracChangeset for help on using the changeset viewer.