defineCMS.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:comission 作者: Intrinsec 项目源码 文件源码
def check_core_alteration(self, dir_path, core_url):
        alterations = []
        ignored = [".git", "cache", "plugins", "themes", "images", "license.txt", "readme.html",
                   "version.php"]

        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 WordPress archive has not been found. Search manually ! "
            log.print_cms("alert", msg, "", 0)
            return msg, e

        clean_core_path = os.path.join(temp_directory, "wordpress")

        dcmp = dircmp(clean_core_path, dir_path, ignored)
        uCMS.diff_files(dcmp, alterations, dir_path)

        if alterations is not None:
            msg = "[+] For further analysis, archive downloaded here : " + clean_core_path
            log.print_cms("info", msg, "", 1)

        return alterations, None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号