flake8 changes/ lgtm fixes

This commit is contained in:
Jay Townsend 2019-09-12 22:27:03 +01:00
parent 357311474f
commit 4db2d1425e
7 changed files with 13 additions and 18 deletions

View file

@ -1,3 +1,3 @@
[flake8]
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

View file

@ -692,9 +692,8 @@ def entry_point():
start()
except KeyboardInterrupt:
print('\n\n\033[93m[!] ctrl+c detected from user, quitting.\n\n \033[0m')
except Exception:
import traceback
print(traceback.print_exc())
except Exception as error_entry_point:
print(error_entry_point)
sys.exit(1)

View file

@ -1,9 +1,9 @@
import os
import sys
import dns.resolver
# TODO: need big focus on performance and results parsing, now does the basic.
class DnsForce:
def __init__(self, domain, dnsserver, verbose=False):
@ -13,7 +13,7 @@ def __init__(self, domain, dnsserver, verbose=False):
self.verbose = verbose
try:
f = open(self.file, 'r')
except BaseException:
except Exception:
print('Error opening DNS dictionary file.')
sys.exit()
self.list = f.readlines()
@ -28,17 +28,16 @@ def run(self, host):
try:
answer = dns.resolver.query(hostname, 'A')
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:
pass
def process(self):
results = []
for x in self.list:
host = self.run(x)
if host is not None:
#print(' : ' + host.split(':')[1])
# print(' : ' + host.split(':')[1])
results.append(host)
return results

View file

@ -77,8 +77,6 @@ def crawl(self, text):
return tmp
except Exception as e:
print(f'Exception occurred: {e}')
import traceback as t
print(t.print_exc())
return []
def get_emails(self):

View file

@ -23,7 +23,6 @@ def port_scanner(self, host, ports):
connect.close()
except Exception as e:
print(e)
pass
self.lock.release()
return openports

View file

@ -1 +1 @@
__all__ = ['markup', 'graphs', 'hostchecker']
__all__ = ['hostchecker']

View file

@ -6,8 +6,8 @@
try:
db = stash.stash_manager()
db.do_init()
except Exception:
pass
except Exception as error:
print(f'{error}')
class GraphGenerator: