diff --git a/app/script/convert.sh b/app/script/convert.sh index 92f1a1d..8384ca6 100644 --- a/app/script/convert.sh +++ b/app/script/convert.sh @@ -2,7 +2,7 @@ Linux_Version="7.9.10" Windows_Version="7.8.0" -Btm_Version="2.1.7" +Btm_Version="2.2.1" FILES=( public/install/src/panel6.zip diff --git a/install.sql b/install.sql index 65d7893..8946163 100644 --- a/install.sql +++ b/install.sql @@ -18,9 +18,9 @@ INSERT INTO `cloud_config` (`key`, `value`) VALUES ('new_version_win', '7.8.0'), ('update_msg_win', '暂无更新日志'), ('update_date_win', '2022-12-08'), -('new_version_btm', '2.1.7'), +('new_version_btm', '2.2.1'), ('update_msg_btm', '暂无更新日志'), -('update_date_btm', '2023-05-18'), +('update_date_btm', '2023-06-01'), ('updateall_type', '0'), ('syskey', 'UqP94LtI8eWAIgCP'); diff --git a/public/install/src/bt-monitor-2.1.7.zip b/public/install/src/bt-monitor-2.2.1.zip similarity index 75% rename from public/install/src/bt-monitor-2.1.7.zip rename to public/install/src/bt-monitor-2.2.1.zip index 1e5b4a1..026a91e 100644 Binary files a/public/install/src/bt-monitor-2.1.7.zip and b/public/install/src/bt-monitor-2.2.1.zip differ diff --git a/public/install/src/panel6.zip b/public/install/src/panel6.zip index d052965..815d11b 100644 Binary files a/public/install/src/panel6.zip and b/public/install/src/panel6.zip differ diff --git a/public/install/update/LinuxPanel-7.9.10.zip b/public/install/update/LinuxPanel-7.9.10.zip index 0fd018f..1fdd708 100644 Binary files a/public/install/update/LinuxPanel-7.9.10.zip and b/public/install/update/LinuxPanel-7.9.10.zip differ diff --git a/wiki/btmonitor.md b/wiki/btmonitor.md index 841164d..d930f2a 100644 --- a/wiki/btmonitor.md +++ b/wiki/btmonitor.md @@ -10,7 +10,7 @@ 极少数文件解密失败是正常现象可无视 -- 全局搜索替换 https://api.bt.cn => http://www.example.com +- 全局搜索替换 https://api.bt.cn => http://www.example.com(需排除/bt_monitor/latest_agent_version) - 全局搜索替换 https://www.bt.cn/api/ => http://www.example.com/api/(需排除/panel/get_ip_info) diff --git a/wiki/files/linux/PluginLoader.py b/wiki/files/linux/PluginLoader.py index f8fb2e1..06d50fc 100644 --- a/wiki/files/linux/PluginLoader.py +++ b/wiki/files/linux/PluginLoader.py @@ -3,7 +3,7 @@ import public,os,sys,json #获取插件列表(0/1) def get_plugin_list(force = 0): - api_root_url = 'http://www.example.com' + api_root_url = 'https://api.bt.cn' api_url = api_root_url+ '/panel/get_plugin_list' cache_file = 'data/plugin_list.json' @@ -123,14 +123,91 @@ def path_check(path): #数据加密 def db_encrypt(data): - result = {} - result['status'] = True - result['msg'] = data + try: + key = __get_db_sgin() + iv = __get_db_iv() + str_arr = data.split('\n') + res_str = '' + for data in str_arr: + if not data: continue + res_str += __aes_encrypt(data, key, iv) + except: + res_str = data + result = { + 'status' : True, + 'msg' : res_str + } return result #数据解密 def db_decrypt(data): - result = {} - result['status'] = True - result['msg'] = data + try: + key = __get_db_sgin() + iv = __get_db_iv() + str_arr = data.split('\n') + res_str = '' + for data in str_arr: + if not data: continue + res_str += __aes_decrypt(data, key, iv) + except: + res_str = data + result = { + 'status' : True, + 'msg' : res_str + } return result + +def __get_db_sgin(): + keystr = '3gP7+k_7lSNg3$+Fj!PKW+6$KYgHtw#R' + key = '' + for i in range(31): + if i & 1 == 0: + key += keystr[i] + return key + +def __get_db_iv(): + div_file = "{}/data/div.pl".format(public.get_panel_path()) + if not os.path.exists(div_file): + str = public.GetRandomString(16) + str = __aes_encrypt_module(str) + div = public.get_div(str) + public.WriteFile(div_file, div) + if os.path.exists(div_file): + div = public.ReadFile(div_file) + div = __aes_decrypt_module(div) + else: + keystr = '4jHCpBOFzL4*piTn^-4IHBhj-OL!fGlB' + div = '' + for i in range(31): + if i & 1 == 0: + div += keystr[i] + return div + +def __aes_encrypt_module(data): + key = 'Z2B87NEAS2BkxTrh' + iv = 'WwadH66EGWpeeTT6' + return __aes_encrypt(data, key, iv) + +def __aes_decrypt_module(data): + key = 'Z2B87NEAS2BkxTrh' + iv = 'WwadH66EGWpeeTT6' + return __aes_decrypt(data, key, iv) + +def __aes_decrypt(data, key, iv): + from Crypto.Cipher import AES + import base64 + encodebytes = base64.decodebytes(data.encode('utf-8')) + aes = AES.new(key.encode('utf-8'), AES.MODE_CBC, iv.encode('utf-8')) + de_text = aes.decrypt(encodebytes) + unpad = lambda s: s[0:-s[-1]] + de_text = unpad(de_text) + return de_text.decode('utf-8') + +def __aes_encrypt(data, key, iv): + from Crypto.Cipher import AES + import base64 + data = (lambda s: s + (16 - len(s) % 16) * chr(16 - len(s) % 16).encode('utf-8'))(data.encode('utf-8')) + aes = AES.new(key.encode('utf8'), AES.MODE_CBC, iv.encode('utf8')) + encryptedbytes = aes.encrypt(data) + en_text = base64.b64encode(encryptedbytes) + return en_text.decode('utf-8')