#!/usr/bin/perl # First run #$black_list = "media.?guard|viaccess|echostar|multivision|infinity|noos|hex.?file|seca.?key|canal.?sat|code tps"; # Second run #$black_list = "mustek|TPS.?CSAT|I send you this file in order to have your advice|Comme on en parlait l'autre jour|Returned mail--|PLUSTEK|program\.exe|optic.?pro|Un OBJET PUBLICITAIRE|hot.?bird|satelite|How are you|arabsat|Enfin un bon site porno gratuit|Code Csat|Pour le mois de la tendresse|Your opinion for a Sony Digital Camcorder|clef tps|irdeto|optique pro|fichier pic|satellites|viacces|fichier hex|astoncrypt|CANAL.?PLUS"; # Third run (not yet finished) $black_list = "xsat410|gold card|Report to Sender"; $white_list = "linux|samba|red.?hat|mandrake|debian|slackware"; opendir DH, "./" or die "Could not open directory"; while ($file = readdir(DH)) { if ($file eq "." or $file eq ".." or ( -d $file )) { #print "not a file: $file"; next; } #print "reading: $file\n"; open FILE, "$file"; $in_subject = 0; $in_body = 0; $times_in_file = 0; $found_white_expr = 0; while () { if (//) { $in_subject = 1; } if (//) { $in_body = 1; } if ($in_subject == 1 or $in_body == 1) { if (/$black_list/i) { $times_in_file++; } if (/$white_list/i) { $found_white_expr = 1; } } if (//) { $in_subject = 0; } if (//) { $in_body = 0; } } if ($found_white_expr == 0 && $times_in_file > 0) { print "$file\n"; } } closedir(DH);