mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-10-25 00:56:14 +08:00
Update crtsh.py
This commit is contained in:
@@ -1,4 +1,6 @@
|
|||||||
from common.query import Query
|
from common.query import Query
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
class Crtsh(Query):
|
class Crtsh(Query):
|
||||||
@@ -21,7 +23,40 @@ class Crtsh(Query):
|
|||||||
if not resp:
|
if not resp:
|
||||||
return
|
return
|
||||||
text = resp.text.replace(r'\n', ' ')
|
text = resp.text.replace(r'\n', ' ')
|
||||||
|
"""
|
||||||
|
* > altdns
|
||||||
|
"""
|
||||||
|
subDomains = set()
|
||||||
|
try:
|
||||||
|
jsonData = json.loads(text)
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
for i in range(len(jsonData)):
|
||||||
|
try:
|
||||||
|
name_value = str(jsonData[i]['name_value'])
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
if '*' in name_value:
|
||||||
|
try:
|
||||||
|
if 'certificates' in os.path.dirname(os.path.abspath(__file__)):
|
||||||
|
dictFile = open("../../data/altdns_wordlist.txt", "r", encoding='utf8')
|
||||||
|
else:
|
||||||
|
dictFile = open("./data/altdns_wordlist.txt", "r", encoding='utf8')
|
||||||
|
for line in dictFile.readlines():
|
||||||
|
altdns = line.strip()
|
||||||
|
result = name_value.replace('*', altdns)
|
||||||
|
if self.domain in result:
|
||||||
|
subDomains.add(result)
|
||||||
|
except Exception as e:
|
||||||
|
pass
|
||||||
|
if len(subDomains) > 0:
|
||||||
|
for x in subDomains:
|
||||||
|
text = text + ',' + x + ','
|
||||||
|
"""
|
||||||
|
* > altdns end
|
||||||
|
"""
|
||||||
subdomains = self.match_subdomains(text)
|
subdomains = self.match_subdomains(text)
|
||||||
|
print(subdomains)
|
||||||
self.subdomains.update(subdomains)
|
self.subdomains.update(subdomains)
|
||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
@@ -47,4 +82,4 @@ def run(domain):
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
run('huawei.com')
|
run('163.com')
|
||||||
|
|||||||
Reference in New Issue
Block a user