diff --git a/src/torbot/modules/info.py b/src/torbot/modules/info.py index d5c2a17d..15279e4c 100644 --- a/src/torbot/modules/info.py +++ b/src/torbot/modules/info.py @@ -70,7 +70,6 @@ def execute_all( get_robots_txt, get_dot_git, get_dot_svn, - get_dot_git, get_intel, get_dot_htaccess, get_bitcoin_address, @@ -114,7 +113,8 @@ def get_robots_txt(client: httpx.Client, target: str, response: str) -> None: target = "{0.scheme}://{0.netloc}/".format(urlsplit(url)) client.get(target + "robots.txt") print(target + "robots.txt") - matches = re.findall(r"Allow: (.*)|Disallow: (.*)", response) + + matches = re.findall(r"Allow: (.*)|Disallow: (.*)", response.text) for match in matches: match = "".join(match) if "*" not in match: @@ -151,7 +151,7 @@ def get_dot_git(client: httpx.Client, target: str, response: str) -> None: url = target target = "{0.scheme}://{0.netloc}/".format(urlsplit(url)) resp = client.get(target + "/.git/config") - if not resp.text.__contains__("404"): + if resp.status_code != 404: cprint("Alert!", "red") cprint(".git folder exposed publicly", "red") else: @@ -181,8 +181,8 @@ def get_dot_svn(client: httpx.Client, target: str, response: str) -> None: cprint("[*]Checking for .svn folder", "yellow") url = target target = "{0.scheme}://{0.netloc}/".format(urlsplit(url)) - resp = httpx.get(target + "/.svn/entries", proxies="socks5://127.0.0.1:9050") - if not resp.text.__contains__("404"): + resp = client.get(target + "/.svn/entries") + if resp.status_code != 404: cprint("Alert!", "red") cprint(".SVN folder exposed publicly", "red") else: @@ -199,10 +199,10 @@ def get_dot_htaccess(client: httpx.Client, target: str, response: str) -> None: cprint("[*]Checking for .htaccess", "yellow") url = target target = "{0.scheme}://{0.netloc}/".format(urlsplit(url)) - resp = httpx.get(target + "/.htaccess", proxies="socks5://127.0.0.1:9050") - if resp.text.__contains__("403"): + resp = client.get(target + "/.htaccess") + if resp.status_code == 403: cprint("403 Forbidden", "blue") - elif not resp.text.__contains__("404") or resp.text.__contains__("500"): + elif resp.status_code != 404 and resp.status_code != 500: cprint("Alert!!", "blue") cprint(".htaccess file found!", "blue") else: