-
Notifications
You must be signed in to change notification settings - Fork 34
/
enumall-ab.py
58 lines (45 loc) · 1.41 KB
/
enumall-ab.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
#!/usr/bin/python
import argparse
import re
import sys
import datetime
import time
import os
import sys
reconPath = "/usr/share/recon-ng/"
sys.path.insert(0,reconPath)
from recon.core import base
from recon.core.framework import Colors
def run_module(reconBase, module, domain):
x = reconBase.do_load(module)
x.do_set("SOURCE " + domain)
x.do_run(None)
def run_recon(domains, output, shodankey):
stamp = datetime.datetime.now().strftime('%M:%H-%m_%d_%Y')
wspace = domains[0]+stamp
reconb = base.Recon(base.Mode.CLI)
reconb.init_workspace(wspace)
reconb.onecmd("TIMEOUT=100")
reconb.onecmd("keys add shodan_api " + shodankey)
module_list = [
"recon/domains-hosts/threatcrowd",
"recon/domains-hosts/hackertarget",
"recon/domains-hosts/bing_domain_web",
"recon/domains-hosts/shodan_hostname",
]
for domain in domains:
for module in module_list:
run_module(reconb, module, domain)
x = reconb.do_load("reporting/list")
x.do_set("FILENAME " + output)
x.do_set("COLUMN host")
x.do_run(None)
parser = argparse.ArgumentParser()
parser.add_argument("-o", dest="output", help="output file", default=None)
parser.add_argument("-s", dest="shodankey", help="shodan key", default=None)
parser.add_argument("domains", help="one or more domains", nargs="*", default=None)
args = parser.parse_args()
domainList = []
if args.domains:
domainList+=args.domains
run_recon(domainList, args.output, args.shodankey)