mirror of
https://github.com/laramies/theHarvester.git
synced 2024-11-11 09:41:06 +08:00
Add type annotations
This commit is contained in:
parent
e1af1f0a06
commit
8aeea6895e
1 changed files with 12 additions and 4 deletions
|
@ -42,18 +42,25 @@ def process(self):
|
||||||
results.append(host)
|
results.append(host)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
|
|
||||||
class DnsReverse:
|
class DnsReverse:
|
||||||
|
|
||||||
def __init__(self, iprange, verbose=False):
|
def __init__(
|
||||||
|
self,
|
||||||
|
iprange: str,
|
||||||
|
verbose: bool = False) -> None:
|
||||||
self.iprange = iprange
|
self.iprange = iprange
|
||||||
self.verbose = verbose
|
self.verbose = verbose
|
||||||
|
|
||||||
def list(self):
|
def list(
|
||||||
|
self) -> list:
|
||||||
prefix = '.'.join(
|
prefix = '.'.join(
|
||||||
self.iprange.split('.')[:-1])
|
self.iprange.split('.')[:-1])
|
||||||
self.list = [prefix + '.' + str(i) for i in range(256)]
|
self.list = [prefix + '.' + str(i) for i in range(256)]
|
||||||
|
|
||||||
def run(self, ip):
|
def run(
|
||||||
|
self,
|
||||||
|
ip: str) -> str:
|
||||||
if self.verbose:
|
if self.verbose:
|
||||||
esc = chr(27)
|
esc = chr(27)
|
||||||
sys.stdout.write(esc + '[2K' + esc + '[G')
|
sys.stdout.write(esc + '[2K' + esc + '[G')
|
||||||
|
@ -69,7 +76,8 @@ def run(self, ip):
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def process(self):
|
def process(
|
||||||
|
self) -> list:
|
||||||
results = []
|
results = []
|
||||||
for entry in self.list:
|
for entry in self.list:
|
||||||
host = self.run(entry)
|
host = self.run(entry)
|
||||||
|
|
Loading…
Reference in a new issue