免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4767 | 回复: 3
打印 上一主题 下一主题

(原创)tor下perl脚本刷网站流量 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-07-02 16:39 |只看该作者 |倒序浏览
仅做技术交流,请不要作弊使用   
Tor 是一个由虚拟通道组成的网络,团体和个人用它来保护自己在互联网上的隐私和安全。同时它使得软件开发人员能够创建具有内建隐私保护特性的新的通信工具。 Tor 为一系列应用提供了基础,通过这些应用,组织和个人可以在公开的网络上分享信息而不必担心隐私受到威胁。
个人使用 Tor 避免网站追踪他们和他们的家庭成员,或者连接到被本地 ISP 封锁的新闻站点、即时通讯服务等等。 Tor 的隐匿服务(hidden services)使得用户能够发布网站和其他服务而不必泄露站点的位置。

1、下载并安装Tor
    用下面的网址这里下载Tor的最新发布版本源程序:http://tor.eff.org/dist/tor-0.1.2.12-rc.tar.gz
在编译Tor之前,首先要安装 libevent,并确认已安装 openssl zlib(系统中已经安装了)。
下载、解压、编译和安装libevent
     wget http://www.monkey.org/~provos/libevent-1.3b.tar.gz
     tar xvzf libevent-1.3b.tar.gz
     cd libevent-1.3b
     ./configure
     make
    make install   

下载、解压、编译和安装Tor
      wget http://tor.eff.org/dist/tor-0.1.2.12-rc.tar.gz
      tar xvzf tor-0.1.2.12-rc.tar.gz
      cd tor-0.1.2.12-rc

./configure
--with-libevent-dir=/usr/local/lib
      make
     make install
   
cp/usr/local/etc/tor/torrc.sample /usr/local/etc/tor/torrc

运行Tor:
      loongson@debian:~/tor-0.1.2.12-rc$ /usr/local/bin/tor
      Apr 13 19:42:34.963 [notice] Tor v0.1.2.12-rc. Thisis experimental software. Do not rely on it for strong anonymity.
      Apr 13 19:42:34.966 [notice] Initialized libeventversion 1.3b using method epoll. Good.
      Apr 13 19:42:35.000 [notice] Opening Socks listeneron 127.0.0.1:9050
      Apr 13 19:42:37.178 [notice] I learned some moredirectory information, but not enough to build a circuit.
      Apr 13 19:44:37.198 [notice] I learned some moredirectory information, but not enough to build a circuit.   
      Apr 13 19:44:43.630 [notice] I learned some moredirectory information, but not enough to build a circuit.
      Apr 13 19:45:07.979 [notice] I learned some more directoryinformation, but not enough to build a circuit.
      Apr 13 19:45:09.541 [notice] We now have enoughdirectory information to build circuits.
      Apr 13 19:45:15.620 [notice] Tor has successfullyopened a circuit. Looks like client functionality is working.

   Torsocks方式提供网络服务,如果要用FireFox浏览网站,还需要一个代理服务器软件Privoxy

2、安装并配置Privoxy
       yum install privoxy
或者tar包安装
需要普通用户安装
读安装文档可达
修改vi/usr/local/etc/privoxy/configyum安装在/etc/privoxy)文件,在文件的开头加入一行:
      listen-address
127.0.0.1:8118
    重新运行privoxy:
      killall privoxy
      /usr/sbin/privoxy /usr/local/privoxy/config

或者tar安装的
/usr/local/sbin/privoxy --user privoxy /usr/local/etc/privoxy/config

more torch.sh
#!/usr/bin/expect -f
# telnet into tor and get clean path usingexpect

spawn telnet 127.0.0.1 9051
expect "Escape character is'^]'."
send "AUTHENTICATE\r"
expect "250 OK"
send "signal NEWNYM\r"
expect "250 OK"
send "quit\r"

# eos

此脚本切换目前tor代理ip






perl脚本  使用privoxy代理 ,ip10分钟内换一个,search一个页面的url,
保存于@goal内

然后用代理随机(时间,页面,header,ip,访问次数)
最后发信报告结果  
more torch.sh
#!/usr/bin/expect -f
# telnet into tor and get clean path usingexpect

spawn telnet 127.0.0.1 9051
expect "Escape character is'^]'."
send "AUTHENTICATE\r"
expect "250 OK"
send "signal NEWNYM\r"
expect "250 OK"
send "quit\r"

# eos

此脚本切换目前tor代理ip
more flux_cheat.pl
#!usr/bin/perl  -w
use Date::Format;
use Time::ParseDate;
use Date::Manip;


# 20080620, by pjxu
# do it every day in crontab  
# begin first about 9:00am , stop in night , sleep some seconds, sat and sun do it litter
# log at

my ( $i,$j,$k,$goal,$goal_son,$refer_orig,$refer ,$mark);
my ( $count, $sleep_time , $litter_sleep ,$time ,$now );
my ( $weight,$header,@header,$wavelengh );

################################################################################################################################
$goal="http://www.xxx.com/";
$mark="xx";
$sleep_time=36000;
$litter_sleep=20;
$count=1500;
$wavelengh=300;

