forked from wgpsec/IGScan
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStart.py
More file actions
137 lines (127 loc) · 6.98 KB
/
Copy pathStart.py
File metadata and controls
137 lines (127 loc) · 6.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import os
import time
from .Controller import Subdomain, Checkurl, Portscan, Webanaylzer
class IGScan:
def __init__(self, url, targets_file, hosts, module):
self.url = url
self.targets_file = targets_file
self.hosts = hosts
self.module = module
self.Subdomain = Subdomain()
self.Checkurl = Checkurl()
self.PortScan = Portscan()
self.Webanaylzer = Webanaylzer()
def Start(self):
url = self.url
targets_file = self.targets_file
hosts = self.hosts
module = self.module
Subdomain = self.Subdomain
Checkurl = self.Checkurl
Portscan = self.PortScan
Webanaylzer = self.Webanaylzer
# print(module)
if not os.path.exists('Output/'):
os.mkdir('Output/')
if module != '' and module != None:
module = module.split(',')
if url != '' and url != None:
all_module = ['subdomain', 'checkurl', 'webanalyzer']
inse_module = list(set(all_module).intersection(set(module))) # 交集
dif_module = list(set(all_module).difference(set(module))) # 并集
# print(module)
if len(dif_module) == 0:
starttime = time.time()
Subdomain.url_subdomain(url)
Checkurl.url_Check()
Webanaylzer.url_analyzer()
endtime = time.time()
print('\033[32m[SUCC]\033[0m All target links have been collected!')
print('\033[32m[TIME]\033[0m The program is running time: %.2fs' % (endtime - starttime))
if len(dif_module) == 1:
if module[0] == 'subdomain':
starttime = time.time()
Subdomain.url_subdomain(url)
Checkurl.url_Check()
endtime = time.time()
print('\033[32m[SUCC]\033[0m All target links have been collected!')
print('\033[32m[TIME]\033[0m The program is running time: %.2fs' % (endtime - starttime))
if module[0] == 'webanalyzer':
starttime = time.time()
Subdomain.url_subdomain(url)
Checkurl.url_Check()
endtime = time.time()
print('\033[32m[SUCC]\033[0m All target links have been collected!')
print('\033[32m[TIME]\033[0m The program is running time: %.2fs' % (endtime - starttime))
if len(inse_module) == 1:
if module[0] == 'subdomain':
starttime = time.time()
Subdomain.url_subdomain(url)
endtime = time.time()
print('\033[32m[SUCC]\033[0m All target links have been collected!')
print('\033[32m[TIME]\033[0m The program is running time: %.2fs' % (endtime - starttime))
elif module[0] == 'checkurl':
starttime = time.time()
Checkurl.url_Check()
endtime = time.time()
print('\033[32m[SUCC]\033[0m All target links have been collected!')
print('\033[32m[TIME]\033[0m The program is running time: %.2fs' % (endtime - starttime))
elif module[0] == 'webanalyzer':
starttime = time.time()
Webanaylzer.one_analyzer(url)
endtime = time.time()
print('\033[32m[SUCC]\033[0m All target links have been collected!')
print('\033[32m[TIME]\033[0m The program is running time: %.2fs' % (endtime - starttime))
if targets_file != '' and targets_file != None:
all_module = ['subdomain', 'checkurl', 'webanalyzer']
inse_module = list(set(all_module).intersection(set(module)))
dif_module = list(set(all_module).difference(set(module)))
# print(module)
if len(dif_module) == 0:
starttime = time.time()
Subdomain.file_subdomain(targets_file)
Checkurl.file_Check(targets_file)
Webanaylzer.file_analyzer(targets_file)
endtime = time.time()
print('\033[32m[SUCC]\033[0m All target links have been collected!')
print('\033[32m[TIME]\033[0m The program is running time: %.2fs' % (endtime - starttime))
if len(dif_module) == 1:
if module[0] == 'subdomain':
starttime = time.time()
Subdomain.file_subdomain(targets_file)
Checkurl.file_Check(targets_file)
endtime = time.time()
print('\033[32m[SUCC]\033[0m All target links have been collected!')
print('\033[32m[TIME]\033[0m The program is running time: %.2fs' % (endtime - starttime))
if module[0] == 'webanalyzer':
starttime = time.time()
Subdomain.file_subdomain(targets_file)
Checkurl.file_Check(targets_file)
endtime = time.time()
print('\033[32m[SUCC]\033[0m All target links have been collected!')
print('\033[32m[TIME]\033[0m The program is running time: %.2fs' % (endtime - starttime))
if len(inse_module) == 1:
if module[0] == 'subdomain':
starttime = time.time()
Subdomain.file_subdomain(targets_file)
endtime = time.time()
print('\033[32m[SUCC]\033[0m All target links have been collected!')
print('\033[32m[TIME]\033[0m The program is running time: %.2fs' % (endtime - starttime))
elif module[0] == 'checkurl':
starttime = time.time()
Checkurl.file_Check(targets_file)
endtime = time.time()
print('\033[32m[SUCC]\033[0m All target links have been collected!')
print('\033[32m[TIME]\033[0m The program is running time: %.2fs' % (endtime - starttime))
elif module[0] == 'webanalyzer':
starttime = time.time()
Webanaylzer.file_analyzer(targets_file)
endtime = time.time()
print('\033[32m[SUCC]\033[0m All target links have been collected!')
print('\033[32m[TIME]\033[0m The program is running time: %.2fs' % (endtime - starttime))
if hosts != '' and hosts != None:
Portscan = Portscan
if '/' in hosts:
Portscan.masscan(hosts)
else:
Portscan.nmapscan(hosts)