File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ class bcolors :
2+ HEADER = '\033 [95m'
3+ OKBLUE = '\033 [94m'
4+ OKGREEN = '\033 [92m'
5+ WARNING = '\033 [93m'
6+ FAIL = '\033 [91m'
7+ ENDC = '\033 [0m'
8+ BOLD = '\033 [1m'
9+ UNDERLINE = '\033 [4m'
10+ WHITE = '\033 [97m'
11+ On_Black = '\033 [40m'
12+ On_Red = '\033 [41m'
13+
Original file line number Diff line number Diff line change 1+ from modules .bcolors import bcolors
12import bs4
23
34"""Get all emails from the website"""
@@ -17,10 +18,10 @@ def getMails(soup):
1718 pass
1819 """Pretty print output as below"""
1920 print ('' )
20- print ('Mails Found - ' + str (len (emails )))
21+ print (bcolors . OKGREEN + 'Mails Found - ' + bcolors . ENDC + str (len (emails )))
2122 print ('-------------------------------' )
2223 for mail in emails :
2324 print (mail )
2425 return ''
2526 else :
26- raise ('Method parameter is not of instance bs4.BeautifulSoup' )
27+ raise (bcolors . FAIL + 'Method parameter is not of instance bs4.BeautifulSoup' + bcolors . ENDC )
Original file line number Diff line number Diff line change 1+ import urllib .request
2+ import modules .bcolors
13import bs4
24
35"""Get all onion links from the website"""
@@ -20,7 +22,10 @@ def getLinks(soup):
2022 print ('Websites Found - ' + str (len (websites )))
2123 print ('-------------------------------' )
2224 for web in websites :
23- print (web )
25+ if (urllib .request .urlopen (web ).getcode () == 200 ):
26+ print (web )
27+ else :
28+ print (bcolors .On_Red + web + bcolors .ENDC )
2429 return websites
2530 else :
2631 raise ('Method parameter is not of instance bs4.BeautifulSoup' )
Original file line number Diff line number Diff line change 11from modules .getemails import getMails
22from modules .getweblinks import getLinks
33from modules .pagereader import readPage
4+ from modules .bcolors import bcolors
45import socket
56import socks
67import argparse
@@ -23,20 +24,6 @@ def getaddrinfo(*args):
2324
2425socket .getaddrinfo = getaddrinfo
2526
26- class bcolors :
27- HEADER = '\033 [95m'
28- OKBLUE = '\033 [94m'
29- OKGREEN = '\033 [92m'
30- WARNING = '\033 [93m'
31- FAIL = '\033 [91m'
32- ENDC = '\033 [0m'
33- BOLD = '\033 [1m'
34- UNDERLINE = '\033 [4m'
35- WHITE = '\033 [97m'
36- On_Black = '\033 [40m'
37- On_Red = '\033 [41m'
38-
39-
4027def header ():
4128 """ Display the header of TorBot """
4229 print ("#######################################################" )
@@ -97,4 +84,10 @@ def main():
9784 return 0
9885
9986if __name__ == '__main__' :
87+
88+ try :
10089 main ()
90+ except KeyboardInterrupt :
91+ print ("Interrupt received! Exiting cleanly..." )
92+
93+
You can’t perform that action at this time.
0 commit comments