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.118.27.44
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 : password_v2.py
# coding: utf-8 # +------------------------------------------------------------------- # | aaPanel # +------------------------------------------------------------------- # | Copyright (c) 2015-2099 aaPanel(www.aapanel.com) All rights reserved. # +------------------------------------------------------------------- # | Author: lkqiang <lkq@aapanel.com> # +------------------------------------------------------------------- # +-------------------------------------------------------------------- # | 密码管理 # +-------------------------------------------------------------------- import sys, os if sys.version_info[0] == 2: reload(sys) sys.setdefaultencoding('utf-8') os.chdir('/www/server/panel') if not 'class/' in sys.path: sys.path.insert(0,'class/') import re import public,data,database,config class password: def __init__(self): self.__data=data.data() self.__database=database.database() self.__config=config.config() #设置面板密码 def set_panel_password(self,get): get.password1=get.password get.password2 = get.password data=self.__config.setPassword(get) return data #查看面板用户名 def get_panel_username(self,get): data=public.M('users').where("id=?", (1,)).getField('username') if data: return data else: return False # 设置root 密码 def set_root_password(self,get): public.ExecShell("echo"+get.user+":"+get.password+"|chpasswd") return True #查看mysql_root密码 def get_mysql_root(self,get): password = public.M('config').where("id=?",(1,)).getField('mysql_root') return public.returnMsg(True, password) #设置mysql_root 密码 def set_mysql_password(self,get): if 'password' in get: resutl=self.__database.SetupPassword(get) return resutl else: return public.returnMsg(False, public.lang("password参数不能为空")) # MySQL 的其他账户设置 #获取其他mysql的信息 def get_databses(self,get): data=public.M('databases').select() return public.returnMsg(True, data) # 修改MySQL 其他账户的密码 def rem_mysql_pass(self,get): ''' 参数 三个 id 数据库ID, name:数据库名称, password:数据库密码 ''' data=self.__database.ResDatabasePassword(get) return data # 修改其他Mysql 账户的权限 def set_mysql_access(self,get): ''' 参数 三个 name:数据库名称, dataAccess: 权限 access 权限 ''' data=self.__database.SetDatabaseAccess(get) return data #################### SSH 的基础设置#################### # 开启密码登陆 def SetPassword(self, get): ssh_password = '\n#?PasswordAuthentication\\s\\w+' file = public.readFile('/etc/ssh/sshd_config') if len(re.findall(ssh_password, file)) == 0: file_result = file + '\nPasswordAuthentication yes' else: file_result = re.sub(ssh_password, '\nPasswordAuthentication yes', file) self.Wirte('/etc/ssh/sshd_config', file_result) self.RestartSsh() return public.returnMsg(True, public.lang("开启成功")) # 设置ssh_key def SetSshKey(self, get): '''''' type_list = ['rsa', 'dsa'] ssh_type = ['yes', 'no'] ssh = get.ssh if not ssh in ssh_type: return public.returnMsg(False, public.lang("ssh选项失败")) type = get.type if not type in type_list: return public.returnMsg(False, public.lang("加密方式错误")) file = ['/root/.ssh/id_rsa.pub', '/root/.ssh/id_rsa', '/root/.ssh/authorized_keys'] for i in file: if os.path.exists(i): os.remove(i) public.ExecShell("ssh-keygen -t %s -P '' -f ~/.ssh/id_rsa |echo y" % type) if os.path.exists(file[0]): public.ExecShell('cat %s >%s && chmod 600 %s' % (file[0], file[-1], file[-1])) rec = '\n#?RSAAuthentication\\s\\w+' rec2 = '\n#?PubkeyAuthentication\\s\\w+' file = public.readFile('/etc/ssh/sshd_config') if len(re.findall(rec, file)) == 0: file = file + '\nRSAAuthentication yes' if len(re.findall(rec2, file)) == 0: file = file + '\nPubkeyAuthentication yes' file_ssh = re.sub(rec, '\nRSAAuthentication yes', file) file_result = re.sub(rec2, '\nPubkeyAuthentication yes', file_ssh) if ssh == 'no': ssh_password = '\n#?PasswordAuthentication\\s\\w+' if len(re.findall(ssh_password, file_result)) == 0: file_result = file_result + '\nPasswordAuthentication no' else: file_result = re.sub(ssh_password, '\nPasswordAuthentication no', file_result) self.Wirte('/etc/ssh/sshd_config', file_result) self.RestartSsh() return public.returnMsg(True, public.lang("开启成功")) else: return public.returnMsg(False, public.lang("开启失败")) # 关闭sshkey def StopKey(self, get): file = ['/root/.ssh/id_rsa.pub', '/root/.ssh/id_rsa', '/root/.ssh/authorized_keys'] rec = '\n#?RSAAuthentication\\s\\w+' rec2 = '\n#?PubkeyAuthentication\\s\\w+' file = public.readFile('/etc/ssh/sshd_config') file_ssh = re.sub(rec, '\n#RSAAuthentication no', file) file_result = re.sub(rec2, '\n#PubkeyAuthentication no', file_ssh) self.Wirte('/etc/ssh/sshd_config', file_result) self.SetPassword(get) self.RestartSsh() return public.returnMsg(True, public.lang("关闭成功")) # 读取配置文件 获取当前状态 def GetConfig(self, get): result = {} file = public.readFile('/etc/ssh/sshd_config') rec = '\n#?RSAAuthentication\\s\\w+' pubkey = '\n#?PubkeyAuthentication\\s\\w+' ssh_password = '\nPasswordAuthentication\\s\\w+' ret = re.findall(ssh_password, file) if not ret: result['password'] = 'no' else: if ret[-1].split()[-1] == 'yes': result['password'] = 'yes' else: result['password'] = 'no' pubkey = re.findall(pubkey, file) if not pubkey: result['pubkey'] = 'no' else: if pubkey[-1].split()[-1] == 'no': result['pubkey'] = 'no' else: result['pubkey'] = 'yes' rsa_auth = re.findall(rec, file) if not rsa_auth: result['rsa_auth'] = 'no' else: if rsa_auth[-1].split()[-1] == 'no': result['rsa_auth'] = 'no' else: result['rsa_auth'] = 'yes' return result # 关闭密码方式 def StopPassword(self, get): file = public.readFile('/etc/ssh/sshd_config') ssh_password = '\n#?PasswordAuthentication\\s\\w+' file_result = re.sub(ssh_password, '\nPasswordAuthentication no', file) self.Wirte('/etc/ssh/sshd_config', file_result) self.RestartSsh() return public.returnMsg(True, public.lang("关闭成功")) #显示key文件 def GetKey(self, get): file = '/root/.ssh/id_rsa' if not os.path.exists(file): return public.returnMsg(True, public.lang("")) ret = public.readFile(file) return public.returnMsg(True, ret) # 下载 def Download(self, get): if os.path.exists('/root/.ssh/id_rsa'): ret = '/download?filename=/root/.ssh/id_rsa' return public.returnMsg(True, ret) # 写入配置文件 def Wirte(self, file, ret): result = public.writeFile(file, ret) return result def RestartSsh(self): version = public.readFile('/etc/redhat-release') act = 'restart' if not os.path.exists('/etc/redhat-release'): public.ExecShell('service ssh ' + act) elif version.find(' 7.') != -1: public.ExecShell("systemctl " + act + " sshd.service") else: public.ExecShell("/etc/init.d/sshd " + act)
Close