addr字段改为ip2location 添加ip2region字段

This commit is contained in:
Jing Ling
2020-06-18 16:59:40 +08:00
parent 502bca446d
commit f99f4a62c5
5 changed files with 272 additions and 14 deletions
+7 -5
View File
@@ -79,7 +79,8 @@ class Database(object):
f'ttl text,'
f'cidr text,'
f'asn text,'
f'addr text,'
f'ip2region text,'
f'ip2location text,'
f'resolver text,'
f'module text,'
f'source text,'
@@ -106,11 +107,11 @@ class Database(object):
f'id, type, alive, resolve, request, new, url, subdomain,'
f'port, level, cname, content, public, status, reason,'
f'title, banner, header, response, times, ttl, cidr, asn,'
f'addr, resolver, module, source, elapse, find, brute, valid) '
f'ip2region, ip2location, resolver, module, source, elapse, find, brute, valid) '
f'values (:id, :type, :alive, :resolve, :request, :new,'
f':url, :subdomain, :port, :level, :cname, :content,'
f':public, :status, :reason, :title, :banner, :header,'
f':response, :times, :ttl, :cidr, :asn, :addr, :resolver,'
f':response, :times, :ttl, :cidr, :asn, :ip2region, :ip2location, :resolver,'
f':module, :source, :elapse, :find, :brute, :valid)', results)
except Exception as e:
logger.log('ERROR', e)
@@ -234,8 +235,9 @@ class Database(object):
table_name = table_name.replace('.', '_')
query = f'select id, type, new, alive, request, resolve, url, ' \
f'subdomain, level, cname, content, public, port, status, ' \
f'reason, title, banner, times, ttl, cidr, asn, addr, resolver, ' \
f'module, source, elapse, find, brute, valid from "{table_name}"'
f'reason, title, banner, times, ttl, cidr, asn, ip2region, ' \
f'ip2location, resolver, module, source, elapse, find, brute, valid ' \
f'from "{table_name}"'
if alive and limit:
if limit in ['resolve', 'request']:
where = f' where {limit} = 1'