-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
executable file
·52 lines (35 loc) · 1.71 KB
/
main.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
#!/usr/bin/python
# Stdlib
from argparse import ArgumentParser
# External dependencies
from lib.CommandAndControl import CommandAndControl
from lib.menus.Master import Master as Interactive
from lib.types.node import Node
def targeting():
"""
Pull our benchmarking data
"""
with open( "etc/dom_bench.txt", "r" ) as fd:
for line in fd:
yield Node( url = line.strip() )
# Lets Throw Some Ips In the mix for good measure
for i in range( 0, 10 ):
yield Node( a_records = [ "96.126.107.14{}".format( i ) ] )
if __name__ == '__main__':
parser = ArgumentParser( description = "CmpSc 294 - Final Proposal [ SPF.AUD.IT ]" )
parser.add_argument( '-w', '--workers', dest = 'wcount', default = 3,
help = "Worker Count" )
parser.add_argument( '-e', '--eBroker', dest = 'ecount', default = 1,
help = "Json Broker Count" )
parser.add_argument( '-s', '--sBroker', dest = 'scount', default = 1,
help = "SQL Broker Count" )
parser.add_argument( '-g', '--geoip', dest = 'geoPath', default = '/usr/share/geoip/GeoLite2-City.mmdb',
help = "GeoIP Database Path, If available. (MaxMind.mmdb)" )
parser.add_argument( '-l', '--log', dest = 'logPath', default = 'var/log/gmx_search.log',
help = "Log File Path" )
args = parser.parse_args()
if not all( map( lambda x: x is not None, [ args.wcount, args.logPath ] ) ):
parser.print_help()
exit( -1 )
Interactive( CommandAndControl, args.wcount, args.ecount, args.scount, args.logPath, args.geoPath, targeting )
print "Finished Host Results"