Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/torbot/modules/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand Down