Skip to content

Commit

Permalink
add api
Browse files Browse the repository at this point in the history
  • Loading branch information
jx-sec committed Oct 20, 2021
1 parent 51292e2 commit a85aaa2
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions jxwaf/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,11 @@ def waf_update(request):
source_ip.append(process_domain.strip())
else:
try:
resolve_ips = dns.resolver.query(process_domain.strip(), 'A')
for i in resolve_ips.response.answer:
resolver = dns.resolver.Resolver()
resolver.timeout = 2
resolver.lifetime = 2
query = resolver.query(process_domain.strip(),'A')
for i in query.response.answer:
for j in i.items:
if j.rdtype == 1:
source_ip.append(j.address)
Expand Down Expand Up @@ -592,8 +595,11 @@ def waf_update_repair(request):
source_ip.append(process_domain.strip())
else:
try:
resolve_ips = dns.resolver.query(process_domain.strip(), 'A')
for i in resolve_ips.response.answer:
resolver = dns.resolver.Resolver()
resolver.timeout = 2
resolver.lifetime = 2
query = resolver.query(process_domain.strip(),'A')
for i in query.response.answer:
for j in i.items:
if j.rdtype == 1:
source_ip.append(j.address)
Expand Down

0 comments on commit a85aaa2

Please sign in to comment.