Changeset 291
- Timestamp:
- 01/28/2010 10:24:53 AM (3 years ago)
- File:
-
- 1 edited
-
trunk/plugins/nikto_core.plugin (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugins/nikto_core.plugin
r290 r291 21 21 # Nikto core functionality 22 22 ############################################################################### 23 sub change_variables 24 { 23 sub change_variables { 25 24 # $line is the unfiltered variable 26 25 my $line=$_[0]; … … 33 32 $line =~ s/JUNK\(([0-9]+)\)/LW2::utils_randstr($1)/e; 34 33 35 if ($line !~ "\@") 36 { 34 if ($line !~ "\@") { 37 35 push(@subtests, $line); 38 36 } 39 else 40 { 41 foreach my $varname (keys %VARIABLES) 42 { 43 if ($line =~ "$varname") 44 { 37 else { 38 foreach my $varname (keys %VARIABLES) { 39 if ($line =~ "$varname") { 45 40 # We've found the variable; now to expand it! 46 foreach my $value (split(/ /, $VARIABLES{$varname})) 47 { 41 foreach my $value (split(/ /, $VARIABLES{$varname})) { 48 42 $cooked = $line; 49 43 $cooked =~ s/$varname/$value/g; … … 58 52 59 53 ############################################################################### 60 sub is_404 61 { 62 my ($uri, $content, $rescode) = @_; 63 $ext=get_ext($uri); 64 65 if (($FoF{$ext}{mode} eq "STD") && (($rescode eq 401) || ($rescode eq 403) || ($rescode eq 404) || ($rescode eq 410))) { return 1; } 66 elsif ($FoF{$ext}{mode} eq "STD") { return 0; } 67 elsif ($FoF{$ext}{mode} eq "REDIR") 68 { 69 if ($result{location} eq $FoF{$ext}{location}) { return 1; } 70 } 71 elsif (($FoF{$ext}{type} eq "CONTENT") && ($content =~ /$FoF{$ext}{match}/i)) { return 1; } 72 elsif (($FoF{$ext}{type} eq "BLANK") && ($content eq "")) { return 1; } 73 elsif ($FoF{$ext}{type} eq "HASH") 74 { 75 my $content=rm_active_content($content, $uri); 76 if (LW2::md4($content) eq $FoF{$ext}{match}) { return 1; } 77 } 78 return 0; 54 sub is_404 { 55 my ($uri, $content, $rescode) = @_; 56 $ext=get_ext($uri); 57 my $pagenf=0; 58 59 if (($FoF{$ext}{mode} eq "STD") && 60 ($rescode =~ /4[0-9][0-9]/)) { 61 $pagenf=1; 62 } 63 elsif ($FoF{$ext}{mode} eq "REDIR") { 64 if ($result{location} eq $FoF{$ext}{location}) { 65 $pagenf=1; 66 } 67 } 68 elsif (($FoF{$ext}{type} eq "CONTENT") && 69 ($content =~ /$FoF{$ext}{match}/i)) { 70 $pagenf=1; 71 } 72 elsif (($FoF{$ext}{type} eq "BLANK") && 73 ($content eq "")) { 74 $pagenf=1; 75 } 76 elsif ($FoF{$ext}{type} eq "HASH") { 77 my $content=rm_active_content($content, $uri); 78 if (LW2::md4($content) eq $FoF{$ext}{match}) { 79 $pagenf=1; 80 } 81 } 82 83 return $pagenf; 79 84 } 80 85 ###############################################################################
Note: See TracChangeset
for help on using the changeset viewer.