Ignore:
Timestamp:
06/19/2010 04:17:14 AM (3 years ago)
Author:
sullo
Message:

rm_active_content regex speedups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/nikto_core.plugin

    r457 r458  
    1 #VERSION,2.1.1 
     1#VERSION,2.1.3 
    22# $Id$ 
    33############################################################################### 
     
    225225 
    226226    # add those generic type holders back as real files 
    227     $REQS{"/$rs/"} = "DIRECTORY"; 
    228     $REQS{"/$rs"}  = "NONE"; 
    229     $REQS{"/.$rs"} = "DOTFILE"; 
     227    $REQS{'/$rs/'} = "DIRECTORY"; 
     228    $REQS{'/$rs'}  = "NONE"; 
     229    $REQS{'/.$rs'} = "DOTFILE"; 
    230230 
    231231    foreach my $file (keys %REQS) { 
     
    273273 
    274274    my $cooked = rm_active_content($content); 
    275     $FoF{"index.php"}{'match'} = LW2::md4($cooked); 
    276     $FoF{"index.php"}{'type'}  = "HASH"; 
     275    $FoF{'index.php'}{'match'} = LW2::md4($cooked); 
     276    $FoF{'index.php'}{'type'}  = "HASH"; 
    277277 
    278278    return; 
     
    285285    my ($cont, $file) = @_; 
    286286 
    287     # Dates 
    288     $cont =~ s/(?:[0-9]{4}|[0-9]{1,2})[-.\/][0-9]{1,2}[-.\/](?:[0-9]{4}|[0-9]{1,2})//g; 
    289     $cont =~ s/(?:([0-9]{2}:[0-9]{2}(?::[0-9]{2})?)|(?:[0-9]{8,14}|[0-9]{6}))//g; 
     287    # Dates/Times 
     288    $cont =~ s/[12][0-9]{3}[-.\/][1-3]?[0-9][-.\/][1-3]?[0-9]//g;    # 2001-12-12 
     289    $cont =~ s/[1-3]?[0-9][-.\/][1-3]?[0-9][-.\/][12][0-9]{3}//g;    # 12-12-2002 
     290    $cont =~ s/[0-9]{8,14}//g;                                       # timestamp 
     291    $cont =~ s/[0-9]{6}//g;                                          # timestamp 
     292    $cont =~ s/[0-9]{2}:[0-9]{2}(?::[0-9]{2})?//g;                   #12:11:33 
    290293    $cont =~ 
    291       s/(?:mon|tue|wed|thu|fri|sat|sun),? [0-9]{1,2} (?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec) [0-9]{4} (?:[0-9]{2}:[0-9]{2}:?(?:[0-9]{2})?)?//ig; 
     294      s/(?:mon|tue|wed|thu|fri|sat|sun),? [1-3]?[0-9] (?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)//ig; 
     295    $cont =~ s/[12][0-9]{3}\s?(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)\s?[1-3]?[0-9]//gi 
     296      ;                                                              # 2009 jan 29 
    292297    $cont =~ 
    293       s/(?:[0-9]{2,4})? ?(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(?:[0-9]{2,4})?\/?(?:[0-9]{2})?(?:[0-9]{2})?//gi; 
    294     $cont =~ s/[0-9\.]+ second//gi;    # page load time 
    295     $cont =~ s/[0-9]+ queries//gi;     # wordpress 
     298      s/[1-3]?[0-9]\s?(?:jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)[, ]?(?:[12][0-9]{3})?//gi 
     299      ;                                                              # 29 Jan 2009 
     300    $cont =~ s/[0-9\.]+ second//gi;                                  # page load time 
     301    $cont =~ s/[0-9]+ queries//gi;                                   # wordpress 
    296302 
    297303    # URI, if provided, plus encoded versions of it 
Note: See TracChangeset for help on using the changeset viewer.