sub refer {
       my $refer_prefix=$_[0];
       my @a=(int(rand(10)),
              int(rand(10)),
              int(rand(10)),
              int(rand(10)),
              int(rand(10)),
              int(rand(10)),
              int(rand(10)),
              int(rand(10)),
              int(rand(10))
              );
       my @b=(int(rand(10)),
              int(rand(10)),
              int(rand(10)),
              int(rand(10)),
              int(rand(10)),
              int(rand(10)),
              int(rand(10)),
              int(rand(10)),
              int(rand(10))
              );
       return join("",$refer_prefix,@a,"-",@b);
}
sub date {
       my $time=localtime;
       my @time=split(" ",$time);
       return $time[0],$time[1],$time[2],$time[4];
}      

sub weighting {
        my $i=$_[0];
        my $j=int(rand($_[1]));
        my $k=int(rand(2));
        if ( $k == 1 )  {
                 $i+=$j;
                 return $i;
        }
        else {
                 $i-=$j;
                 return $i;
        }
}


my ($week,$mon,$day,$year)=&date;

open (FH,">>/var/log/$mark/$year-$mon-$day-$mark.log") || die print "cannot open file: $!\n";
$now = localtime;
print FH "\n\n\n$now flux_cheat begin work  ";

if ( $week =~ /Sat/ ) {
        $weight=0.9;
        }
        elsif ( $week =~ /Sun/ ) {
                $weight=0.8;
                }
                else { $weight=1; }
print FH "   weight is $weight   ";



################################################################################################################################

#$now=localtime;
print FH "   now big sleep .......   \n";
sleep ( int( rand($sleep_time) ) );



################################################################################################################################
###   count must big than $wavelengh
# make the count out
if ( $count <= $wavelengh ) {
        print FH "$now error  count must >= $wavelengh !!\n";
        print "$now error  count must >= wavelengh !!\n";
        close FH;
        `perl  /root/sendEmail -f mail -t mail -u " flux cheat about youku "      -m < /var/log/$mark/$year-$mon-$day-$mark.log ` || die print "cann't do it\n ";
        exit;
}
else {
        $count=int( ( &weighting($count,$wavelengh) ) * $weight );
}
$now=localtime;
print FH "$now weak up ,   i will visit  $count times now \n";





@header = (    "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; InfoPath.1)",
               "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)",
               "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)",
               "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; WPS)",
               "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)",
               "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)",
               "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Maxthon; Maxthon)",
               "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; QQDownload 1.7; GreenBrowser)",
               "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; InfoPath.2)",
               "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506)",
               "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; cafe8)"
       );




# begin
#
#

$refer_orig="http://www.head.com/";
$refer=&refer( $refer_orig );
$header=$header[int(rand($#header))];

my ( @goal,@xxx , $right,$error,$flush );

@xxx  = `curl -s $goal -A "$header" -e $refer  -x 127.0.0.1:8118 --connect-timeout 30   |  egrep -o --regexp="http://***..html" | sort | uniq | grep -v " "`;


@goal=@xxx;
$right=$error=0;

if ( $#goal <= 3 ) {
        $error++;
        $now=localtime;
        print FH "$now error ,  too low pages can view  , only $#goal    \n";
        close FH;
        `perl  /root/sendEmail -f mail -t mail -u " flux cheat about xxx "      -m < /var/log/$mark/$year-$mon-$day-$mark.log ` || die print "cann't do it\n ";
        exit;
        }  #  if
for ( $i=0;$i<$count;$i++ ) {

        # sleep some seconds
        sleep int(rand($litter_sleep));


        # get the new goal , new header and new refer
        $goal_son=int( rand($#goal) );
        $refer=&refer( $refer_orig );
        $header=$header[int(rand($#header))];
        $k=$i+1;

        $flush=`curl -s $goal[$goal_son] -A "$header" -e $refer --connect-timeout 20 -x 127.0.0.1:8118 2>&1` ;
        if ( $flush =~ /$mark/ ) {
                $right++;
                $now=localtime;
                print FH "$now  do it $k  time ";
                print FH " curl -s $goal[$goal_son] -A $header -e $refer  \n";
                }
                else {
                        $error++;
                        $now=localtime;
                        print FH "$now do it $k  time ";
                        print FH " curl -s $goal[$goal_son] -A $header -e $refer  \n";
                        }
        }
#
#
#end


$now=localtime;
print FH "$now ok, flux_cheat  job done !   $count times visit .  $right  times success  and $error times fail \n";
close FH;

`perl  /root/sendEmail -f mail -t mail -u " flux cheat about xxx "      -m < /var/log/$mark/$year-$mon-$day-$mark.log ` || die print "cann't do it\n ";

[ 本帖最后由 gunguymadman 于 2008-7-2 16:45 编辑 ]

评分

参与人数 1可用积分 +5 收起 理由
cryboy2001 + 5 赞一个!

查看全部评分

论坛徽章:
0
2 [报告]
发表于 2008-07-03 11:31 |只看该作者
tor有多少个代理服务器,要是数量不够庞大,刷网站意义不大。

论坛徽章:
0
3 [报告]
发表于 2008-07-03 15:04 |只看该作者
原帖由 llzqq 于 2008-7-3 11:31 发表
tor有多少个代理服务器,要是数量不够庞大,刷网站意义不大。

每一个使用tor的都可以设成出口         
而且我已给出换ip的脚本 可以让cron来定时换   默认的 不到10min换一个ip  
只要几个脚本同时跑   一天k 10k级别没问题的

论坛徽章:
1
辰龙
日期:2014-05-05 11:25:49
4 [报告]
发表于 2014-04-28 22:45 |只看该作者
本帖最后由 好玩狗 于 2014-04-28 22:45 编辑

好像需要安装浏览器,VPS能办到吗?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP