Skip to content

Commit 0e2fc2f

Browse files
committed
Major Update 1.0.0
1 parent 9c62cba commit 0e2fc2f

2 files changed

Lines changed: 31 additions & 11 deletions

File tree

modules/getweblinks.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,24 @@
66
import bs4
77

88
"""Get all onion links from the website"""
9-
def getLinks(soup):
9+
def getLinks(soup,ext):
1010
_soup_instance = bs4.BeautifulSoup
11-
extensions = ['.onion','.onion/']
11+
extensions = []
12+
if ext:
13+
for e in ext:
14+
extensions.append(e)
1215
if isinstance(type(soup), type(_soup_instance)):
1316
websites = []
1417
for link in soup.find_all('a'):
1518
web_link = link.get('href')
1619
if web_link != None:
17-
if 'http' in web_link:
18-
for extension in extensions:
19-
if web_link.endswith(extension):
20-
websites.append(web_link)
20+
if ('http' in web_link or 'https' in web_link):
21+
if ext:
22+
for exten in extensions:
23+
if web_link.endswith(exten):
24+
websites.append(web_link)
25+
else:
26+
websites.append(web_link)
2127
else:
2228
pass
2329
"""Pretty print output as below"""

torBot.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def header():
6363
print( " / /_/ __ \/ __ \/ /_ ____/_ __/ ")
6464
print( " / __/ / / / /_/ / __ \/ __ \/ / ")
6565
print( " / /_/ /_/ / _, _/ /_/ / /_/ / / ")
66-
print( " \__/\____/_/ |_/_.___/\____/_/ V 0.0.3")
66+
print( " \__/\____/_/ |_/_.___/\____/_/ V 1.0.0")
6767
print(bcolors.FAIL+bcolors.On_Black)
6868
print("#######################################################")
6969
print("# TorBot - A python Tor Crawler #")
@@ -74,12 +74,26 @@ def header():
7474

7575

7676
def main():
77-
header()
77+
parser = argparse.ArgumentParser()
78+
parser.add_argument("-q","--quiet",action="store_true")
79+
parser.add_argument("-u","--url",help="Specifiy a website link to crawl")
80+
parser.add_argument("-m","--mail",action="store_true", help="Get e-mail addresses from the crawled sites.")
81+
parser.add_argument("-e","--extension",action='append',dest='extension',default=[],help="Specifiy additional website extensions to the list(.com or .org etc)")
82+
args = parser.parse_args()
83+
if args.quiet == 0:
84+
header()
7885
print ("Tor Ip Address :")
86+
link = args.url
87+
ext = 0
88+
ext = args.extension
7989
a = readPage("https://check.torproject.org/",1)
80-
b = readPage("http://torlinkbgs6aabns.onion/")
81-
getMails(b)
82-
getLinks(b)
90+
if link:
91+
b = readPage(link)
92+
else:
93+
b = readPage("http://torlinkbgs6aabns.onion/")
94+
if args.mail:
95+
getMails(b)
96+
getLinks(b,ext)
8397
print ("\n\n")
8498
return 0
8599

0 commit comments

Comments
 (0)