oneforall-kjl 0.1.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. OneForAll/__init__.py +15 -0
  2. OneForAll/brute.py +503 -0
  3. OneForAll/common/check.py +41 -0
  4. OneForAll/common/crawl.py +10 -0
  5. OneForAll/common/database.py +277 -0
  6. OneForAll/common/domain.py +63 -0
  7. OneForAll/common/ipasn.py +42 -0
  8. OneForAll/common/ipreg.py +139 -0
  9. OneForAll/common/lookup.py +28 -0
  10. OneForAll/common/module.py +369 -0
  11. OneForAll/common/query.py +9 -0
  12. OneForAll/common/records.py +363 -0
  13. OneForAll/common/request.py +264 -0
  14. OneForAll/common/resolve.py +173 -0
  15. OneForAll/common/search.py +78 -0
  16. OneForAll/common/similarity.py +138 -0
  17. OneForAll/common/tablib/__init__.py +0 -0
  18. OneForAll/common/tablib/format.py +89 -0
  19. OneForAll/common/tablib/tablib.py +360 -0
  20. OneForAll/common/tldextract.py +240 -0
  21. OneForAll/common/utils.py +789 -0
  22. OneForAll/config/__init__.py +17 -0
  23. OneForAll/config/api.py +94 -0
  24. OneForAll/config/default.py +255 -0
  25. OneForAll/config/log.py +38 -0
  26. OneForAll/config/setting.py +108 -0
  27. OneForAll/export.py +72 -0
  28. OneForAll/modules/altdns.py +216 -0
  29. OneForAll/modules/autotake/github.py +105 -0
  30. OneForAll/modules/certificates/censys_api.py +73 -0
  31. OneForAll/modules/certificates/certspotter.py +48 -0
  32. OneForAll/modules/certificates/crtsh.py +84 -0
  33. OneForAll/modules/certificates/google.py +48 -0
  34. OneForAll/modules/certificates/myssl.py +46 -0
  35. OneForAll/modules/certificates/racent.py +49 -0
  36. OneForAll/modules/check/axfr.py +97 -0
  37. OneForAll/modules/check/cdx.py +44 -0
  38. OneForAll/modules/check/cert.py +58 -0
  39. OneForAll/modules/check/csp.py +94 -0
  40. OneForAll/modules/check/nsec.py +58 -0
  41. OneForAll/modules/check/robots.py +44 -0
  42. OneForAll/modules/check/sitemap.py +44 -0
  43. OneForAll/modules/collect.py +70 -0
  44. OneForAll/modules/crawl/archivecrawl.py +59 -0
  45. OneForAll/modules/crawl/commoncrawl.py +59 -0
  46. OneForAll/modules/datasets/anubis.py +45 -0
  47. OneForAll/modules/datasets/bevigil.py +50 -0
  48. OneForAll/modules/datasets/binaryedge_api.py +50 -0
  49. OneForAll/modules/datasets/cebaidu.py +45 -0
  50. OneForAll/modules/datasets/chinaz.py +45 -0
  51. OneForAll/modules/datasets/chinaz_api.py +49 -0
  52. OneForAll/modules/datasets/circl_api.py +49 -0
  53. OneForAll/modules/datasets/cloudflare_api.py +130 -0
  54. OneForAll/modules/datasets/dnsdb_api.py +51 -0
  55. OneForAll/modules/datasets/dnsdumpster.py +52 -0
  56. OneForAll/modules/datasets/dnsgrep.py +44 -0
  57. OneForAll/modules/datasets/fullhunt.py +48 -0
  58. OneForAll/modules/datasets/hackertarget.py +45 -0
  59. OneForAll/modules/datasets/ip138.py +45 -0
  60. OneForAll/modules/datasets/ipv4info_api.py +73 -0
  61. OneForAll/modules/datasets/netcraft.py +66 -0
  62. OneForAll/modules/datasets/passivedns_api.py +51 -0
  63. OneForAll/modules/datasets/qianxun.py +61 -0
  64. OneForAll/modules/datasets/rapiddns.py +45 -0
  65. OneForAll/modules/datasets/riddler.py +45 -0
  66. OneForAll/modules/datasets/robtex.py +58 -0
  67. OneForAll/modules/datasets/securitytrails_api.py +56 -0
  68. OneForAll/modules/datasets/sitedossier.py +57 -0
  69. OneForAll/modules/datasets/spyse_api.py +62 -0
  70. OneForAll/modules/datasets/sublist3r.py +45 -0
  71. OneForAll/modules/datasets/urlscan.py +45 -0
  72. OneForAll/modules/datasets/windvane.py +92 -0
  73. OneForAll/modules/dnsquery/mx.py +35 -0
  74. OneForAll/modules/dnsquery/ns.py +35 -0
  75. OneForAll/modules/dnsquery/soa.py +35 -0
  76. OneForAll/modules/dnsquery/spf.py +35 -0
  77. OneForAll/modules/dnsquery/txt.py +35 -0
  78. OneForAll/modules/enrich.py +72 -0
  79. OneForAll/modules/finder.py +206 -0
  80. OneForAll/modules/intelligence/alienvault.py +50 -0
  81. OneForAll/modules/intelligence/riskiq_api.py +58 -0
  82. OneForAll/modules/intelligence/threatbook_api.py +50 -0
  83. OneForAll/modules/intelligence/threatminer.py +45 -0
  84. OneForAll/modules/intelligence/virustotal.py +60 -0
  85. OneForAll/modules/intelligence/virustotal_api.py +59 -0
  86. OneForAll/modules/iscdn.py +86 -0
  87. OneForAll/modules/search/ask.py +69 -0
  88. OneForAll/modules/search/baidu.py +96 -0
  89. OneForAll/modules/search/bing.py +79 -0
  90. OneForAll/modules/search/bing_api.py +78 -0
  91. OneForAll/modules/search/fofa_api.py +74 -0
  92. OneForAll/modules/search/gitee.py +71 -0
  93. OneForAll/modules/search/github_api.py +86 -0
  94. OneForAll/modules/search/google.py +83 -0
  95. OneForAll/modules/search/google_api.py +77 -0
  96. OneForAll/modules/search/hunter_api.py +72 -0
  97. OneForAll/modules/search/quake_api.py +72 -0
  98. OneForAll/modules/search/shodan_api.py +53 -0
  99. OneForAll/modules/search/so.py +75 -0
  100. OneForAll/modules/search/sogou.py +72 -0
  101. OneForAll/modules/search/wzsearch.py +68 -0
  102. OneForAll/modules/search/yahoo.py +81 -0
  103. OneForAll/modules/search/yandex.py +80 -0
  104. OneForAll/modules/search/zoomeye_api.py +73 -0
  105. OneForAll/modules/srv.py +75 -0
  106. OneForAll/modules/wildcard.py +319 -0
  107. OneForAll/oneforall.py +275 -0
  108. OneForAll/takeover.py +168 -0
  109. OneForAll/test.py +23 -0
  110. oneforall_kjl-0.1.1.dist-info/METADATA +18 -0
  111. oneforall_kjl-0.1.1.dist-info/RECORD +114 -0
  112. oneforall_kjl-0.1.1.dist-info/WHEEL +5 -0
  113. oneforall_kjl-0.1.1.dist-info/entry_points.txt +2 -0
  114. oneforall_kjl-0.1.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,50 @@
