diff --git a/libs/task/android_task.py b/libs/task/android_task.py index 17d96cf..ac8e928 100644 --- a/libs/task/android_task.py +++ b/libs/task/android_task.py @@ -37,15 +37,26 @@ class AndroidTask(object): def __decode_file__(self,file_path): apktool_path = str(cores.apktool_path) - output_path = str(cores.output_path) backsmali_path = str(cores.backsmali_path) - suffix_name = file_path.split(".")[-1] + base_out_path = str(cores.output_path) + filename = os.path.basename(file_path) + suffix_name = filename.split(".")[-1] + if suffix_name == "apk": + name = filename.split(".")[0] + output_path = os.path.join(base_out_path,name) self.__decode_apk__(file_path,apktool_path,output_path) elif suffix_name == "dex": - with open(file_path,'rb') as f: - dex_md5 = str(hashlib.md5().update(f.read()).hexdigest()).upper() - self.file_identifier.append(dex_md5) + f = open(file_path,'rb') + md5_obj = hashlib.md5() + while True: + r = f.read(1024) + if not r: + break + md5_obj.update(r) + dex_md5 = md5_obj.hexdigest().lower() + self.file_identifier.append(dex_md5) + output_path = os.path.join(base_out_path,dex_md5) self.__decode_dex__(file_path,backsmali_path,output_path) else: return "error" diff --git a/libs/task/base_task.py b/libs/task/base_task.py index 0995312..a007622 100644 --- a/libs/task/base_task.py +++ b/libs/task/base_task.py @@ -75,9 +75,6 @@ class BaseTask(object): cacar_path = cache_info["path"] types = cache_info["type"] - print(os.path.exists(cacar_path)) - print(cores.download_flag) - if (not os.path.exists(cacar_path) and cores.download_flag): print("[-] File download failed! Please download the file manually and try again.") return task_info @@ -147,7 +144,7 @@ class BaseTask(object): self.domain_history_list.append(domain) domain_count = lines.count(line) if domain_count >= cout: - config.filter_no.append(domain) + config.filter_no.append(".*" + domain) f.close() diff --git a/libs/task/download_task.py b/libs/task/download_task.py index abc29eb..111ccf6 100644 --- a/libs/task/download_task.py +++ b/libs/task/download_task.py @@ -32,9 +32,10 @@ class DownloadTask(object): file_name = create_time + ".html" if not(path.startswith("http://") or path.startswith("https://")): - if not os.path.isdir(path): + if not os.path.isdir(path): # 不是目录 return {"path":path,"type":types} - else: + else: # 目录处理 + return {"path":path,"type":types} else: print("[*] Detected that the task is not local, preparing to download file......") diff --git a/libs/task/net_task.py b/libs/task/net_task.py index 6cd11df..002ef56 100644 --- a/libs/task/net_task.py +++ b/libs/task/net_task.py @@ -70,7 +70,7 @@ class NetTask(object): if (("http://" in result) or ("https://" in result)) and ("." in result): domain = result.replace("https://","").replace("http://","") - if "{" in result or "}" in result or "[" in result or "]" in result: + if "{" in result or "}" in result or "[" in result or "]" in result or "\\" in result or "!" in result or "," in result: continue if "/" in domain: diff --git a/update.md b/update.md index 3f6310d..64fdb5c 100644 --- a/update.md +++ b/update.md @@ -6,7 +6,11 @@ - 优化配置文件相关的参数信息 - 优化部分代码执行逻辑 - 优化README.md内容 +- 优化域名过滤规则 - 修复自动下载进度问题 +- 修复以目录的方式对Android反编译原目录被覆盖的问题 +- 修复AI分析完毕后不能很好过滤的问题 + ### V1.0.6 - 新增AI智能分析快速过滤第三方URL地址