宝塔面板7.4.5反代破解企业版教程

  • A+
所属分类:Linux

宝塔面板7.4.5反代破解企业版教程

前言

先来看看效果
宝塔面板7.4.5反代破解企业版教程

请输入图片描述

这篇教程写到最后的时候没提交上去,结果写了半天的东西白写了。
直接进入教程。

开始破解

新建一个网站,域名填写www.bt.cn

宝塔面板7.4.5反代破解企业版教程

请输入图片描述

进入该网站目录,新建bt.php,粘贴以下内容:

```
<?php

未设置请求参数不给请求

if(!isset($_GET['uri']) || $_SERVER["REMOTE_ADDR"] != "127.0.0.1"){
die("BT crack server 1.2");
}

$base_url = 'http://119.147.144.34';
foreach (getallheaders() as $key => $value) {
if($key == "Accept-Encoding"){
continue;
}
$httpHeader[] = $key . ": " . $value;
}

// # 记录请求
// $myfile = fopen("newfile.txt", "a") or die("Unable to open file!");
// $txt = "[GET]" . http_build_query($_GET,'',', ') . "\n";
// fwrite($myfile, $txt);
// $txt = "[POST]" . http_build_query($_POST,'',', ') . "\n";
// fwrite($myfile, $txt);
// $txt = "[HEADERS]" . http_build_query($httpHeader,'',', ') . "\n";
// fwrite($myfile, $txt);
// fclose($myfile);

判断GET参数

if($_GET['uri'] == "/api/panel/get_soft_list" || $_GET['uri'] == "/api/panel/get_soft_list_test") {
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, $base_url . $_GET['uri']);
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeader);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($_POST));
// $output contains the output string
$output = curl_exec($ch);
$output = json_decode($output, true);

foreach ($output['list'] as $key => &$value) {
    # 付费插件全部到期日期修改
    if(floatval($value['pid']) < 600000000){
        $value['endtime'] = 2493043200;
    }
}
$output['pro'] = 0;
$output['ltd'] = 2493043200;

// 返回JSON_ENCODE
echo(json_encode($output));
// close curl resource to free up system resources 
curl_close($ch);

}elseif ($_GET['uri'] == "/api/Plugin/check_plugin_status") {
$output['status'] = true;

// 返回JSON_ENCODE
echo(json_encode($output));

}elseif ($_GET['uri'] == "/api/panel/plugin_total"){
echo("1");
}elseif ($_GET['uri'] == "/api/coll/get_coll_plugin_list"){
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, $base_url . $_GET['uri']);
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeader);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($_POST));
// $output contains the output string
$output = curl_exec($ch);
$output = json_decode($output, true);

// $output['num'] = 99999;
// $output['endtime'] = 253402185600;

// # 记录请求
// $myfile = fopen("newfile.txt", "a") or die("Unable to open file!");
// $txt = "[DATA]" . json_encode($output) . "\n";
// fwrite($myfile, $txt);
// fclose($myfile);

// 返回JSON_ENCODE
echo(json_encode($output));
// close curl resource to free up system resources 
curl_close($ch);

}elseif ($_GET['uri'] == "/api/cloudtro/get_product_order_status"){
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, $base_url . $_GET['uri']);
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeader);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($_POST));
// $output contains the output string
$output = curl_exec($ch);
$output = json_decode($output, true);

if($_POST['uid'] != 0){
    $output['status'] = true;
    $output['msg'] = [];
    $output['msg']['endtime'] = 2493043200;
    $output['msg']['num'] = 99999;
}

// # 记录请求
// $myfile = fopen("newfile.txt", "a") or die("Unable to open file!");
// $txt = "[DATA]" . json_encode($output) . "\n";
// fwrite($myfile, $txt);
// fclose($myfile);

// 返回JSON_ENCODE
echo(json_encode($output));
// close curl resource to free up system resources 
curl_close($ch);

}

```

接着再设置伪静态:
宝塔面板7.4.5反代破解企业版教程

请输入图片描述

代码如下:

```
location /api {
proxy_pass http://119.147.144.34;
proxy_set_header Host $host;

  add_header X-Cache $upstream_cache_status;

  #Set Nginx Cache
  add_header Cache-Control no-cache;
  expires 12h;
}

location ~ ^/(api/Plugin/check_plugin_status|api/panel/get_soft_list|api/panel/notpro|api/panel/plugin_total|api/cloudtro/get_product_order_status|api/coll/get_coll_plugin_list) {
  try_files $uri $uri/ /bt.php?$query_string&uri=$uri;
}

```

最后修改一下目录/etc下的hosts文件,在最后一行添加:

```
127.0.0.1 www.bt.cn

```

即可。
最后再去软件商店看效果即可。
如果没有刷新出来点一下右上角的更新软件列表即可。

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的微信公众号
  • 我的微信公众号扫一扫
  • weinxin