Skip to content

Commit fa37dda

Browse files
kelvinBenYour Name
kelvinBen
authored and
Your Name
committed
1. 将web任务处理逻辑添加至任务处理中心
1 parent 626fc56 commit fa37dda

File tree

5 files changed

+29
-57
lines changed

5 files changed

+29
-57
lines changed

app.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ def web(inputs: str, rules: str, all_str:bool,threads:int) -> None:
6363
bootstrapper = Bootstrapper(__file__)
6464
bootstrapper.init()
6565

66-
# BaseTask("Web", inputs, rules,all_str, threads).start()
66+
BaseTask("Web", inputs, rules,all_str, threads).start()
6767

68-
task = WebTask(input, rules,all,threads)
69-
task.start()
68+
# task = WebTask(input, rules,all,threads)
69+
# task.start()
7070

7171
except Exception as e:
7272
raise e

libs/task/base_task.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def __tast_control__(self):
7676
task_info = iOSTask(self.path,self.no_resource).start()
7777
# 调用Web 相关处理逻辑
7878
else:
79-
task_info = WebTask.start()
79+
task_info = WebTask(self.path).start()
8080
return task_info
8181

8282
def __threads_control__(self,file_queue):

libs/task/ios_task.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def start(self):
3636
return {"shell_flag":self.shell_flag,"file_queue":self.file_queue,"comp_list":[],"packagename":None}
3737

3838
def __get_file_header__(self,file_path):
39-
print("====================")
4039
hex_hand = 0x0
4140
with open(file_path,"rb") as macho_file:
4241
macho_file.seek(hex_hand,0)

libs/task/web_task.py

Lines changed: 23 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -17,38 +17,23 @@ class WebTask(object):
1717
value_list = []
1818
result_dict = {}
1919

20-
def __init__(self, input, rules,all,threads):
21-
self.path = input
22-
if rules:
23-
config.filter_strs.append(r'.*'+str(rules)+'.*')
24-
self.all = all
25-
self.threads = threads
20+
def __init__(self, path):
21+
self.path = path
2622
self.file_queue = Queue()
27-
self.shell_falg=False
2823

2924
def start(self):
30-
# 此处判断是文件还是目录
31-
# 文件判断后缀 html,js,css,htm,xml等
32-
3325
if len(config.web_file_suffix) <=0:
3426
scanner_file_suffix = ["html","js","html","xml"]
3527

3628
scanner_file_suffix = config.web_file_suffix
37-
if os.path.isdir(self.path): # 目录的话就提取
29+
if os.path.isdir(self.path):
3830
self.__get_scanner_file__(self.path,scanner_file_suffix)
39-
4031
else:
41-
if not (self.path.split(".")[-1] in scanner_file_suffix): # 内容包含进行下步处理
32+
if not (self.path.split(".")[-1] in scanner_file_suffix):
4233
err_info = ("Retrieval of this file type is not supported. Select a file or directory with a suffix of %s" % ",".join(scanner_file_suffix))
4334
raise Exception(err_info)
4435
self.file_queue.put(self.path)
45-
46-
self.__start_threads()
47-
48-
for thread in self.thread_list:
49-
thread.join()
50-
51-
self.__print__()
36+
return {"comp_list":[],"shell_flag":False,"file_queue":self.file_queue,"packagename":None}
5237

5338
def __get_scanner_file__(self,scanner_dir,file_suffix):
5439
dir_or_files = os.listdir(scanner_dir)
@@ -61,22 +46,22 @@ def __get_scanner_file__(self,scanner_dir,file_suffix):
6146
if dir_file.split(".")[-1] in file_suffix:
6247
self.file_queue.put(dir_file_path)
6348

64-
def __print__(self):
65-
print("=========The result set for the static scan is shown below:===============")
66-
with open(cores.result_path,"a+") as f:
67-
for key,value in self.result_dict.items():
68-
f.write(key+"\r")
69-
for result in value:
70-
if result in self.value_list:
71-
continue
72-
self.value_list.append(result)
73-
print(result)
74-
f.write("\t"+result+"\r")
75-
print("For more information about the search, see: %s" %(cores.result_path))
49+
# def __print__(self):
50+
# print("=========The result set for the static scan is shown below:===============")
51+
# with open(cores.result_path,"a+") as f:
52+
# for key,value in self.result_dict.items():
53+
# f.write(key+"\r")
54+
# for result in value:
55+
# if result in self.value_list:
56+
# continue
57+
# self.value_list.append(result)
58+
# print(result)
59+
# f.write("\t"+result+"\r")
60+
# print("For more information about the search, see: %s" %(cores.result_path))
7661

77-
def __start_threads(self):
78-
for threadID in range(1,self.threads) :
79-
name = "Thread - " + str(threadID)
80-
thread = ParsesThreads(threadID,name,self.file_queue,self.all,self.result_dict)
81-
thread.start()
82-
self.thread_list.append(thread)
62+
# def __start_threads(self):
63+
# for threadID in range(1,self.threads) :
64+
# name = "Thread - " + str(threadID)
65+
# thread = ParsesThreads(threadID,name,self.file_queue,self.all,self.result_dict)
66+
# thread.start()
67+
# self.thread_list.append(thread)

update.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,15 @@
11
### V1.0.5
22
- 新增对DOM、SAX、DOM4J、JDOM等XML解析组件的识别
3-
43
- 新增反编译失败后提交issues入口
5-
64
- 新增ipa壳识别功能,将能够更好的对壳进行识别
7-
85
- 新增macho文件扫描功能
9-
106
- 新增结果url和ip地址单独输出到excel
11-
127
- 优化后缀名获取方式
13-
14-
- 优化任务控制中心,将分散的入口整合为一个(web的除外)
15-
16-
- 化任务处理逻辑,识别到有壳后,停止执行后继逻辑
17-
8+
- 优化任务控制中心,将分散的入口整合为一个
9+
- 优化任务处理逻辑,识别到有壳后,停止执行后继逻辑
1810
- 修复部分DEX格式原因导致无法进行反编译问题
19-
2011
- 修复ipa包中存在中文路径不能识别macho问题
2112

22-
23-
24-
2513
### V1.0.4
2614
- 新增对Flutter框架检测支持
2715
- 对输出结果整体去重

0 commit comments

Comments
 (0)