-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathclient.py
31 lines (25 loc) · 873 Bytes
/
client.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
# -*- coding: utf-8 -*-
import sys
from logger import Logger
def run_modules():
import conf.scans
# Running Module Scans
count = {'mods': 0, 'scans': 0, 'failed_scans': 0}
for mod in conf.scans.enabled_modules:
klass = mod['class']
servers = mod.get('servers', [None])
params = mod.get('params')
for server in servers:
try:
mod_instance = klass(server=server, params=params)
mod_instance.run()
except Exception as e:
print >> sys.stderr, str(e)
count['failed_scans'] += 1
count['scans'] += 1
count['mods'] += 1
print('Run Summary: {mods} modules, {scans} total scans, {failed_scans} failed.'.format(**count))
# closing log files
Logger.get().close_all()
if __name__ == '__main__':
run_modules()