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