Changeset 333 for trunk/plugins/nikto_tests.plugin
- Timestamp:
- 02/28/2010 12:27:58 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/plugins/nikto_tests.plugin (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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.