朕用织梦做网站,总有刁民想害朕

摘要:对的,没错,小千的网站,用织梦CMS程序做的,最近,总有那么一些刁民,使用软件扫描本站漏洞。下面,小千教大家一个方法,让那些使用软件扫描漏洞的,看到以后,都是绕道走的存在。

我不知道是谁,从哪里听到的结论,只要是织梦的程序搭建的网站,就是特别的不安全,极其的容易被盯上,极其的容易被挂码。今天,小千就教大家一个网站防刷的方法,让那些只会使用软件扫描漏洞的小朋友,看到以后,都是绕道走的存在。

那么,具体的方法是啥?看《织梦CMS漏洞:织梦网站搜索被同行恶意刷关键词了的解决办法》一文,之前,小千写过这么一篇文章,讽刺了那些,利用同行刷网站排名的小伙,现在,如果你要当只会使用软件的黑客,作为站长,我也要好好的利用一下。

不要以为,你使用软件,扫描别人的网站,那站长会不知道,那都是不存在的,恰恰相反,你使用软件扫描别人的网站,站长只要一看网站日志,就什么都一目了然了。现在的宝塔面板,功能真的是强悍如斯,不能伪造IP、不能随机IP、不能伪造user-agent、不伪造referer来路、这些所有来访记录,都明明白白的写入网站日志。

作为站长,你告诉我,拿别人的网站来试压,这将是你最愚蠢的选择,特别是备案的网站,或者是稍微大型点的网站,如有损失,别人都是直接报警的存在。所以,软件黑客高手们,醒醒吧,这个世界上,没有那么无聊的黑客,没有哪个真黑客傻到会去黑一个织梦网站,那些扫描织梦漏洞的,都是只会使用软件工具扫描漏洞的小朋友。

我就写一句代码,我就能让那些使用软件的小朋友看到以后,都是绕道走的存在,代码如下,作为一个程序员,你就自己满满的去品尝了。

一、404页面用伪静态

先把你的网站404页面,改为 404.php 用PHP做404页面。

二、404页面的伪静态规则

Apache伪静态规则

RewriteEngine on
RewriteRule ^404.html$ 404.php

Nginx伪静态规则

rewrite ^/404.html$ /404.php;

三、404.php文件代码

<?php 
error_reporting(0); 
header('Content-type:text/html;charset=utf-8');
$gogogogo = 'https://www.baidu.com/link?url=jj_7JrkvCvg8eoUlZLlTjOkyCSpekYmLXF9srZooWYi&wd=&eqid=c8b7f9ac0000a9e1000000066402e84d';
$musukg = '15';//秒后跳转
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="x-dns-prefetch-control" content="on">
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
<meta name="renderer" content="webkit">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta http-equiv="Cache-Control" content="no-transform"/>
<meta http-equiv="Cache-Control" content="no-siteapp"/>
<title>您访问的页面找不到了,正在读取新数据,页面正在载入中,请稍后...</title>
<meta name="keywords" content="您访问的页面找不到了,正在读取新数据,页面正在载入中,请稍后..."/>
<meta name="description" content="您访问的页面找不到了,正在读取新数据,页面正在载入中,请稍后..."/>
<style type="text/css">
body{margin:0;padding:0;font-family:PingFang SC,Microsoft YaHei,WenQuanYi Micro Hei,sans-serif}a,button.submit{color:#6e7173;text-decoration:none;-webkit-transition:all .1s ease-in;-moz-transition:all .1s ease-in;-o-transition:all .1s ease-in;transition:all .1s ease-in}a:active,a:hover{color:#6e7173}.body404{position:absolute;height:100%;width:100%;background:#fff;background-size:auto 100%}.site-name404{margin:0 auto;text-align:center;letter-spacing:2px;font-size:150px;line-height:1;font-weight:100;color:#000;background-image:-webkit-linear-gradient(92deg,#000,#202935);-webkit-background-clip:text;-webkit-text-fill-color:transparent;-webkit-animation:hue 10s infinite linear}.site-name404 h1{margin:0 0 10px;font-size:50px;line-height:1.2}.title404 span{margin:0 5px;font-weight:700}.title404 p{font-size:20px;line-height:1.5;margin:0;color:#7b8993}.info404{position:absolute;top:50%;text-align:center;width:100%;margin-top:-160px}.index404{margin-top:24px;display:inline-block;white-space:nowrap;cursor:pointer;letter-spacing:1px;font-size:14px;-moz-user-select:-moz-none;-webkit-user-select:none;-ms-user-select:none;-o-user-select:none;user-select:none;text-shadow:none;border:2px solid #7b8993;line-height:36px;text-align:center;padding:0 25px;border-radius:25px;background-color:#fff;color:#7b8993}
</style>
<script type="text/javascript">var num=<?php echo $musukg; ?>;function redirect(){num--;document.getElementById("num").innerHTML=num;if(num<0){document.getElementById("num").innerHTML=0;location.href="<?php echo $gogogogo; ?>"}}setInterval("redirect()",1000);</script>
<script type="text/javascript">
jQuery(function() {
    jQuery('#loading-one').empty().append('数据读取完成,页面加载完毕...').parent().fadeOut('slow');
});
</script>
</head>
<body>
<div id="loading" style="position:fixed!important;top:0;left:0;height:100%;width:100%;z-index:999;background:#000;opacity:0.6;font-size:16px;">
<p id="loading-one" style="color:#fff;position:absolute;top:50%;left:50%;margin:50px 0 0 -50px;background-color:#000;opacity:0.6;">正在读取数据,页面正在载入中,请稍后...</p>
</div>
<div class="body404">
  <div class="info404">
    <header id="header404"class="clearfix">
      <div class="site-name404">404</div>
    </header>
    <section>
      <div class="title404">
        <p>很抱歉,您访问的页面找不到了<br>
          <span id="num"><?php echo $musukg; ?></span>秒后自动跳转到主页</p>
      </div>
      <a href="<?php echo $gogogogo; ?>" class="index404">返回首页</a></section>
  </div>
</div>
</body>
</html>

当然,你也可以参考《小千开发日记:谷歌蜘蛛不遵循 Robots.txt 的解决办法》一文,能实现判断搜索引擎和用户,这样就更不会错失流量啦。

完成,对的,没错,我就是写这么一个简单的代码,就能完美的实现,让那些使用软件找网站漏洞的小朋友,看到以后,都是绕道走的存在。让用户帮我刷排名、然后跳转时间整久点,这样才会更加稳定,你懂的吧。

以上便是小千给大家分享的朕用织梦做网站,总有刁民想害朕,希望对大家有所帮助,如果想了解更多网站优化、SEO教程,请关注小千资源网吧~

版权声明:本文为博主原创文章,未经博主允许不得转载。http://nikucms.com/w/940.html

建站教程2023-03-04

织梦爱好者

织梦爱好者织梦爱好者注册会员

没有挖不倒的墙角,只有不努力的小三!

猜你喜欢

优惠券