diff --git a/core/photon.py b/core/photon.py index 9a7b1ae..597716d 100644 --- a/core/photon.py +++ b/core/photon.py @@ -67,13 +67,16 @@ def photon(seedUrl, headers, level, threadCount, delay, timeout, skipDOM): storage.add(main_url + link) else: storage.add(main_url + '/' + link) - for x in range(level): - urls = storage - processed # urls to crawl = all urls - urls that have been crawled - # for url in urls: - # rec(url) - threadpool = concurrent.futures.ThreadPoolExecutor( - max_workers=threadCount) - futures = (threadpool.submit(rec, url) for url in urls) - for i in concurrent.futures.as_completed(futures): - pass + try: + for x in range(level): + urls = storage - processed # urls to crawl = all urls - urls that have been crawled + # for url in urls: + # rec(url) + threadpool = concurrent.futures.ThreadPoolExecutor( + max_workers=threadCount) + 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] diff --git a/core/requester.py b/core/requester.py index 79fbbca..31c4c27 100755 --- a/core/requester.py +++ b/core/requester.py @@ -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() diff --git a/modes/crawl.py b/modes/crawl.py index 30a6c38..2c39aac 100644 --- a/modes/crawl.py +++ b/modes/crawl.py @@ -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: