首页 > 后端开发 > php教程 > 最简单的PHP小偷源码

最简单的PHP小偷源码

WBOY
发布: 2016-07-25 08:50:21
原创
1416 人浏览过
各位这只是简单的小偷程序,大家学习一下就好,不要做非法用途哈!!

不懂或者不会的请回复
  1. //-------------------------配置参数开始-------------------------
  2. //目标站网址
  3. $url="http://blog.0907.org";
  4. //当前文件名
  5. $thisname='index.php';
  6. //-------------------------配置参数结束-------------------------
  7. header("Content-type: text/html; charset=GBK");
  8. $server_url = preg_replace("/(http|https|ftp|news):\/\//i", "", $url);
  9. $server_url = preg_replace("/\/.*/", "", $server_url);
  10. $server_url = 'http://'.$server_url;
  11. $getid=$_SERVER["REQUEST_URI"];
  12. $scriptname=$_SERVER["SCRIPT_NAME"];
  13. $thisurl="http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
  14. if( preg_match('#(http|https|ftp|news):#iUs',$getid) ){
  15. header("Location:".$scriptname);
  16. exit;
  17. }
  18. if( preg_match('#'.$scriptname.'\/#iUs',$getid) ){
  19. $url=$server_url.'/'.str_ireplace($scriptname."/",'',stristr($getid,$scriptname."/"));
  20. }
  21. $thismulu=str_ireplace(stristr($_SERVER['PHP_SELF'],$thisname),'',$thisurl);
  22. function curl_get($url){
  23. if(function_exists('curl_init') && function_exists('curl_exec')){
  24. $ch = curl_init();
  25. $user_agent = "Mozilla/5.0+(compatible;+Baiduspider/2.0;++http://www.baidu.com/search/spider.html)";
  26. curl_setopt($ch, CURLOPT_URL, $url);
  27. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  28. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  29. curl_setopt($ch, CURLOPT_REFERER, "http://www.baidu.com/s?wd=%CA%B2%C3%B4");
  30. curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
  31. $data = curl_exec($ch);
  32. curl_close($ch);
  33. }else{
  34. for($i=0;$i $data = @file_get_contents($url);
  35. if($data) break;
  36. }
  37. }
  38. return $data;
  39. }
  40. function filter($str){
  41. global $server_url;
  42. $str=preg_replace("/]+>/si","",$str);
  43. $str=preg_replace("/\s+/", " ", $str);
  44. $str=preg_replace("//si","",$str);
  45. $str=preg_replace("/(.*?)/si","",$str);
  46. $str=preg_replace("//si","",$str);
  47. $str=preg_replace("/javascript/si","Javascript",$str);
  48. $str=preg_replace("/vbscript/si","Vbscript",$str);
  49. $str=preg_replace("/on([a-z]+)\s*=/si","On\\1=",$str);
  50. return $str;
  51. }
  52. function urlchange($str) {
  53. global $server_url,$scriptname,$thismulu;
  54. $str = preg_replace('/src=(["|\']?)\//', 'src=\\1'.$server_url.'/', $str);
  55. $str = preg_replace('/]+)href=(["|\']?)\/?/', ' $str = preg_replace('/]+)href=(["|\']?)\/?/', ' $str=str_ireplace('/javascript:;','#',$str);
  56. $str=str_ireplace('"'.$scriptname.'/"',$scriptname,$str);
  57. return $str;
  58. }
  59. function charset($str){
  60. if(preg_match('#]*charset\s*=\s*utf-8#iUs',$str)){
  61. $str=preg_replace('/charset\s*=\s*utf-8/i','charset=gb2312',$str);
  62. $str=iconv("UTF-8", "GB2312//IGNORE", $str);
  63. }
  64. return $str;
  65. }
  66. $body=urlchange(filter(charset(curl_get($url))));
  67. //-------------替换开始----------------------
  68. $body=preg_replace('#>精品推荐(.*)

" #si',"",$body);

  • //正则替换,这里我就不多说啦,PS:其实我也不大会正则
  • //PS:可写多个
  • $body=str_ireplace('action="/v"','action="index.php/v"',$body);
  • //$body=str_ireplace('您要替换的内容','你想替换成的内容',$body);
  • //PS:可写多个
  • //嘻嘻,欢迎大家去我博客做客
  • //------------替换结束------------------------
  • echo $body;
  • ?>
  • 复制代码


    相关标签:
    来源:php.cn
    本站声明
    本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
    热门教程
    更多>
    最新下载
    更多>
    网站特效
    网站源码
    网站素材
    前端模板