handle keyboard interrupt + connection errors
This commit is contained in:
@@ -67,6 +67,7 @@ def photon(seedUrl, headers, level, threadCount, delay, timeout, skipDOM):
|
||||
storage.add(main_url + link)
|
||||
else:
|
||||
storage.add(main_url + '/' + link)
|
||||
try:
|
||||
for x in range(level):
|
||||
urls = storage - processed # urls to crawl = all urls - urls that have been crawled
|
||||
# for url in urls:
|
||||
@@ -76,4 +77,6 @@ def photon(seedUrl, headers, level, threadCount, delay, timeout, skipDOM):
|
||||
futures = (threadpool.submit(rec, url) for url in urls)
|
||||
for i in concurrent.futures.as_completed(futures):
|
||||
pass
|
||||
except KeyboardInterrupt:
|
||||
return [forms, processed]
|
||||
return [forms, processed]
|
||||
|
||||
@@ -51,3 +51,4 @@ def requester(url, data, headers, GET, delay, timeout):
|
||||
logger.error('Error Connecting to Host')
|
||||
logger.error('Scanning will continue after 2 minutes')
|
||||
time.sleep(120)
|
||||
return requests.Response()
|
||||
|
||||
@@ -43,7 +43,7 @@ def crawl(scheme, host, main_url, form, blindXSS, blindPayload, headers, delay,
|
||||
url, paramsCopy, headers, GET, delay, timeout)
|
||||
occurences = htmlParser(response, encoding)
|
||||
positions = occurences.keys()
|
||||
efficiencies = filterChecker(
|
||||
occurences = filterChecker(
|
||||
url, paramsCopy, headers, GET, delay, occurences, timeout, encoding)
|
||||
vectors = generator(occurences, response.text)
|
||||
if vectors:
|
||||
|
||||
Reference in New Issue
Block a user