All pastes #2108573 Raw Edit

Stuff

public text v1 · immutable
#2108573 ·published 2012-02-01 09:45 UTC
rendered paste body
#!/usr/bin/perl

$MAXPROCESSES = 200;

`perl -pi -e "s/^\n//" ips.txt`;
`perl -pi -e "s/^\n//" pass.txt`;
`rm -rf tmp/*`;

$ipfile = "ips.txt";
open(IN_FILE, $ipfile);
my $numbers;
$numbers++ foreach(<IN_FILE>);
close IN_FILE;
$totalips = $numbers;

print qq (### Ok ... We have a total of $numbers servers to scan...\n);
print qq (\n);

`cd tmp;split ../ips.txt -l 10 mssqllist;cd ..`;

$filenames = `ls -l tmp|grep mssqllist|gawk -F" " '{ print \$9 }'`;

open(OUT, ">tmp/files.txt");
print OUT "$filenames";
close OUT;

$files = "tmp/files.txt";
open(IN_FILE, $files);
my @filesdata=<IN_FILE>;
close IN_FILE;

foreach $file (@filesdata){
chomp $file;
}