def check_core_alteration(self, dir_path, version_core, core_url):
alterations = []
ignored = ["modules", "CHANGELOG.txt", "COPYRIGHT.txt", "LICENSE.txt", "MAINTAINERS.txt",
"INSTALL.txt", "README.txt"]
temp_directory = uCMS.TempDir.create()
log.print_cms("info", "[+] Checking core alteration", "", 0)
try:
response = requests.get(core_url)
response.raise_for_status()
if response.status_code == 200:
zip_file = zipfile.ZipFile(io.BytesIO(response.content), 'r')
zip_file.extractall(temp_directory)
zip_file.close()
except requests.exceptions.HTTPError as e:
msg = "[-] The original drupal archive has not been found. Search " \
"manually ! "
log.print_cms("alert", msg, "", 0)
return msg, e
clean_core_path = os.path.join(temp_directory, "drupal-" + version_core)
dcmp = dircmp(clean_core_path, dir_path, ignored)
uCMS.diff_files(dcmp, alterations, dir_path)
return alterations, None
评论列表
文章目录