Skip to content

Commit 93fcfce

Browse files
authored
Merge pull request #5 from flashnuke/fix/dns_left
Fix/dns count
2 parents c27a633 + 23c20f7 commit 93fcfce

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

scanners/subdomain_scanner.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,23 @@ def __init__(self, domains_queue=None, original_subdomain=None, *args, **kwargs)
2626
super().__init__(*args, **kwargs)
2727
self.original_subdomain = original_subdomain
2828
if self.original_subdomain is not None:
29-
url_path = self.generate_url_base_path(self.original_subdomain)
30-
self._save_results(f"{url_path}\n")
29+
self._record_found(self.generate_url_base_path(self.original_subdomain))
3130
self.domains_queue = domains_queue if domains_queue else queue.Queue()
3231

3332
def single_bruter(self):
3433

3534
while not self.words_queue.empty() and not ScanManager._SHOULD_ABORT:
3635
subdomain = self.words_queue.get()
36+
url_path = self.generate_url_base_path(subdomain)
3737
if subdomain == self.original_subdomain:
38+
self._update_count(url_path, True)
3839
continue
39-
url_path = self.generate_url_base_path(subdomain)
4040
found = False
4141
try:
4242
res = self._make_request(method="GET", url=url_path)
4343
found = res.status_code
4444
if found:
45-
self._save_results(f"{url_path}\n")
46-
self._log_progress(f"found -> {url_path}")
45+
self._record_found(url_path)
4746
self.domains_queue.put(url_path)
4847
except (requests.exceptions.ConnectionError, requests.exceptions.ConnectTimeout,
4948
requests.exceptions.ReadTimeout, HTTPError):
@@ -58,6 +57,10 @@ def single_bruter(self):
5857
self._update_count(url_path, found)
5958
time.sleep(self.request_cooldown)
6059

60+
def _record_found(self, url_path: str):
61+
self._save_results(f"{url_path}\n")
62+
self._log_progress(f"added to queue -> {url_path}")
63+
6164
def _start_scanner(self) -> queue.Queue:
6265
threads = list()
6366
self._log_status(OutputStatusKeys.State, OutputValues.StateRunning)

0 commit comments

Comments
 (0)