Skip to content
Merged
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions modules/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from .bcolors import *
from .getemails import *
from .getweblinks import *
from .pagereader import *
from .updater import *

__all__ = (bcolors.__all__ + getemails.__all__ + getweblinks.__all__ + pagereader.__all__ + updater.__all__)
7 changes: 5 additions & 2 deletions modules/bcolors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
class bcolors:
__all__ = ['Bcolors']


class Bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
Expand All @@ -10,4 +13,4 @@ class bcolors:
WHITE = '\033[97m'
On_Black = '\033[40m'
On_Red = '\033[41m'


8 changes: 5 additions & 3 deletions modules/getemails.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import sys
import os
sys.path.append(os.path.abspath('../'))
from modules.bcolors import bcolors
from modules.bcolors import Bcolors
import bs4

__all__ = ['getMails']

"""Get all emails from the website"""

def getMails(soup):
Expand All @@ -21,10 +23,10 @@ def getMails(soup):
pass
"""Pretty print output as below"""
print ('')
print (bcolors.OKGREEN+'Mails Found - '+bcolors.ENDC+str(len(emails)))
print (Bcolors.OKGREEN+'Mails Found - '+Bcolors.ENDC+str(len(emails)))
print ('-------------------------------')
for mail in emails:
print (mail)
return ''
else:
raise(bcolors.FAIL+'Method parameter is not of instance bs4.BeautifulSoup'+bcolors.ENDC)
raise(Bcolors.FAIL+'Method parameter is not of instance bs4.BeautifulSoup'+Bcolors.ENDC)
12 changes: 7 additions & 5 deletions modules/getweblinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,26 @@
import os
sys.path.append(os.path.abspath('../'))
import urllib.request
from modules.bcolors import bcolors
from modules.bcolors import Bcolors
import bs4
import time
import threading
import http

__all__ = ['getLinks']

def link_status(web):
link_live = False
try:
urllib.request.urlopen(web)
link_live = True
print(web)
except urllib.error.HTTPError as e:
print(bcolors.On_Red+web+bcolors.ENDC)
print(Bcolors.On_Red+web+Bcolors.ENDC)
except urllib.error.URLError as e:
print(bcolors.On_Red+web+bcolors.ENDC)
print(Bcolors.On_Red+web+Bcolors.ENDC)
except http.client.RemoteDisconnected as e:
print(bcolors.On_Red+web+bcolors.ENDC)
print(Bcolors.On_Red+web+Bcolors.ENDC)
return


Expand Down Expand Up @@ -47,7 +49,7 @@ def getLinks(soup,ext,live=0):
pass
"""Pretty print output as below"""
print ('')
print (bcolors.OKGREEN+'Websites Found - '+bcolors.ENDC+str(len(websites)))
print (Bcolors.OKGREEN+'Websites Found - '+Bcolors.ENDC+str(len(websites)))
print ('-------------------------------')
if live:
threads = []
Expand Down
7 changes: 4 additions & 3 deletions modules/pagereader.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import urllib.request
from bs4 import BeautifulSoup
from modules.bcolors import bcolors
from modules.bcolors import Bcolors

__all__ = ['readPage']

def readPage(site,printIP=0):

Expand All @@ -12,5 +13,5 @@ def readPage(site,printIP=0):
if printIP:
pg = page.find('strong')
IP = pg.renderContents()
print(bcolors.WARNING+bcolors.BOLD+IP.decode("utf-8")+bcolors.ENDC)
return page
print(Bcolors.WARNING+Bcolors.BOLD+IP.decode("utf-8")+Bcolors.ENDC)
return page
4 changes: 3 additions & 1 deletion modules/updater.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import subprocess

__all__ = ['updateTor']

def updateTor():
print("Checking for latest stable release")
isGit = subprocess.Popen("git branch",stdout=subprocess.PIPE,shell=True)
Expand All @@ -22,4 +24,4 @@ def updateTor():
else:
print("TorBot has succesfully updated to latest stable version.")
return 0


4 changes: 2 additions & 2 deletions tests/test_getemails.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from io import StringIO
sys.path.append(os.path.abspath('../modules'))
import getemails
from bcolors import bcolors
from bcolors import Bcolors
import pagereader

soup = pagereader.readPage('http://www.whatsmyip.net/')
Expand All @@ -15,7 +15,7 @@ def setUp(self):
self.held, sys.stdout = sys.stdout, StringIO()

def test_print_emails(self):
data = "\n"+bcolors.OKGREEN+"Mails Found - "+bcolors.ENDC+"1\n-------------------------------\nadvertise@provaz.eu\n"
data = "\n"+Bcolors.OKGREEN+"Mails Found - "+Bcolors.ENDC+"1\n-------------------------------\nadvertise@provaz.eu\n"
getemails.getMails(soup)
self.assertEqual(sys.stdout.getvalue(),data)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_getweblinks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from io import StringIO
sys.path.append(os.path.abspath('../modules'))
import getweblinks
from bcolors import bcolors
from bcolors import Bcolors
import pagereader

