Category: Script Keywords: LB leobbsx
#!/usr/bin/perl #Save this code as water.pl #Usage:perl water.pl #Author: Fayland@www.1313s.com #use strict; use LWP::UserAgent; #use HTTP::Cookies; #use HTTP::Headers; use HTTP::Request; #use HTTP::Response; #my $brower = 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)'; my $ua = new LWP::UserAgent; #$ua->agent($brower); #my $header = new HTTP::Headers; #$header->content_type('application/x-www-form-urlencoded'); my $count = 1; my $sleeptime = 1; #按 Ctrl+c 退出 while (1) { #不重复标题内容的帖 my $rands = rand(1000); #membername 注册的用户名, password 密码 #forum 论坛id号, intopictitle 标题, inpost 内容 my $content = "action=addnew&forum=1&membername=test&password=testtest&intopictitle=1313s.com-$rands&inpost=1313s.com-$rands"; #http://192.168.0.44/*/post.cgi为目标地址 my $request = new HTTP::Request('GET',"http://192.168.0.44/cgi-bin/lb/post.cgi?$content"); #$header->content_length(length($content)); #my $request = new HTTP::Request('POST',"http://192.168.0.44/cgi-bin/lb/post.cgi",$header,$content); my $response = $ua->request($request); #连接不成功,可能目标地址错误或者其他 if (! $response->is_success) { die "failed reason: ", $response->status_line; } #返回的网页内容中有“成功” if ($response->content=~ /成功/) { print "success $count"; $count++; } #查找灌水机制的时间,并调整 sleep time elsif ($response->content =~ /待.+?([0-9]+).+?秒/) { $sleeptime = $1; print "faied,reason is 灌水预防机制,and we changed the sleep time,Don't worry"; } else { print "faied,reason unkown!"; } #For 灌水预防机制 print ",wait $sleeptime seconds\n"; sleep $sleeptime; }