Ignore:
Timestamp:
02/10/2010 02:15:09 PM (3 years ago)
Author:
sullo
Message:

Added general content searching on all requests made with fetch() and nfetch(), with the strings coming from db_content_search

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/nikto_core.plugin

    r322 r324  
    958958sub load_databases 
    959959{ 
    960  my @dbs=qw/db_404_strings  db_outdated  db_realms  db_tests  db_variables/; 
     960 my @dbs=qw/db_404_strings  db_outdated  db_realms  db_tests  db_variables db_content_search/; 
    961961 my $prefix = $_[0]; 
    962962 
     
    10131013                        } 
    10141014           } 
     1015 
     1016       # db_content_search 
     1017       elsif ($file eq 'db_content_search') { 
     1018                foreach my $l (@file) {  
     1019                        my @T=parse_csv($l); 
     1020                        $CONTENTSEARCH{$T[0]}{'osvdb'}=$T[1]; 
     1021                        $CONTENTSEARCH{$T[0]}{'string'}=$T[2]; 
     1022                        $CONTENTSEARCH{$T[0]}{'message'}=$T[3]; 
     1023                        } 
     1024           } 
    10151025    
    10161026       # db_outdated 
     
    11771187 nprint "\n"; 
    11781188 exit; 
     1189} 
     1190############################################################################### 
     1191sub content_search 
     1192{ 
     1193 my $body=shift; 
     1194 my $file=shift; 
     1195 my $method=shift || "GET"; 
     1196 my ($mark) = @_; 
     1197 
     1198 foreach my $testid (keys %CONTENTSEARCH) { 
     1199        if ($body =~ /$CONTENTSEARCH{$testid}{string}/i) { 
     1200                my $outmessage = "$file: $CONTENTSEARCH{$testid}{'message'}"; 
     1201                add_vulnerability($mark, $outmessage, $CONTENTSEARCH{$testid}{testid}, $CONTENTSEARCH{$testid}{osvdb}, $method, $file); 
     1202                } 
     1203        } 
     1204 
     1205 return; 
    11791206} 
    11801207############################################################################### 
     
    20492076    } 
    20502077 } 
     2078 
     2079 # content search 
     2080 content_search($result{whisker}->{data}, $request{whisker}->{uri}, $request{whisker}->{method}); 
     2081 
    20512082 $request{'User-Agent'}=$temp_ua; # reset UA 
    20522083 return $result{'whisker'}->{'code'}, $result{'whisker'}->{'data'}; 
     
    21702201      } 
    21712202   } 
     2203 
     2204   # content search 
     2205   content_search($result{whisker}->{data}, $request{whisker}->{uri}, $request{whisker}->{method}, $mark); 
    21722206 
    21732207   return $result{'whisker'}->{'code'}, $result{'whisker'}->{'data'}, $result{'whisker'}->{'error'}; 
Note: See TracChangeset for help on using the changeset viewer.