-
Notifications
You must be signed in to change notification settings - Fork 1
/
ZeroDayer.py
59 lines (54 loc) · 2.93 KB
/
ZeroDayer.py
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
import argparse
def parse_config(config_file):
config = {}
current_section = None
with open(config_file, 'r', encoding='utf-8') as f:
for line in f:
line = line.strip()
if line:
if line.startswith('[') and line.endswith(']'):
current_section = line[1:-1]
config[current_section] = []
else:
config[current_section].append(line)
return config
def search_config(config, name):
for section, items in config.items():
if name in items:
return section
return None
def main():
parser = argparse.ArgumentParser(description='ZeroDayer')
parser.add_argument('-f', '--file', type=str, help='Input file containing ICPnames')
parser.add_argument('-n', '--name', type=str, help='Single ICPname')
args = parser.parse_args()
if args.file:
config = parse_config('config.txt')
with open(args.file, 'r',encoding="utf-8") as f:
for name in f.read().strip().split('\n'):
section = search_config(config, name)
if section:
print(f'{section}: {name}')
else:
print(f'No match found for: {name}')
elif args.name:
config = parse_config('config.txt')
section = search_config(config, args.name)
if section:
print(f'{section}: {args.name}')
else:
print(f'No match found for: {args.name}')
else:
parser.print_help()
if __name__ == '__main__':
print('''
' ███████╗███████╗██████╗ ██████╗ ██████╗ █████╗ ██╗ ██╗███████╗██████╗
' ╚══███╔╝██╔════╝██╔══██╗██╔═══██╗██╔══██╗██╔══██╗╚██╗ ██╔╝██╔════╝██╔══██╗
' ███╔╝ █████╗ ██████╔╝██║ ██║██║ ██║███████║ ╚████╔╝ █████╗ ██████╔╝
' ███╔╝ ██╔══╝ ██╔══██╗██║ ██║██║ ██║██╔══██║ ╚██╔╝ ██╔══╝ ██╔══██╗
' ███████╗███████╗██║ ██║╚██████╔╝██████╔╝██║ ██║ ██║ ███████╗██║ ██║
' ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝╚═╝ ╚═╝
'
' - by @Zjacky
''')
main()