soup = pagereader.readPage('http://www.whatsmyip.net/')
Expand All @@ -17,7 +17,7 @@ def setUp(self):

def test_print_links(self):
#data = "\nWebsites Found - 7\n-------------------------------\nhttp://ads.wsrs.net/www/delivery/ck.php?n=MyIP856a6b4\nhttp://ads.wsrs.net/www/delivery/ck.php?n=MyIPbf5d683\nhttp://aff.ironsocket.com/SH7L\nhttp://aff.ironsocket.com/SH7L\nhttp://ads.wsrs.net/www/delivery/ck.php?n=MyIPdb5f512\nhttp://wsrs.net/\nhttp://cmsgear.com/\n"
data = "\n"+bcolors.OKGREEN+"Websites Found - "+bcolors.ENDC+"1\n-------------------------------\nhttp://cmsgear.com/\n"
data = "\n"+Bcolors.OKGREEN+"Websites Found - "+Bcolors.ENDC+"1\n-------------------------------\nhttp://cmsgear.com/\n"
ext = ['.com/']
getweblinks.getLinks(soup,ext)
self.assertEqual(sys.stdout.getvalue(),data)
Expand Down
25 changes: 14 additions & 11 deletions torBot.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from modules.getemails import getMails
from modules.getweblinks import getLinks
from modules.pagereader import readPage
from modules.bcolors import bcolors
from modules.updater import updateTor
#from modules.getemails import getMails
#from modules.getweblinks import getLinks
#from modules.pagereader import readPage
#from modules.bcolors import bcolors
#from modules.updater import updateTor

from modules import *

import socket
import socks
import argparse
Expand Down Expand Up @@ -37,8 +40,8 @@ def header():
print( "MMMMMMMMMMMMMMMMMMMMMMMMMMMW0doccloONMWWMMMMMMMMMMMMMM")
print( "MMMMMMMMMMMMMMMMMMMMMMMMMMMKl;;:cxKWMMMMMMMMMMMMMMMMMM")
print( "MMMMMMMMMMMMMMMMMMMMMMWKOXNx;,,cONMMMMMMMMMMMMMMMMMMMM")
print( "MMMMMMMMMMMMMMMMMMMMMMMXdxKk:',lONMMMM"+bcolors.FAIL + " D3DSEC "+bcolors.WHITE+"MMMMMMMM")
print( "MMMMMMMMMMMMMMMMMMMMMMMMOo0NOdxc,kMMMM"+bcolors.FAIL + " INS1DE "+bcolors.WHITE+"MMMMMMMM")
print( "MMMMMMMMMMMMMMMMMMMMMMMXdxKk:',lONMMMM"+Bcolors.FAIL + " D3DSEC "+Bcolors.WHITE+"MMMMMMMM")
print( "MMMMMMMMMMMMMMMMMMMMMMMMOo0NOdxc,kMMMM"+Bcolors.FAIL + " INS1DE "+Bcolors.WHITE+"MMMMMMMM")
print( "MMMMMMMMMMMMMMMMMMMMMMMMOcONOxkx;dWMMMMMMMMMMMMMMMMMMM")
print( "MMMMMMMMMMMMMMMMMMMMMMNkcdXXOkxkd:oXMMMMMMMMMMMMMMMMMM")
print( "MMMMMMMMMMMMMMMMMMMNOoclONNX00OkOxc:lkXWMMMMMMMMMMMMMM")
Expand All @@ -59,18 +62,18 @@ def header():
print( "MMMMMMMMMMMMMWNklccclldk0OxOdcc;. .......;oKWWMMMMMMMM")
print( "MMMMMMMMMMMMMMMMWXOdl:::;cc;'... ..',:lx0NMMMMMMMMMMMM")
print( "MMMMMMMMMMMMMMMMMMMMMNKOkxddolloodk0XWMMMMMMMMMMMMMMMM")
print(bcolors.FAIL+bcolors.BOLD)
print(Bcolors.FAIL+Bcolors.BOLD)
print( " __ ____ ____ __ ______ ")
print( " / /_/ __ \/ __ \/ /_ ____/_ __/ ")
print( " / __/ / / / /_/ / __ \/ __ \/ / ")
print( " / /_/ /_/ / _, _/ /_/ / /_/ / / ")
print( " \__/\____/_/ |_/_.___/\____/_/ V"+_VERSION_)
print(bcolors.FAIL+bcolors.On_Black)
print(Bcolors.FAIL+Bcolors.On_Black)
print("#######################################################")
print("# TorBot - A python Tor Crawler #")
print("# GitHub : https://github.com/DedsecInside/TorBot #")
print("#######################################################")
print(bcolors.FAIL + "LICENSE: GNU Public License" + bcolors.ENDC)
print(Bcolors.FAIL + "LICENSE: GNU Public License" + Bcolors.ENDC)
print()


Expand Down Expand Up @@ -115,4 +118,4 @@ def main():
try:
main()
except KeyboardInterrupt:
print("Interrupt received! Exiting cleanly...")
print("Interrupt received! Exiting cleanly...")