Rename / remove ambiguous names

This commit is contained in:
David Mougeolle 2020-01-07 22:49:24 +01:00
parent 11acf9c47c
commit 8a267e7a3c
2 changed files with 9 additions and 8 deletions

View file

@ -484,7 +484,6 @@ async def handler(lst):
if not analyzed_ranges.count(ip_range):
print('[*] Performing reverse lookup in ' + ip_range)
a = dnssearch.DnsReverse(ip_range, True)
a.list()
res = a.process()
analyzed_ranges.append(ip_range)
else:

View file

@ -2,6 +2,8 @@
import dns.resolver
import dns.reversename
from typing import List
# TODO: need big focus on performance and results parsing, now does the basic.
@ -69,22 +71,22 @@ def __init__(
self.iprange = iprange
self.verbose = verbose
def list(
self) -> list:
def _list_ips_in_range(
self) -> List[str]:
"""
List all the IPs in the range.
They are stored in self.list.
Parameters
----------
Returns
-------
out: None.
out: list.
The list of IPs in the range.
"""
prefix = '.'.join(
self.iprange.split('.')[:-1])
self.list = [prefix + '.' + str(i) for i in range(256)]
return [prefix + '.' + str(i) for i in range(256)]
def run(
self,
@ -118,7 +120,7 @@ def run(
pass
def process(
self) -> list:
self) -> List[str]:
"""
Reverse all the IPs stored in 'self.list'.
@ -131,7 +133,7 @@ def process(
The list of all the found CNAME records.
"""
results = []
for entry in self.list:
for entry in self._list_ips_in_range():
host = self.run(entry)
if host is not None:
# print(' : ' + host.split(':')[1])