Changeset 333
- Timestamp:
- 02/28/10 12:27:58 (3 years ago)
- Location:
- trunk/plugins
- Files:
-
- 1 deleted
- 2 edited
-
nikto_core.plugin (modified) (2 diffs)
-
nikto_passfiles.plugin (deleted)
-
nikto_tests.plugin (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/nikto_core.plugin
r330 r333 667 667 } 668 668 669 if (!defined $CLI{'plugins'} )669 if (!defined $CLI{'plugins'} || $CLI{'plugins'} eq "") 670 670 { 671 671 $CLI{'plugins'}='@@DEFAULT'; 672 672 } 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 } 673 684 674 685 $NIKTO{'timeout'}=$CLI{'timeout'} || 10; … … 683 694 if (defined $NIKTOCONFIG{'RFIURL'}) { 684 695 $VARIABLES{'@RFIURL'} = $NIKTOCONFIG{'RFIURL'}; 685 }696 } 686 697 else { 687 698 nprint("- ***** RFIURL is not defined in nikto.conf, which means no RFI tests will run *****"); -
trunk/plugins/nikto_tests.plugin
r300 r333 38 38 sub nikto_tests 39 39 { 40 my ($mark ) = @_;40 my ($mark, $parameters) = @_; 41 41 42 42 # this is the actual the looped code for all the checks … … 172 172 } # end check loop 173 173 174 # Perform mutation tests 175 if ($parameters->{'passfiles'}) { 176 passchecks($mark); 177 } 178 174 179 return; 175 180 } 176 181 182 sub 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 216 sub 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 177 232 1;
Note: See TracChangeset
for help on using the changeset viewer.