1
+ from config import settings
2
+ from common.query import Query
3
+
4
+
5
+ class BeVigilAPI(Query):
6
+ def __init__(self, domain):
7
+ Query.__init__(self)
8
+ self.domain = domain
9
+ self.module = 'Dataset'
10
+ self.source = 'BeVigilOsintApi'
11
+ self.addr = 'http://osint.bevigil.com/api/{}/subdomains/'
12
+ self.api = settings.bevigil_api
13
+
14
+ def query(self):
15
+ """
16
+ 向接口查询子域并做子域匹配
17
+ """
18
+
19
+ self.header = self.get_header()
20
+ self.header.update({"X-Access-Token": self.api})
21
+ self.proxy = self.get_proxy(self.source)
22
+ url = self.addr.format(self.domain)
23
+ resp = self.get(url)
24
+ self.subdomains = self.collect_subdomains(resp)
25
+
26
+ def run(self):
27
+ """
28
+ 类执行入口
29
+ """
30
+ if not self.have_api(self.api):
31
+ return
32
+ self.begin()
33
+ self.query()
34
+ self.finish()
35
+ self.save_json()
36
+ self.gen_result()
37
+ self.save_db()
38
+
39
+
40
+ def run(domain):
41
+ """
42
+ 类统一调用入口
43
+
44
+ :param str domain: 域名
45
+ """
46
+ query = BeVigilAPI(domain)
47
+ query.run()
48
+
49
+ if __name__ == '__main__':
50
+ run('example.com')
@@ -0,0 +1,50 @@
1
+ from config import settings
2
+ from common.query import Query
3
+
4
+
5
+ class BinaryEdgeAPI(Query):
6
+ def __init__(self, domain):
7
+ Query.__init__(self)
8
+ self.domain = domain
9
+ self.module = 'Dataset'
10
+ self.source = 'BinaryEdgeAPIQuery'
11
+ self.addr = 'https://api.binaryedge.io/v2/query/domains/subdomain/'
12
+ self.api = settings.binaryedge_api
13
+
14
+ def query(self):
15
+ """
16
+ 向接口查询子域并做子域匹配
17
+ """
18
+ self.header = self.get_header()
19
+ self.header.update({'X-Key': self.api})
20
+ self.proxy = self.get_proxy(self.source)
21
+ url = self.addr + self.domain
22
+ resp = self.get(url)
23
+ self.subdomains = self.collect_subdomains(resp)
24
+
25
+ def run(self):
26
+ """
27
+ 类执行入口
28
+ """
29
+ if not self.have_api(self.api):
30
+ return
31
+ self.begin()
32
+ self.query()
33
+ self.finish()
34
+ self.save_json()
35
+ self.gen_result()
36
+ self.save_db()
37
+
38
+
39
+ def run(domain):
40
+ """
41
+ 类统一调用入口
42
+
43
+ :param str domain: 域名
44
+ """
45
+ query = BinaryEdgeAPI(domain)
46
+ query.run()
47
+
48
+
49
+ if __name__ == '__main__':
50
+ run('example.com')
@@ -0,0 +1,45 @@
1
+ from common.query import Query
2
+
3
+
4
+ class CeBaidu(Query):
5
+ def __init__(self, domain):
6
+ Query.__init__(self)
7
+ self.domain = domain
8
+ self.module = 'Dataset'
9
+ self.source = 'CeBaiduQuery'
10
+ self.addr = 'https://ce.baidu.com/index/getRelatedSites'
11
+
12
+ def query(self):
13
+ """
14
+ 向接口查询子域并做子域匹配
15
+ """
16
+ self.header = self.get_header()
17
+ self.proxy = self.get_proxy(self.source)
18
+ params = {'site_address': self.domain}
19
+ resp = self.get(self.addr, params)
20
+ self.subdomains = self.collect_subdomains(resp)
21
+
22
+ def run(self):
23
+ """
24
+ 类执行入口
25
+ """
26
+ self.begin()
27
+ self.query()
28
+ self.finish()
29
+ self.save_json()
30
+ self.gen_result()
31
+ self.save_db()
32
+
33
+
34
+ def run(domain):
35
+ """
36
+ 类统一调用入口
37
+
38
+ :param str domain: 域名
39
+ """
40
+ query = CeBaidu(domain)
41
+ query.run()
42
+
43
+
44
+ if __name__ == '__main__':
45
+ run('example.com')
@@ -0,0 +1,45 @@
1
+ from common.query import Query
2
+
3
+
4
+ class Chinaz(Query):
5
+ def __init__(self, domain):
6
+ Query.__init__(self)
7
+ self.domain = domain
8
+ self.module = 'Dataset'
9
+ self.source = 'ChinazQuery'
10
+ self.addr = 'https://alexa.chinaz.com/'
11
+
12
+ def query(self):
13
+ """
14
+ 向接口查询子域并做子域匹配
15
+ """
16
+ self.header = self.get_header()
17
+ self.proxy = self.get_proxy(self.source)
18
+ self.addr = self.addr + self.domain
19
+ resp = self.get(self.addr)
20
+ self.subdomains = self.collect_subdomains(resp)
21
+
22
+ def run(self):
23
+ """
24
+ 类执行入口
25
+ """
26
+ self.begin()
27
+ self.query()
28
+ self.finish()
29
+ self.save_json()
30
+ self.gen_result()
31
+ self.save_db()
32
+
33
+
34
+ def run(domain):
35
+ """
36
+ 类统一调用入口
37
+
38
+ :param str domain: 域名
39
+ """
40
+ query = Chinaz(domain)
41
+ query.run()
42
+
43
+
44
+ if __name__ == '__main__':
45
+ run('example.com')
@@ -0,0 +1,49 @@
1
+ from config import settings
2
+ from common.query import Query
3
+
4
+
5
+ class ChinazAPI(Query):
6
+ def __init__(self, domain):
7
+ Query.__init__(self)
8
+ self.domain = domain
9
+ self.module = 'Dataset'
10
+ self.source = 'ChinazAPIQuery'
11
+ self.addr = 'https://apidata.chinaz.com/CallAPI/Alexa'
12
+ self.api = settings.chinaz_api
13
+
14
+ def query(self):
15
+ """
16
+ 向接口查询子域并做子域匹配
17
+ """
18
+ self.header = self.get_header()
19
+ self.proxy = self.get_proxy(self.source)
20
+ params = {'key': self.api, 'domainName': self.domain}
21
+ resp = self.get(self.addr, params)
22
+ self.subdomains = self.collect_subdomains(resp)
23
+
24
+ def run(self):
25
+ """
26
+ 类执行入口
27
+ """
28
+ if not self.have_api(self.api):
29
+ return
30
+ self.begin()
31
+ self.query()
32
+ self.finish()
33
+ self.save_json()
34
+ self.gen_result()
35
+ self.save_db()
36
+
37
+
38
+ def run(domain):
39
+ """
40
+ 类统一调用入口
41
+
42
+ :param str domain: 域名
43
+ """
44
+ query = ChinazAPI(domain)
45
+ query.run()
46
+
47
+
48
+ if __name__ == '__main__':
49
+ run('example.com')
@@ -0,0 +1,49 @@
1
+ from config import settings
2
+ from common.query import Query
3
+
4
+
5
+ class CirclAPI(Query):
6
+ def __init__(self, domain):
7
+ Query.__init__(self)
8
+ self.domain = domain
9
+ self.module = 'Dataset'
10
+ self.source = 'CirclAPIQuery'
11
+ self.addr = 'https://www.circl.lu/pdns/query/'
12
+ self.user = settings.circl_api_username
13
+ self.pwd = settings.circl_api_password
14
+
15
+ def query(self):
16
+ """
17
+ 向接口查询子域并做子域匹配
18
+ """
19
+ self.header = self.get_header()
20
+ self.proxy = self.get_proxy(self.source)
21
+ resp = self.get(self.addr + self.domain, auth=(self.user, self.pwd))
22
+ self.subdomains = self.collect_subdomains(resp)
23
+
24
+ def run(self):
25
+ """
26
+ 类执行入口
27
+ """
28
+ if not self.have_api(self.user, self.pwd):
29
+ return
30
+ self.begin()
31
+ self.query()
32
+ self.finish()
33
+ self.save_json()
34
+ self.gen_result()
35
+ self.save_db()
36
+
37
+
38
+ def run(domain):
39
+ """
40
+ 类统一调用入口
41
+
42
+ :param str domain: 域名
43
+ """
44
+ query = CirclAPI(domain)
45
+ query.run()
46
+
47
+
48
+ if __name__ == '__main__':
49
+ run('example.com')
@@ -0,0 +1,130 @@
1
+ from config import settings
2
+ from common.query import Query
3
+ from config.log import logger
4
+ from time import sleep
5
+
6
+
7
+ class CloudFlareAPI(Query):
8
+
9
+ def __init__(self, domain):
10
+ Query.__init__(self)
11
+ self.domain = domain
12
+ self.module = 'Dataset'
13
+ self.source = 'CloudFlareAPIQuery'
14
+ self.token = settings.cloudflare_api_token
15
+ self.addr = 'https://api.cloudflare.com/client/v4/'
16
+ self.header = self.get_header()
17
+ self.header.update({'Authorization': 'Bearer ' + self.token})
18
+ self.header.update({'Content-Type': 'application/json'})
19
+ self.proxy = self.get_proxy(self.source)
20
+
21
+ def query(self):
22
+ """
23
+ query from source
24
+ """
25
+ account_id_resp = self.get(self.addr + 'accounts')
26
+ if account_id_resp:
27
+ if account_id_resp.status_code != 200:
28
+ return
29
+ else:
30
+ return
31
+ result = account_id_resp.json()['result']
32
+ if not result:
33
+ return
34
+ account_id = result[0]['id']
35
+ # query domain zone, if it not exist, create
36
+ zones_resp = self.get(self.addr + 'zones',
37
+ params={'name': self.domain}, check=False)
38
+ if zones_resp:
39
+ if zones_resp.status_code == 200:
40
+ if zones_resp.json()['success'] and not zones_resp.json()['result']:
41
+ zone_id = self.create_zone(account_id)
42
+ if zone_id:
43
+ self.list_dns(zone_id)
44
+ return
45
+ return
46
+ elif zones_resp.json()['success']:
47
+ zone_id = self.create_zone(account_id)
48
+ if zone_id:
49
+ self.list_dns(zone_id)
50
+ return
51
+ elif zones_resp.status_code == 403:
52
+ logger.log('DEBUG',
53
+ f'{self.domain} is banned or not a registered domain, '
54
+ f'so cannot be added to Cloudflare.')
55
+ return
56
+ else:
57
+ logger.log('DEBUG',
58
+ f'{zones_resp.status_code} {zones_resp.text}')
59
+ return
60
+
61
+ def create_zone(self, account_id):
62
+ data = {"name": self.domain, "account": {"id": account_id},
63
+ "jump_start": True, "type": "full"}
64
+ create_zone_resp = self.post(self.addr + 'zones', json=data, check=False)
65
+ if not create_zone_resp:
66
+ logger.log('DEBUG', f'{create_zone_resp.status_code} {create_zone_resp.text}')
67
+ return False
68
+ if create_zone_resp.json()['success']:
69
+ return create_zone_resp.json()['result']['id']
70
+ else:
71
+ logger.log('DEBUG', f'{self.domain} is temporarily banned '
72
+ f'and cannot be added to Cloudflare')
73
+ return False
74
+
75
+ def list_dns(self, zone_id):
76
+ page = 1
77
+ list_dns_resp = self.get(self.addr + f'zones/{zone_id}/dns_records',
78
+ params={'page': page, 'per_page': 10})
79
+ if not list_dns_resp:
80
+ logger.log('DEBUG',
81
+ f'{list_dns_resp.status_code} {list_dns_resp.text}')
82
+ return
83
+ subdomains = self.match_subdomains(list_dns_resp.text)
84
+ self.subdomains.update(subdomains)
85
+ if not self.subdomains:
86
+ # waiting for cloudflare enumerate subdomains
87
+ sleep(5)
88
+ self.list_dns(zone_id)
89
+ else:
90
+ while True:
91
+ list_dns_resp = self.get(self.addr + f'zones/{zone_id}/dns_records',
92
+ params={'page': page, 'per_page': 10})
93
+ if not list_dns_resp:
94
+ logger.log('DEBUG',
95
+ f'{list_dns_resp.status_code} {list_dns_resp.text}')
96
+ return
97
+ total_pages = list_dns_resp.json()['result_info']['total_pages']
98
+ subdomains = (self.match_subdomains(list_dns_resp.text))
99
+ self.subdomains.update(subdomains)
100
+ page += 1
101
+ if page > total_pages:
102
+ break
103
+ return
104
+
105
+ def run(self):
106
+ """
107
+ class entrance
108
+ """
109
+ if not self.have_api(self.token):
110
+ return
111
+ self.begin()
112
+ self.query()
113
+ self.finish()
114
+ self.save_json()
115
+ self.gen_result()
116
+ self.save_db()
117
+
118
+
119
+ def run(domain):
120
+ """
121
+ class call entrance
122
+
123
+ :param str domain: 域名
124
+ """
125
+ query = CloudFlareAPI(domain)
126
+ query.run()
127
+
128
+
129
+ if __name__ == '__main__':
130
+ run('example.com')
@@ -0,0 +1,51 @@
1
+ from config import settings
2
+ from common.query import Query
3
+
4
+
5
+ class DNSdbAPI(Query):
6
+ def __init__(self, domain):
7
+ Query.__init__(self)
8
+ self.domain = domain
9
+ self.module = 'Dataset'
10
+ self.source = 'DNSdbAPIQuery'
11
+ self.addr = 'https://api.dnsdb.info/lookup/rrset/name/'
12
+ self.api = settings.dnsdb_api_key
13
+
14
+ def query(self):
15
+ """
16
+ 向接口查询子域并做子域匹配
17
+ """
18
+ self.header = self.get_header()
19
+ self.header.update({'X-API-Key': self.api})
20
+ self.proxy = self.get_proxy(self.source)
21
+ url = f'{self.addr}*.{self.domain}'
22
+ resp = self.get(url)
23
+ self.subdomains = self.collect_subdomains(resp)
24
+
25
+ def run(self):
26
+ """
27
+ 类执行入口
28
+ """
29
+ if not self.have_api(self.api):
30
+ return
31
+ self.begin()
32
+ self.query()
33
+ self.finish()
34
+ self.save_json()
35
+ self.gen_result()
36
+ self.save_db()
37
+
38
+
39
+ def run(domain):
40
+ """
41
+ 类统一调用入口
42
+
43
+ :param str domain: 域名
44
+
45
+ """
46
+ query = DNSdbAPI(domain)
47
+ query.run()
48
+
49
+
50
+ if __name__ == '__main__':
51
+ run('example.com')
@@ -0,0 +1,52 @@
1
+ from common.query import Query
2
+
3
+
4
+ class DNSDumpster(Query):
5
+ def __init__(self, domain):
6
+ Query.__init__(self)
7
+ self.domain = domain
8
+ self.module = 'Dataset'
9
+ self.source = "DNSDumpsterQuery"
10
+ self.addr = 'https://dnsdumpster.com/'
11
+
12
+ def query(self):
13
+ """
14
+ 向接口查询子域并做子域匹配
15
+ """
16
+ self.header = self.get_header()
17
+ self.header.update({'Referer': 'https://dnsdumpster.com'})
18
+ self.proxy = self.get_proxy(self.source)
19
+ resp = self.get(self.addr)
20
+ if not resp:
21
+ return
22
+ self.cookie = resp.cookies
23
+ data = {'csrfmiddlewaretoken': self.cookie.get('csrftoken'),
24
+ 'targetip': self.domain,
25
+ 'user':'free'}
26
+ resp = self.post(self.addr, data)
27
+ self.subdomains = self.collect_subdomains(resp)
28
+
29
+ def run(self):
30
+ """
31
+ 类执行入口
32
+ """
33
+ self.begin()
34
+ self.query()
35
+ self.finish()
36
+ self.save_json()
37
+ self.gen_result()
38
+ self.save_db()
39
+
40
+
41
+ def run(domain):
42
+ """
43
+ 类统一调用入口
44
+
45
+ :param str domain: 域名
46
+ """
47
+ query = DNSDumpster(domain)
48
+ query.run()
49
+
50
+
51
+ if __name__ == '__main__':
52
+ run('mi.com')
@@ -0,0 +1,44 @@
1
+ from common.query import Query
2
+
3
+
4
+ class Dnsgrep(Query):
5
+ def __init__(self, domain):
6
+ Query.__init__(self)
7
+ self.domain = domain
8
+ self.module = 'Dataset'
9
+ self.source = 'DnsgrepQuery'
10
+
11
+ def query(self):
12
+ """
13
+ 向接口查询子域并做子域匹配
14
+ """
15
+ self.header = self.get_header()
16
+ self.proxy = self.get_proxy(self.source)
17
+ url = 'https://www.dnsgrep.cn/subdomain/' + self.domain
18
+ resp = self.get(url)
19
+ self.subdomains = self.collect_subdomains(resp)
20
+
21
+ def run(self):
22
+ """
23
+ 类执行入口
24
+ """
25
+ self.begin()
26
+ self.query()
27
+ self.finish()
28
+ self.save_json()
29
+ self.gen_result()
30
+ self.save_db()
31
+
32
+
33
+ def run(domain):
34
+ """
35
+ 类统一调用入口
36
+
37
+ :param str domain: 域名
38
+ """
39
+ query = Dnsgrep(domain)
40
+ query.run()
41
+
42
+
43
+ if __name__ == '__main__':
44
+ run('example.com')
@@ -0,0 +1,48 @@
1
+ from config import settings
2
+ from common.query import Query
3
+
4
+
5
+ class FullHuntAPI(Query):
6
+ def __init__(self, domain):
7
+ Query.__init__(self)
8
+ self.domain = domain
9
+ self.module = 'Dataset'
10
+ self.source = 'FullHuntAPIQuery'
11
+ self.api = settings.fullhunt_api_key
12
+
13
+ def query(self):
14
+ """
15
+ 向接口查询子域并做子域匹配
16
+ """
17
+ self.header = self.get_header()
18
+ self.header.update({'X-API-KEY': self.api})
19
+ self.proxy = self.get_proxy(self.source)
20
+ url = f'https://fullhunt.io/api/v1/domain/{self.domain}/subdomains'
21
+ resp = self.get(url)
22
+ self.subdomains = self.collect_subdomains(resp)
23
+
24
+ def run(self):
25
+ """
26
+ 类执行入口
27
+ """
28
+ self.begin()
29
+ self.query()
30
+ self.finish()
31
+ self.save_json()
32
+ self.gen_result()
33
+ self.save_db()
34
+
35
+
36
+ def run(domain):
37
+ """
38
+ 类统一调用入口
39
+
40
+ :param str domain: 域名
41
+
42
+ """
43
+ query = FullHuntAPI(domain)
44
+ query.run()
45
+
46
+
47
+ if __name__ == '__main__':
48
+ run('qq.com')
@@ -0,0 +1,45 @@
1
+ from common.query import Query
2
+
3
+
4
+ class HackerTarget(Query):
5
+ def __init__(self, domain):
6
+ Query.__init__(self)
7
+ self.domain = domain
8
+ self.module = 'Dataset'
9
+ self.source = "HackerTargetQuery"
10
+ self.addr = 'https://api.hackertarget.com/hostsearch/'
11
+
12
+ def query(self):
13
+ """
14
+ 向接口查询子域并做子域匹配
15
+ """
16
+ self.header = self.get_header()
17
+ self.proxy = self.get_proxy(self.source)
18
+ params = {'q': self.domain}
19
+ resp = self.get(self.addr, params)
20
+ self.subdomains = self.collect_subdomains(resp)
21
+
22
+ def run(self):
23
+ """
24
+ 类执行入口
25
+ """
26
+ self.begin()
27
+ self.query()
28
+ self.finish()
29
+ self.save_json()
30
+ self.gen_result()
31
+ self.save_db()
32
+
33
+
34
+ def run(domain):
35
+ """
36
+ 类统一调用入口
37
+
38
+ :param str domain: 域名
39
+ """
40
+ query = HackerTarget(domain)
41
+ query.run()
42
+
43
+
44
+ if __name__ == '__main__':
45
+ run('example.com')