免费注册 查看新帖 |

Chinaunix

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

小偷程序 页面链接的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-01-27 00:55 |只看该作者 |倒序浏览
新人 刚开始弄代码 在学习一个简单的 小偷程序 遇到了 有关链接的问题  自己无法解决 望各位CU的大哥帮忙
谢谢



INDEX.PHP

<?php
require './commom.php';
update("index.htm");
$file=readfromfile("cache/index.htm");
$gyrj = cut($file,"Rechecked", "sign means SSL support");

?>

<?php echo $gyrj;

?>


config.php


<?php
$fromurl = "http://www.samair.ru/proxy/";
$flush="120";//update函数中自动同步更新时间
?>


GLOBAL.PHP



<?php
function open($file,$type=''){
global $fromurl,$referer;
$cachename=$file;
if($type){
$file=$fromurl.'/'.$type.'/'.$file;
}else{
$file=$fromurl.$file;
}




if($open=file($file)){
$count=count($open);
for($i=0;$i<$count;$i++){
$theget.=$open[$i];

}

}else{
die('请求过多,超时,请刷新');
}


return $theget;

}

function update($file,$type=''){
//更新cache中的文件
global $timestamp,$flush;
if(!file_exists("cache/$file")){
if($type){
$data=open($file,$type);
}else{
$data=open($file);
}

writetofile("cache/$file",$data);
}else{
$lastflesh=@filemtime("cache/$file");



if($lastflesh + ($flush * 60) < $timestamp ){
if($type){
$data=open($file,$type);
}else{
$data=open($file);
}
writetofile("cache/$file",$data);
}
}

}
function readfromfile($file_name) {
if($filenum=fopen($file_name,"r")){
flock($filenum,LOCK_SH);
$file_data=fread($filenum,filesize($file_name));
fclose($filenum);
return $file_data;
}else{
return false;
}

}


function writetofile($file_name,$data,$method="w") {
if($filenum=fopen($file_name,$method)){
flock($filenum,LOCK_EX);
$file_data=fwrite($filenum,$data);
fclose($filenum);
return $file_data;
}else{
return false;
}
}
function cut($file,$from,$end){

$message=explode($from,$file);
$message=explode($end,$message[1]);
return $message[0];
}
function updatecache($file,$cache=''){
global $timestamp,$flush;
if(!file_exists($file)){
writetofile($file,$cache);
$return=$cache;
}elseif(@filemtime($file) < $timestamp - ($flush * 60)){
writetofile($file,$cache);
$return=$cache;
}else{
$return=readfromfile($file);
}
return $return;
}
?>


COMMOM.PHP

<?php
include './config.php';
include './global.php';
?>-----------------------


演示地址 http://www.zanwen.org/cs/

把页面抓过来后
有 20个链接
如何把链接也抓过来?
谢谢!祝:大家新年快乐!

论坛徽章:
0
2 [报告]
发表于 2006-01-27 09:54 |只看该作者
这个程序貌似以前一个小偷教学帖里的例子

论坛徽章:
0
3 [报告]
发表于 2006-01-27 11:26 |只看该作者
原帖由 如如何 于 2006-1-27 09:54 发表
这个程序貌似以前一个小偷教学帖里的例子

就是 哪个小偷教学贴

论坛徽章:
0
4 [报告]
发表于 2006-01-27 11:52 |只看该作者
仔细看原理啊,而且这个最简单,链接都有规律的,呵呵
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP