Skip to content

Commit

Permalink
1. 优化域名过滤规则 2. 修复以Android模式进行目录扫描时反编译原目录被覆盖的问题 3. 修复AI智能分析后不能得到过滤的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kelvin_ben authored and Your Name committed Dec 8, 2020
1 parent a940a8d commit 4af089f
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 12 deletions.
21 changes: 16 additions & 5 deletions libs/task/android_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,26 @@ def start(self):

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"
Expand Down
5 changes: 1 addition & 4 deletions libs/task/base_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ def __tast_control__(self):
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
Expand Down Expand Up @@ -147,7 +144,7 @@ def __history_handle__(self):
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()


5 changes: 3 additions & 2 deletions libs/task/download_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ def start(self,path,types):
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......")
Expand Down
2 changes: 1 addition & 1 deletion libs/task/net_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def __write_result_to_txt__(self):
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:
Expand Down
4 changes: 4 additions & 0 deletions update.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
- 优化配置文件相关的参数信息
- 优化部分代码执行逻辑
- 优化README.md内容
- 优化域名过滤规则
- 修复自动下载进度问题
- 修复以目录的方式对Android反编译原目录被覆盖的问题
- 修复AI分析完毕后不能很好过滤的问题


### V1.0.6
- 新增AI智能分析快速过滤第三方URL地址
Expand Down

0 comments on commit 4af089f

Please sign in to comment.