Skip to content

Commit 9c62cba

Browse files
committed
Added colors and filters
1 parent 00f73d3 commit 9c62cba

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

modules/getweblinks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def getLinks(soup):
2222
pass
2323
"""Pretty print output as below"""
2424
print ('')
25-
print ('Websites Found - '+str(len(websites)))
25+
print (bcolors.OKGREEN+'Websites Found - '+bcolors.ENDC+str(len(websites)))
2626
print ('-------------------------------')
2727
for web in websites:
2828
if (urllib.request.urlopen(web).getcode() == 200):

modules/pagereader.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
import urllib.request
22
from bs4 import BeautifulSoup
3+
from modules.bcolors import bcolors
34

45

5-
def readPage(site):
6+
def readPage(site,printIP=0):
67

78
headers = {'User-Agent': 'TorBot - Onion crawler | www.github.com/DedSecInside/TorBot' }
89
req = urllib.request.Request(site,None,headers)
910
response = urllib.request.urlopen(req)
1011
page = BeautifulSoup(response.read(),'html.parser')
11-
print (page.find_all('strong'))
12+
if printIP:
13+
pg = page.find('strong')
14+
IP = pg.renderContents()
15+
print(bcolors.WARNING+bcolors.BOLD+IP.decode("utf-8")+bcolors.ENDC)
1216
return page

tests/test_getweblinks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def setUp(self):
1616

1717
def test_print_links(self):
1818
#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"
19-
data = "\nWebsites Found - 0\n-------------------------------\n"
19+
data = "\n"+bcolors.OKGREEN+"Websites Found - "+bcolors.ENDC+"0\n-------------------------------\n"
2020

2121
getweblinks.getLinks(soup)
2222
self.assertEqual(sys.stdout.getvalue(),data)

torBot.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,25 +58,25 @@ def header():
5858
print( "MMMMMMMMMMMMMWNklccclldk0OxOdcc;. .......;oKWWMMMMMMMM")
5959
print( "MMMMMMMMMMMMMMMMWXOdl:::;cc;'... ..',:lx0NMMMMMMMMMMMM")
6060
print( "MMMMMMMMMMMMMMMMMMMMMNKOkxddolloodk0XWMMMMMMMMMMMMMMMM")
61-
print(bcolors.FAIL)
61+
print(bcolors.FAIL+bcolors.BOLD)
6262
print( " __ ____ ____ __ ______ ")
6363
print( " / /_/ __ \/ __ \/ /_ ____/_ __/ ")
6464
print( " / __/ / / / /_/ / __ \/ __ \/ / ")
6565
print( " / /_/ /_/ / _, _/ /_/ / /_/ / / ")
6666
print( " \__/\____/_/ |_/_.___/\____/_/ V 0.0.3")
67-
print(bcolors.On_Black)
67+
print(bcolors.FAIL+bcolors.On_Black)
6868
print("#######################################################")
6969
print("# TorBot - A python Tor Crawler #")
7070
print("# GitHub : https://github.com/DedsecInside/TorBot #")
71-
print("######################################################")
71+
print("#######################################################")
7272
print(bcolors.FAIL + "LICENSE: GNU Public License" + bcolors.ENDC)
7373
print()
7474

7575

7676
def main():
7777
header()
7878
print ("Tor Ip Address :")
79-
a = readPage("https://check.torproject.org/")
79+
a = readPage("https://check.torproject.org/",1)
8080
b = readPage("http://torlinkbgs6aabns.onion/")
8181
getMails(b)
8282
getLinks(b)
@@ -88,6 +88,4 @@ def main():
8888
try:
8989
main()
9090
except KeyboardInterrupt:
91-
print("Interrupt received! Exiting cleanly...")
92-
93-
91+
print("Interrupt received! Exiting cleanly...")

0 commit comments

Comments
 (0)