This is a Perl script written last year, and I haven't seen Perl since years ago.
Copy Code code as follows:
#!/usr/bin/perl
Use Lwp::simple;
Open (FILE, "<file");
while (<FILE>) {
s/^ip1.*//g;
My @file =split (/\,|\s+/,$_);
My @file1 = "$file [0] $file [1]";
My $IP = "$file [1]";
My $domain = "$file [0]";
My $url = "http://ip138.com/ips138.asp?ip= $IP &action=2″;
My $connet =get ("$url");
My @connet =split (/\n/, $connet);
foreach my $sc (@connet) {
if ($sc =~ m/td align= "center" ><ul><li> (. *?) <.*/) {
printf "%-40s%-20s%s\n", $domain, $IP, $;
}
}
}
Close (FILE);
The file files are formatted as follows
Copy Code code as follows:
conf.f.360.cn 113.105.246.71,113.105.246.78
u.qurl.f.360.cn 218.30.117.155,218.30.117.156
Config.dengluqi.net 127.0.0.1
Www.sina.com 61.172.201.194,61.172.201.195
Dns.msftncsi.com 131.107.255.255
Ptlogin2.qq.com 222.73.82.34
Results
Copy Code code as follows: