MCPcopy Create free account
hub / github.com/aaPanel/BaoTa / ReadFile

Method ReadFile

class/webshell_check.py:70–87  ·  view source on GitHub ↗
(self, filename, mode='rb')

Source from the content-addressed store, hash-verified

68 public.writeFile(self.__mail_list_data, json.dumps(ret))
69
70 def ReadFile(self, filename, mode='rb'):
71 import os
72 if not os.path.exists(filename): return False
73 try:
74 fp = open(filename, mode)
75 f_body = fp.read()
76 fp.close()
77 except Exception as ex:
78 if sys.version_info[0] != 2:
79 try:
80 fp = open(filename, mode, encoding="utf-8")
81 f_body = fp.read()
82 fp.close()
83 except Exception as ex2:
84 return False
85 else:
86 return False
87 return f_body
88
89 # 返回配置邮件地址
90 def return_mail_list(self):

Callers 15

scanMethod · 0.95
scan_ruleMethod · 0.95
webshellchopMethod · 0.95
send_baota2Method · 0.95
send_baotaMethod · 0.95
panel_ssl_task.pyFile · 0.45
get_nginx_versionFunction · 0.45
remove_nginx_server_quicFunction · 0.45
phpmyadmin_php_versionFunction · 0.45

Calls 4

openFunction · 0.85
existsMethod · 0.45
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected