-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from common.query import Query | ||
|
||
|
||
class MySSL(Query): | ||
def __init__(self, domain): | ||
Query.__init__(self) | ||
self.domain = domain | ||
self.module = 'Certificate' | ||
self.source = 'MySSLQuery' | ||
self.addr = 'https://myssl.com/api/v1/discover_sub_domain' | ||
|
||
def query(self): | ||
""" | ||
向接口查询子域并做子域匹配 | ||
""" | ||
self.header = self.get_header() | ||
self.proxy = self.get_proxy(self.source) | ||
params = {'domain': self.domain} | ||
resp = self.get(self.addr, params) | ||
self.subdomains = self.collect_subdomains(resp) | ||
|
||
def run(self): | ||
""" | ||
类执行入口 | ||
""" | ||
self.begin() | ||
self.query() | ||
self.finish() | ||
self.save_json() | ||
self.gen_result() | ||
self.save_db() | ||
|
||
|
||
def run(domain): | ||
""" | ||
类统一调用入口 | ||
:param str domain: 域名 | ||
""" | ||
query = MySSL(domain) | ||
query.run() | ||
|
||
|
||
if __name__ == '__main__': | ||
run('freebuf.com') |