mirror of
https://github.com/shmilylty/OneForAll.git
synced 2026-08-26 12:57:50 +08:00
ips更改为content
This commit is contained in:
@@ -64,7 +64,7 @@ class Database(object):
|
|||||||
f'subdomain text,'
|
f'subdomain text,'
|
||||||
f'port int,'
|
f'port int,'
|
||||||
f'level int,'
|
f'level int,'
|
||||||
f'ips text,'
|
f'content text,'
|
||||||
f'status int,'
|
f'status int,'
|
||||||
f'reason text,'
|
f'reason text,'
|
||||||
f'title text,'
|
f'title text,'
|
||||||
@@ -91,11 +91,11 @@ class Database(object):
|
|||||||
try:
|
try:
|
||||||
self.conn.bulk_query(
|
self.conn.bulk_query(
|
||||||
f'insert into "{table_name}" ('
|
f'insert into "{table_name}" ('
|
||||||
f'id, type, valid, new, url, subdomain, port, level, ips,'
|
f'id, type, valid, new, url, subdomain, port, level, content,'
|
||||||
f'status, reason, title, banner, header, response, module,'
|
f'status, reason, title, banner, header, response, module,'
|
||||||
f'source, elapse, count)'
|
f'source, elapse, count)'
|
||||||
f'values (:id, :type, :valid, :new, :url, :subdomain,'
|
f'values (:id, :type, :valid, :new, :url, :subdomain,'
|
||||||
f':port, :level, :ips, :status, :reason, :title, :banner,'
|
f':port, :level, :content, :status, :reason, :title, :banner,'
|
||||||
f':header, :response, :module, :source,:elapse, :count)',
|
f':header, :response, :module, :source,:elapse, :count)',
|
||||||
results)
|
results)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -217,7 +217,7 @@ class Database(object):
|
|||||||
:param any valid: 有效性
|
:param any valid: 有效性
|
||||||
"""
|
"""
|
||||||
table_name = table_name.replace('.', '_')
|
table_name = table_name.replace('.', '_')
|
||||||
query = f'select id, type, valid, new, url, subdomain, port, level, ips,' \
|
query = f'select id, type, valid, new, url, subdomain, port, level, content,' \
|
||||||
f' status, reason, title, banner from "{table_name}"'
|
f' status, reason, title, banner from "{table_name}"'
|
||||||
if valid:
|
if valid:
|
||||||
where = f' where valid = 1'
|
where = f' where valid = 1'
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ class Module(object):
|
|||||||
'subdomain': None,
|
'subdomain': None,
|
||||||
'port': None,
|
'port': None,
|
||||||
'level': None,
|
'level': None,
|
||||||
'ips': None,
|
'content': None,
|
||||||
'status': None,
|
'status': None,
|
||||||
'reason': None,
|
'reason': None,
|
||||||
'title': None,
|
'title': None,
|
||||||
@@ -274,7 +274,7 @@ class Module(object):
|
|||||||
valid = 1
|
valid = 1
|
||||||
url = 'http://' + subdomain
|
url = 'http://' + subdomain
|
||||||
level = subdomain.count('.') - self.domain.count('.')
|
level = subdomain.count('.') - self.domain.count('.')
|
||||||
ips = self.records.get(subdomain)
|
content = self.records.get(subdomain)
|
||||||
result = {'id': None,
|
result = {'id': None,
|
||||||
'type': self.type,
|
'type': self.type,
|
||||||
'valid': valid,
|
'valid': valid,
|
||||||
@@ -283,7 +283,7 @@ class Module(object):
|
|||||||
'subdomain': subdomain,
|
'subdomain': subdomain,
|
||||||
'port': None,
|
'port': None,
|
||||||
'level': level,
|
'level': level,
|
||||||
'ips': ips,
|
'content': content,
|
||||||
'status': None,
|
'status': None,
|
||||||
'reason': None,
|
'reason': None,
|
||||||
'title': None,
|
'title': None,
|
||||||
|
|||||||
@@ -53,9 +53,9 @@ def convert_results(result_list):
|
|||||||
result_dict = {}
|
result_dict = {}
|
||||||
for result in result_list:
|
for result in result_list:
|
||||||
hostname, answer = result
|
hostname, answer = result
|
||||||
value_dict = {'ips': None, 'reason': None, 'valid': None}
|
value_dict = {'content': None, 'reason': None, 'valid': None}
|
||||||
if isinstance(answer, tuple):
|
if isinstance(answer, tuple):
|
||||||
value_dict['ips'] = ','.join(answer[2])
|
value_dict['content'] = ','.join(answer[2])
|
||||||
result_dict[hostname] = value_dict
|
result_dict[hostname] = value_dict
|
||||||
elif isinstance(answer, Exception):
|
elif isinstance(answer, Exception):
|
||||||
value_dict['reason'] = str(answer.args)
|
value_dict['reason'] = str(answer.args)
|
||||||
@@ -69,14 +69,14 @@ def convert_results(result_list):
|
|||||||
|
|
||||||
def filter_subdomain(data_list):
|
def filter_subdomain(data_list):
|
||||||
"""
|
"""
|
||||||
过滤出无IPS值的子域到新的子域列表
|
过滤出无解析内容的子域到新的子域列表
|
||||||
|
|
||||||
:param list data_list: 待过滤的数据列表
|
:param list data_list: 待过滤的数据列表
|
||||||
:return: 符合条件的子域列表
|
:return: 符合条件的子域列表
|
||||||
"""
|
"""
|
||||||
subdomains = []
|
subdomains = []
|
||||||
for data in data_list:
|
for data in data_list:
|
||||||
if not data.get('ips'):
|
if not data.get('content'):
|
||||||
subdomain = data.get('subdomain')
|
subdomain = data.get('subdomain')
|
||||||
subdomains.append(subdomain)
|
subdomains.append(subdomain)
|
||||||
return subdomains
|
return subdomains
|
||||||
@@ -91,7 +91,7 @@ def update_data(data_list, results_dict):
|
|||||||
:return: 更新后的数据列表
|
:return: 更新后的数据列表
|
||||||
"""
|
"""
|
||||||
for index, data in enumerate(data_list):
|
for index, data in enumerate(data_list):
|
||||||
if not data.get('ips'):
|
if not data.get('content'):
|
||||||
subdomain = data.get('subdomain')
|
subdomain = data.get('subdomain')
|
||||||
value_dict = results_dict.get(subdomain)
|
value_dict = results_dict.get(subdomain)
|
||||||
data.update(value_dict)
|
data.update(value_dict)
|
||||||
|
|||||||
Reference in New Issue
Block a user