Skip to content

Commit 312e8f0

Browse files
authored
Merge pull request #21 from DedSecInside/dev_1.0
Dev 1.0
2 parents be43170 + 6a1d420 commit 312e8f0

2 files changed

Lines changed: 23 additions & 12 deletions

File tree

modules/getweblinks.py

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

88
"""Get all onion links from the website"""
9-
def getLinks(soup,ext):
9+
def getLinks(soup,ext,live=0):
1010
_soup_instance = bs4.BeautifulSoup
1111
extensions = []
1212
if ext:
@@ -30,16 +30,24 @@ def getLinks(soup,ext):
3030
print ('')
3131
print (bcolors.OKGREEN+'Websites Found - '+bcolors.ENDC+str(len(websites)))
3232
print ('-------------------------------')
33-
for web in websites:
34-
flag=1
35-
try:
36-
urllib.request.urlopen(web)
37-
except urllib.error.HTTPError as e:
38-
if e.code:
33+
if live:
34+
for web in websites:
35+
flag=1
36+
try:
37+
urllib.request.urlopen(web)
38+
except urllib.error.HTTPError as e:
39+
if e.code:
40+
print(bcolors.On_Red+web+bcolors.ENDC)
41+
flag=0
42+
except urllib.error.URLError as e:
3943
print(bcolors.On_Red+web+bcolors.ENDC)
4044
flag=0
41-
if flag:
42-
print(web)
43-
return websites
45+
46+
if flag:
47+
print(web)
48+
else:
49+
for web in websites:
50+
print(web)
51+
return websites
4452
else:
4553
raise('Method parameter is not of instance bs4.BeautifulSoup')

torBot.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,17 @@ def main():
7777
parser = argparse.ArgumentParser()
7878
parser.add_argument("-q","--quiet",action="store_true")
7979
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.")
80+
parser.add_argument("-m","--mail",action="store_true", help="Get e-mail addresses from the crawled sites")
8181
parser.add_argument("-e","--extension",action='append',dest='extension',default=[],help="Specifiy additional website extensions to the list(.com or .org etc)")
82+
parser.add_argument("-l","--live",action="store_true",help="Check if websites are live or not (slow)")
8283
args = parser.parse_args()
8384
if args.quiet == 0:
8485
header()
8586
print ("Tor Ip Address :")
8687
link = args.url
8788
ext = 0
89+
live = 0
90+
live = args.live
8891
ext = args.extension
8992
a = readPage("https://check.torproject.org/",1)
9093
if link:
@@ -93,7 +96,7 @@ def main():
9396
b = readPage("http://torlinkbgs6aabns.onion/")
9497
if args.mail:
9598
getMails(b)
96-
getLinks(b,ext)
99+
getLinks(b,ext,live)
97100
print ("\n\n")
98101
return 0
99102

0 commit comments

Comments
 (0)