Skip to content

Commit

Permalink
Implement regex expression to find .onion links in --file option
Browse files Browse the repository at this point in the history
  • Loading branch information
k4m4 committed Nov 28, 2017
1 parent 7e074a4 commit 0248dea
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
8 changes: 5 additions & 3 deletions onioff.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
See License at nikolaskama.me (https://nikolaskama.me/onioffproject)
"""

import socket, socks, requests, sys, os, optparse, time, httplib, datetime
import socket, socks, requests, sys, os, optparse, time, httplib, datetime, re
from termcolor import colored
from bs4 import BeautifulSoup
from time import sleep
Expand Down Expand Up @@ -141,11 +141,13 @@ def readFile(file): # Read Onion File
with open(file, 'r') as myFile:
if os.path.getsize(file) > 0:
onions = myFile.readlines()
for onion in onions:
for onion in re.findall(r'(?:https?://)?(?:www)?\S*?\.onion', '\n'.join(onions)):
onion = onion.replace('\n', '')
if not onion.startswith('http') and not onion.startswith('https'):
if not len(onion) > len('.onion'):
pass
else:
if not onion.startswith('http') and not onion.startswith('https'):
onion = 'http://'+str(onion)
checkOnion(onion)
else:
flushPrint("\n[-] Dictionary Is Empty --> Please Enter A Valid File", True, True)
Expand Down
1 change: 1 addition & 0 deletions reports/onioff_2017-11-23_11:47:34.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
http://xmh57jrzrnw6insl.onion/, TORCH: Tor Search!
Empty file.
Empty file.

0 comments on commit 0248dea

Please sign in to comment.