mirror of
https://github.com/laramies/theHarvester.git
synced 2025-02-24 22:42:56 +08:00
flake8 changes/ lgtm fixes
This commit is contained in:
parent
357311474f
commit
4db2d1425e
7 changed files with 13 additions and 18 deletions
|
@ -1,3 +1,3 @@
|
||||||
[flake8]
|
[flake8]
|
||||||
ignore = E501, F405, F403, E402
|
ignore = E501, F405, F403, E402
|
||||||
exclude = theHarvester/discovery/DNS/*,theHarvester/discovery/IPy.py,theHarvester/discovery/s3_scanner.py,theHarvester/discovery/dnssearch.py
|
exclude = theHarvester/discovery/IPy.py,theHarvester/discovery/s3_scanner.py
|
|
@ -692,9 +692,8 @@ def entry_point():
|
||||||
start()
|
start()
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print('\n\n\033[93m[!] ctrl+c detected from user, quitting.\n\n \033[0m')
|
print('\n\n\033[93m[!] ctrl+c detected from user, quitting.\n\n \033[0m')
|
||||||
except Exception:
|
except Exception as error_entry_point:
|
||||||
import traceback
|
print(error_entry_point)
|
||||||
print(traceback.print_exc())
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import os
|
|
||||||
import sys
|
import sys
|
||||||
import dns.resolver
|
import dns.resolver
|
||||||
|
|
||||||
# TODO: need big focus on performance and results parsing, now does the basic.
|
# TODO: need big focus on performance and results parsing, now does the basic.
|
||||||
|
|
||||||
|
|
||||||
class DnsForce:
|
class DnsForce:
|
||||||
|
|
||||||
def __init__(self, domain, dnsserver, verbose=False):
|
def __init__(self, domain, dnsserver, verbose=False):
|
||||||
|
@ -13,7 +13,7 @@ def __init__(self, domain, dnsserver, verbose=False):
|
||||||
self.verbose = verbose
|
self.verbose = verbose
|
||||||
try:
|
try:
|
||||||
f = open(self.file, 'r')
|
f = open(self.file, 'r')
|
||||||
except BaseException:
|
except Exception:
|
||||||
print('Error opening DNS dictionary file.')
|
print('Error opening DNS dictionary file.')
|
||||||
sys.exit()
|
sys.exit()
|
||||||
self.list = f.readlines()
|
self.list = f.readlines()
|
||||||
|
@ -28,17 +28,16 @@ def run(self, host):
|
||||||
try:
|
try:
|
||||||
answer = dns.resolver.query(hostname, 'A')
|
answer = dns.resolver.query(hostname, 'A')
|
||||||
print(answer.canonical_name)
|
print(answer.canonical_name)
|
||||||
return answer.canonical_name # TODO: need rework all this results
|
return answer.canonical_name # TODO: need rework all this results
|
||||||
|
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def process(self):
|
def process(self):
|
||||||
results = []
|
results = []
|
||||||
for x in self.list:
|
for x in self.list:
|
||||||
host = self.run(x)
|
host = self.run(x)
|
||||||
if host is not None:
|
if host is not None:
|
||||||
#print(' : ' + host.split(':')[1])
|
# print(' : ' + host.split(':')[1])
|
||||||
results.append(host)
|
results.append(host)
|
||||||
return results
|
return results
|
||||||
|
|
|
@ -77,8 +77,6 @@ def crawl(self, text):
|
||||||
return tmp
|
return tmp
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(f'Exception occurred: {e}')
|
print(f'Exception occurred: {e}')
|
||||||
import traceback as t
|
|
||||||
print(t.print_exc())
|
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def get_emails(self):
|
def get_emails(self):
|
||||||
|
|
|
@ -23,7 +23,6 @@ def port_scanner(self, host, ports):
|
||||||
connect.close()
|
connect.close()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
pass
|
|
||||||
self.lock.release()
|
self.lock.release()
|
||||||
return openports
|
return openports
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
__all__ = ['markup', 'graphs', 'hostchecker']
|
__all__ = ['hostchecker']
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
try:
|
try:
|
||||||
db = stash.stash_manager()
|
db = stash.stash_manager()
|
||||||
db.do_init()
|
db.do_init()
|
||||||
except Exception:
|
except Exception as error:
|
||||||
pass
|
print(f'{error}')
|
||||||
|
|
||||||
class GraphGenerator:
|
class GraphGenerator:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue