Skip to content
21 changes: 11 additions & 10 deletions modules/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from requests.exceptions import HTTPError
import requests
from requests import get

import re
from .link_io import LinkIO


Expand All @@ -32,7 +32,7 @@ def execute_all(link, *, display_status=False):
page,response = LinkIO.read(link, response=True, show_msg=display_status)
response = get(link, verify=False).text
soup = BeautifulSoup(page, 'html.parser')
validation_functions = [get_robots_txt, get_dot_git, get_dot_svn, get_dot_git, get_intel]
validation_functions = [get_robots_txt, get_dot_git, get_dot_svn, get_dot_git, get_intel,get_bitcoin_address]
for validate_func in validation_functions:
try:
validate_func(link,response)
Expand Down Expand Up @@ -71,12 +71,10 @@ def get_robots_txt(target,response):
def get_intel(link,response):
intel=set()
matches = findall(r'''([\w\.-]+s[\w\.-]+\.amazonaws\.com)|([\w\.-]+@[\w\.-]+\.[\.\w]+)''', response)
print("Intel\n--------\n\n")
if matches:
for match in matches:
verb('Intel', match)
intel.add(match)
print("Intel\n--------\n\n %s")
print(intel)

def get_dot_git(target,response):
cprint("[*]Checking for .git folder", 'yellow')
Expand All @@ -90,6 +88,12 @@ def get_dot_git(target,response):
else:
cprint("NO .git folder found", 'blue')

def get_bitcoin_address(target,response):
bitcoins = re.findall(r'^[13][a-km-zA-HJ-NP-Z1-9]{25,34}$',response)
print("BTC FOUND: ",len(bitcoins))
for bitcoin in bitcoins:
print("BTC: ",bitcoin)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','



def get_dot_svn(target,response):
cprint("[*]Checking for .svn folder", 'yellow')
Expand Down Expand Up @@ -121,13 +125,10 @@ def get_dot_htaccess(target,response):


def display_webpage_description(soup):
cprint("[*]Checking for description meta tag", 'yellow')
cprint("[*]Checking for meta tag", 'yellow')
metatags = soup.find_all('meta')
for meta in metatags:
if meta.has_attr('name'):
attributes = meta.attrs
if attributes['name'] == 'description':
cprint("Page description: " + attributes['content'])
print("Meta : ",meta)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing whitespace after ','



def writer(datasets, dataset_names, output_dir):
Expand Down
11 changes: 5 additions & 6 deletions modules/link.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@ def get_emails(node):
emails (list): list of emails
"""
emails = []
for child in node.children:
link = child.get('href')
if link and 'mailto' in link:
email_addr = link.split(':')
if LinkNode.valid_email(email_addr[1]) and len(email_addr) > 1:
emails.append(email_addr[1])
response = node.response.text
mails = re.findall(r'[\w\.-]+@[\w\.-]+', response)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

undefined name 're'

for email in mails:
if LinkNode.valid_email(email):
emails.append(email)
return emails


Expand Down
22 changes: 16 additions & 6 deletions torBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,16 @@
from modules.savefile import saveJson
from modules.info import execute_all

import sys
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'sys' imported but unused

from socketserver import BaseServer
from wsgiref import handlers

# GLOBAL CONSTS
LOCALHOST = "127.0.0.1"
DEFPORT = 9050

# TorBot VERSION
__VERSION = "1.3.1"
__VERSION = "1.3.3"


def connect(address, port):
Expand Down Expand Up @@ -78,7 +82,7 @@ def header():
title = r"""
{banner}
#######################################################
# TorBot - An OSINT Tool for Deep Web #
# TorBot - An OSINT Tool for Dark Web #
# GitHub : https://github.com/DedsecInside/TorBot #
# Help : use -h for help text #
#######################################################
Expand Down Expand Up @@ -114,6 +118,7 @@ def get_args():
parser.add_argument("-i", "--info", action="store_true",
help=' '.join(("Info displays basic info of the",
"scanned site")))
parser.add_argument("--depth", help="Specifiy max depth of crawler (default 1)")
parser.add_argument("-v", "--visualize", action="store_true",
help="Visualizes tree of data gathered.")
parser.add_argument("-d", "--download", action="store_true",
Expand Down Expand Up @@ -152,14 +157,19 @@ def main():
if args.save:
saveJson('Emails', node.emails)
# -i/--info
elif args.info:
if args.info:
execute_all(node.uri)
if args.save:
print('Nothing to save.\n')
elif args.visualize:
tree = LinkTree(node, stop_depth=1)
if args.visualize:
if args.depth:
print(args.depth)
tree = LinkTree(node,stop_depth=args.depth)

else:
tree = LinkTree(node)
tree.show()
elif args.download:
if args.download:
tree = LinkTree(node)
file_name = str(input("File Name (.pdf/.png/.svg): "))
tree.save(file_name)
Expand Down