mirror of
https://github.com/flucont/btcloud.git
synced 2025-03-12 00:38:14 -04:00
fix
This commit is contained in:
parent
fdbbd304cb
commit
d8de902f1b
@ -523,6 +523,16 @@ class Api extends BaseController
|
||||
$result = Plugins::get_spider($type);
|
||||
return json($result);
|
||||
}
|
||||
|
||||
//获取堡塔恶意情报IP库
|
||||
public function btwaf_getmalicious(){
|
||||
try{
|
||||
$result = Plugins::btwaf_getmalicious();
|
||||
return json($result);
|
||||
}catch(\Exception $e){
|
||||
return json(['success'=>false, 'res'=>$e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
//检查是否国内IP
|
||||
public function check_cnip(){
|
||||
|
@ -196,12 +196,14 @@ class BtPlugins
|
||||
$data = str_replace('\'http://www.bt.cn/api/wpanel/notpro', 'public.GetConfigValue(\'home\')+\'/api/wpanel/notpro', $data);
|
||||
$data = str_replace('\'https://www.bt.cn/api/wpanel/notpro', 'public.GetConfigValue(\'home\')+\'/api/wpanel/notpro', $data);
|
||||
|
||||
$data = str_replace('"https://www.bt.cn/api/bt_waf/get_malicious', 'public.GetConfigValue(\'home\')+"/api/bt_waf/get_malicious', $data);
|
||||
$data = str_replace('\'http://www.bt.cn/api/bt_waf/getSpiders', 'public.GetConfigValue(\'home\')+\'/api/bt_waf/getSpiders', $data);
|
||||
$data = str_replace('\'https://www.bt.cn/api/bt_waf/getSpiders', 'public.GetConfigValue(\'home\')+\'/api/bt_waf/getSpiders', $data);
|
||||
$data = str_replace('\'http://www.bt.cn/api/bt_waf/addSpider', 'public.GetConfigValue(\'home\')+\'/api/bt_waf/addSpider', $data);
|
||||
$data = str_replace('\'https://www.bt.cn/api/bt_waf/addSpider', 'public.GetConfigValue(\'home\')+\'/api/bt_waf/addSpider', $data);
|
||||
$data = str_replace('\'https://www.bt.cn/api/bt_waf/getVulScanInfoList', 'public.GetConfigValue(\'home\')+\'/api/bt_waf/getVulScanInfoList', $data);
|
||||
$data = str_replace('\'https://www.bt.cn/api/bt_waf/reportInterceptFail', 'public.GetConfigValue(\'home\')+\'/api/bt_waf/reportInterceptFail', $data);
|
||||
$data = str_replace('"https://www.bt.cn/api/bt_waf/reportInterceptFail', 'public.GetConfigValue(\'home\')+"/api/bt_waf/reportInterceptFail', $data);
|
||||
$data = str_replace('\'https://www.bt.cn/api/v2/contact/nps/questions', 'public.GetConfigValue(\'home\')+\'/panel/notpro', $data);
|
||||
$data = str_replace('\'https://www.bt.cn/api/v2/contact/nps/submit', 'public.GetConfigValue(\'home\')+\'/panel/notpro', $data);
|
||||
$data = str_replace('\'http://www.bt.cn/api/Auth', 'public.GetConfigValue(\'home\')+\'/api/Auth', $data);
|
||||
@ -290,4 +292,16 @@ class BtPlugins
|
||||
}
|
||||
}
|
||||
|
||||
//获取堡塔恶意情报IP库
|
||||
public function btwaf_getmalicious(){
|
||||
$result = $this->btapi->btwaf_getmalicious();
|
||||
if(isset($result['success'])){
|
||||
return $result;
|
||||
}elseif(isset($result['msg'])){
|
||||
throw new Exception($result['msg']);
|
||||
}else{
|
||||
throw new Exception(isset($result['res'])?$result['res']:'获取失败');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -169,6 +169,18 @@ class Btapi
|
||||
$data = json_decode($result,true);
|
||||
return $data;
|
||||
}
|
||||
|
||||
//BTWAF-获取堡塔恶意情报IP库
|
||||
public function btwaf_getmalicious(){
|
||||
$url = $this->BT_PANEL.'/plugin?action=a&name=kaixin&s=btwaf_getmalicious';
|
||||
|
||||
$p_data = $this->GetKeyData();
|
||||
|
||||
$result = $this->curl($url,$p_data);
|
||||
|
||||
$data = json_decode($result,true);
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
private function GetKeyData(){
|
||||
|
@ -193,4 +193,11 @@ class Plugins
|
||||
return $result;
|
||||
}
|
||||
|
||||
//获取堡塔恶意情报IP库
|
||||
public static function btwaf_getmalicious(){
|
||||
$btapi = self::get_btapi('Linux');
|
||||
$result = $btapi->btwaf_getmalicious();
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
@ -28,11 +28,11 @@ class ThirdPlugins
|
||||
public function get_plugin_list()
|
||||
{
|
||||
if($this->os == 'en'){
|
||||
$url = $this->url . 'api/panel/get_plugin_list_en';
|
||||
$url = $this->url . 'api/panel/getSoftListEn';
|
||||
}elseif($this->os == 'Windows'){
|
||||
$url = $this->url . 'api/wpanel/get_plugin_list';
|
||||
$url = $this->url . 'api/wpanel/get_soft_list';
|
||||
}else{
|
||||
$url = $this->url . 'api/panel/get_plugin_list';
|
||||
$url = $this->url . 'api/panel/get_soft_list';
|
||||
}
|
||||
$res = $this->curl($url);
|
||||
$result = json_decode($res, true);
|
||||
@ -174,6 +174,18 @@ class ThirdPlugins
|
||||
}
|
||||
}
|
||||
|
||||
//获取堡塔恶意情报IP库
|
||||
public function btwaf_getmalicious(){
|
||||
$url = $this->url . 'api/bt_waf/get_malicious';
|
||||
$res = $this->curl($url);
|
||||
$result = json_decode($res, true);
|
||||
if(isset($result['success'])){
|
||||
return $result;
|
||||
}else{
|
||||
throw new Exception(isset($result['res'])?$result['res']:'获取失败');
|
||||
}
|
||||
}
|
||||
|
||||
private function curl($url, $post = 0){
|
||||
$ua = "Mozilla/5.0 (BtCloud; ".request()->root(true).")";
|
||||
return get_curl($url, $post, 0, 0, 0, $ua);
|
||||
|
@ -21,7 +21,6 @@ public/install/update_btmonitor.sh
|
||||
public/install/src/panel_7_en.zip
|
||||
public/install/update/LinuxPanel_EN-${Aapanel_Version}.zip
|
||||
public/install/install_7.0_en.sh
|
||||
public/install/install_pro_en.sh
|
||||
public/install/update_7.x_en.sh
|
||||
)
|
||||
|
||||
|
@ -121,6 +121,7 @@ Route::group('api', function () {
|
||||
Route::post('/v2/product/email', 'api/return_error2');
|
||||
|
||||
Route::any('/bt_waf/getSpiders', 'api/btwaf_getspiders');
|
||||
Route::any('/bt_waf/get_malicious', 'api/btwaf_getmalicious');
|
||||
Route::post('/bt_waf/addSpider', 'api/return_empty');
|
||||
Route::post('/bt_waf/getVulScanInfoList', 'api/return_empty');
|
||||
Route::post('/bt_waf/reportInterceptFail', 'api/return_empty');
|
||||
|
Loading…
Reference in New Issue
Block a user