gunguymadman 发表于 2008-07-02 16:39

(原创)tor下perl脚本刷网站流量

仅做技术交流,请不要作弊使用   
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 Tor v0.1.2.12-rc. Thisis experimental software. Do not rely on it for strong anonymity.
      Apr 13 19:42:34.966 Initialized libeventversion 1.3b using method epoll. Good.
      Apr 13 19:42:35.000 Opening Socks listeneron 127.0.0.1:9050
      Apr 13 19:42:37.178 I learned some moredirectory information, but not enough to build a circuit.
      Apr 13 19:44:37.198 I learned some moredirectory information, but not enough to build a circuit.   
      Apr 13 19:44:43.630 I learned some moredirectory information, but not enough to build a circuit.
      Apr 13 19:45:07.979 I learned some more directoryinformation, but not enough to build a circuit.
      Apr 13 19:45:09.541 We now have enoughdirectory information to build circuits.
      Apr 13 19:45:15.620 Tor has successfullyopened a circuit. Looks like client functionality is working.

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

2、安装并配置Privoxy
       yum install privoxy
或者tar包安装
需要普通用户安装
读安装文档可达
修改vi/usr/local/etc/privoxy/config(yum安装在/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=$_;
       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,$time,$time,$time;
}      

sub weighting {
      my $i=$_;
      my $j=int(rand($_));
      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 errorcount must >= $wavelengh !!\n";
      print "$now errorcount 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;

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;
      $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 "$nowdo it $ktime ";
                print FH " curl -s $goal[$goal_son] -A $header -e $refer\n";
                }
                else {
                        $error++;
                        $now=localtime;
                        print FH "$now do it $ktime ";
                        print FH " curl -s $goal[$goal_son] -A $header -e $refer\n";
                        }
      }
#
#
#end


$now=localtime;
print FH "$now ok, flux_cheatjob done !   $count times visit .$righttimes successand $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 编辑 ]

llzqq 发表于 2008-07-03 11:31

tor有多少个代理服务器,要是数量不够庞大,刷网站意义不大。

gunguymadman 发表于 2008-07-03 15:04

原帖由 llzqq 于 2008-7-3 11:31 发表 http://linux.chinaunix.net/bbs/images/common/back.gif
tor有多少个代理服务器,要是数量不够庞大,刷网站意义不大。
每一个使用tor的都可以设成出口         
而且我已给出换ip的脚本 可以让cron来定时换   默认的 不到10min换一个ip
只要几个脚本同时跑   一天k 10k级别没问题的

好玩狗 发表于 2014-04-28 22:45

本帖最后由 好玩狗 于 2014-04-28 22:45 编辑

好像需要安装浏览器,VPS能办到吗?
页: [1]
查看完整版本: (原创)tor下perl脚本刷网站流量