forked from lietdai/doom
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun.py
More file actions
executable file
·31 lines (26 loc) · 808 Bytes
/
run.py
File metadata and controls
executable file
·31 lines (26 loc) · 808 Bytes
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
#!/usr/bin/env python
# encoding: utf-8
# run.py
# email: root@1137.me
import sys
from tasks import *
from wyfunc import make_target_list
def start_nmap_dispath(targets, taskid=None):
print '-' * 50
target_list = make_target_list(targets)
for target in target_list:
print '-' * 50
print '* push %s to Redis' % target
print '* AsyncResult:%s' % nmap_dispath.delay(target,taskid=taskid)
print '-' * 50
print '* Push nmapscan tasks complete.'
print '-' * 50
if __name__ == "__main__":
if len(sys.argv) == 2:
start_nmap_dispath(sys.argv[1])
sys.exit(0)
elif len(sys.argv) == 3:
start_nmap_dispath(sys.argv[1], sys.argv[2])
else:
print ("usage: %s targets taskid" % sys.argv[0])
sys.exit(-1)