0byt3m1n1
Path:
/
data
/
16
/
.snapshot
/
daily.2025-03-10_0010
/
inventory
/
ARCHIVE
/
[
Home
]
File: htscan.pl
#!/usr/local/bin/perl $file = $ARGV[0]; chomp($file); $filesection = $file; open LIST, "<${file}"; $file =~ s/-HTLIST\.txt//; @FILEPARTS = (split /\// ,$file); $file = pop(@FILEPARTS); open HTBAD, ">/data/16/inventory/done/HTScan/${file}-HTBAD.txt"; open HTSTAT, ">/data/16/inventory/done/HTScan/${file}-HTSTAT.txt"; open SUSPECT, ">/data/16/inventory/done/HTScan/${file}-SUSPECT.txt"; while (<LIST>) { #1 $htfile = $_; chomp($htfile); $ht_cnt = 0; $suspect = "FALSE"; open HTFILE, "<${htfile}"; @HT_FILE = <HTFILE>; close HTFILE; $test = "qU3Ry="; $ht_lines = @HT_FILE; $N = 0; $ht_cnt = scalar(grep /$test/, @HT_FILE); print HTBAD "$htfile\n" if ($ht_cnt >= 1); $suspect = "NOTFALSE" if ($ht_cnt >= 1); while(($suspect eq 'FALSE') && ($N <= ($htlines - 3))) { #2 foreach(@HT_FILE) { #3 $check_line = $_; chomp($check_line); $M = ($N + 3); $V = ($N + 10); while(($M <= $V) && ($suspect eq 'FALSE') && ($M <= $htlines)) { #4 $suspect = "TRUE" if (($HT_FILE[$N] =~ /^\#([0-9a-zA-Z]){20,35}/) && ($HT_FILE[$M] =~ /^\#([0-9a-zA-Z]){20,35}/)); $M++; } #4 $N++; } #3 } #2 print SUSPECT "$htfile\n" if ($suspect eq 'TRUE'); print HTSTAT "Finished $htfile\n"; } #1 print HTSTAT "All done...\n"; close HTSTAT; close HTBAD; close SUSPECT;