Skip to content

Commit 4b96f9c

Browse files
committed
Revert the dev commit
1 parent 4840cf9 commit 4b96f9c

File tree

5 files changed

+64
-166
lines changed

5 files changed

+64
-166
lines changed

README.md

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -65,33 +65,29 @@ the following steps:
6565
8. After all URLs are processed, return the most relevant page.
6666

6767
### Features
68-
1. Crawls Tor links (.onion).(Partially Completed)
69-
2. Returns Page title and address with a short description about the site.(Partially Completed)
70-
3. Save links to database.(Not Started)
71-
4. Get emails from site.(Completed)
72-
5. Save crawl info to file.(Completed)
73-
6. Crawl custom domains.(Completed)
74-
7. Check if the link is live.(Complete)
75-
4. Built-in Updater.(Completed)
68+
1. Crawls Tor links (.onion) only.
69+
2. Returns Page title and address.
70+
3. Cache links so that there won't be duplicate links.
7671
...(will be updated)
7772

7873
## Contribute
7974
Contributions to this project are always welcome.
80-
To add a new feature fork the dev branch and give a pull request when your new feature is tested and complete.
75+
To add a new feature fork this repository and give a pull request when your new feature is tested and complete.
8176
If its a new module, it should be put inside the modules directory and imported to the main file.
8277
The branch name should be your new feature name in the format <Feature_featurename_version(optional)>. For example, <i>Feature_FasterCrawl_1.0</i>.
8378
Contributor name will be updated to the below list. :D
8479

8580
## Dependencies
8681
1. Tor
87-
2. Python 3.x (Make sure pip3 is installed)
82+
2. Python 3.x (Make sure pip3 is there)
8883
3. Python Stem Module
8984
4. urllib
9085
5. Beautiful Soup 4
9186
6. Socket
9287
7. Sock
9388
8. Argparse
94-
9. Git
89+
9. Stem module
90+
10. Git
9591

9692
## Basic setup
9793
Before you run the torBot make sure the following things are done properly:
@@ -109,23 +105,17 @@ with Controller.from_port(port = 9051) as controller:
109105
controller.signal(Signal.NEWNYM)`
110106

111107
`python3 torBot.py`
112-
`usage: torBot.py [-h] [-v] [--update] [-q] [-u URL] [-s] [-m] [-e EXTENSION]
113-
[-l] [-i]
108+
`usage: torBot.py [-h] [-q] [-u URL] [-m] [-e EXTENSION] [-l]
114109

115110
optional arguments:
116111
-h, --help show this help message and exit
117-
-v, --version Show current version of TorBot.
118-
--update Update TorBot to the latest stable version
119112
-q, --quiet
120113
-u URL, --url URL Specifiy a website link to crawl
121-
-s, --save Save results in a file
122114
-m, --mail Get e-mail addresses from the crawled sites
123115
-e EXTENSION, --extension EXTENSION
124116
Specifiy additional website extensions to the
125117
list(.com or .org etc)
126-
-l, --live Check if websites are live or not (slow)
127-
-i, --info Info displays basic info of the scanned site (very
128-
slow)`
118+
-l, --live Check if websites are live or not (slow)`
129119

130120
Read more about torrc here : [Torrc](https://github.com/DedSecInside/TorBoT/blob/master/Tor.md)
131121

modules/getweblinks.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,11 @@
1414

1515
def link_status(web,out_queue,index):
1616
link_live = False
17-
live_links = 0
1817
out_queue[index] = web + " is_live = False "
1918
try:
2019
urllib.request.urlopen(web)
2120
link_live = True
2221
out_queue[index] = web + " is_live = True "
23-
live_links += 1
2422
print(web)
2523
except urllib.error.HTTPError as e:
2624
print(Bcolors.On_Red+web+Bcolors.ENDC)
@@ -76,8 +74,6 @@ def getLinks(soup,ext,live=0,save=0):
7674
print(web)
7775
if save:
7876
saveJson("Onion-Links",websites)
79-
return websites
80-
#print (Bcolors.OKGREEN+'Live Links:'+live_links+' Dead Links:'+(str(len(websites))-live_links))
81-
#print ('-------------------------------')
77+
return websites
8278
else:
8379
raise('Method parameter is not of instance bs4.BeautifulSoup')

modules/info.py

Lines changed: 0 additions & 79 deletions
This file was deleted.

modules/updater.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44

55
def updateTor():
66
print("Checking for latest stable release")
7-
isGit = subprocess.Popen(["git","branch"],stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
8-
output = isGit.stdout.read()
7+
isGit = subprocess.Popen("git branch",stdout=subprocess.PIPE,shell=True)
8+
(output,err)=isGit.communicate()
99
branch = output[2:8].decode("utf-8")
10-
if branch == '* master':
10+
if branch == 'master':
1111
update = subprocess.Popen(["git","pull","origin","master"],stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
1212
update_out = update.stdout.read()
13-
if update_out[90:109].decode("utf-8") == 'Already up-to-date.' :
14-
print("TorBot is already up-to-date.")
13+
if update_out[85:104].decode("utf-8") == 'Already up-to-date.' :
14+
print("TorBot Already up-to-date.")
1515
else:
1616
print("TorBot has succesfully updated to latest stable version.")
1717
else:
1818
subprocess.Popen(["git","init"],stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
1919
subprocess.Popen(["git","remote","add","origin","https://github.com/DedSecInside/TorBoT.git"],stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
2020
update = subprocess.Popen(["git","pull","origin","master"],stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
2121
update_out = update.stdout.read()
22-
if update_out[90:109].decode("utf-8") == 'Already up-to-date.' :
23-
print("TorBot is already up-to-date.")
22+
if update_out[85:104].decode("utf-8") == 'Already up-to-date.' :
23+
print("TorBot Already up-to-date.")
2424
else:
2525
print("TorBot has succesfully updated to latest stable version.")
2626
return 0

torBot.py

Lines changed: 47 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
#from modules.getemails import getMails
2+
#from modules.getweblinks import getLinks
3+
#from modules.pagereader import readPage
4+
#from modules.bcolors import bcolors
5+
#from modules.updater import updateTor
6+
17
from modules import *
28

39
import socket
@@ -8,30 +14,23 @@
814
from stem.control import Controller
915

1016
with Controller.from_port(port = 9051) as controller:
11-
controller.authenticate("16:3BEA46EB6C489B90608A65120BD7CF0C7BA709513AB8ACF212B9537183")
12-
controller.signal(Signal.NEWNYM)
17+
controller.authenticate("16:3BEA46EB6C489B90608A65120BD7CF0C7BA709513AB8ACF212B9537183")
18+
controller.signal(Signal.NEWNYM)
1319
#TorBot VERSION
14-
_VERSION_ = "1.1.0_dev"
20+
_VERSION_ = "1.0.1"
1521
#TOR SETUP GLOBAL Vars
1622
SOCKS_PORT = 9050 # TOR proxy port that is default from torrc, change to whatever torrc is configured to
1723
socks.set_default_proxy(socks.SOCKS5, "127.0.0.1",SOCKS_PORT)
1824
socket.socket = socks.socksocket
19-
20-
21-
22-
2325
# Perform DNS resolution through the socket
2426
def getaddrinfo(*args):
2527
return [(socket.AF_INET, socket.SOCK_STREAM, 6, '', (args[0], args[1]))]
2628

2729
socket.getaddrinfo = getaddrinfo
2830

29-
30-
31-
3231
def header():
3332
""" Display the header of TorBot """
34-
print( "######################################################")
33+
print("#######################################################")
3534
print( "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWMMMMMMMMMMMMM")
3635
print( "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWMMMMMMMMMMMMMM")
3736
print( "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNXNWWWWWMMMMMMMMMM")
@@ -73,57 +72,49 @@ def header():
7372
print("#######################################################")
7473
print("# TorBot - A python Tor Crawler #")
7574
print("# GitHub : https://github.com/DedsecInside/TorBot #")
76-
print("# Help : use -h for help text #")
7775
print("#######################################################")
7876
print(Bcolors.FAIL + "LICENSE: GNU Public License" + Bcolors.ENDC)
7977
print()
8078

8179

82-
83-
8480
def main():
85-
parser = argparse.ArgumentParser()
86-
parser.add_argument("-v","--version",action="store_true",help="Show current version of TorBot.")
87-
parser.add_argument("--update",action="store_true",help="Update TorBot to the latest stable version")
88-
parser.add_argument("-q","--quiet",action="store_true")
89-
parser.add_argument("-u","--url",help="Specifiy a website link to crawl")
90-
parser.add_argument("-s","--save",action="store_true", help="Save results in a file")
91-
parser.add_argument("-m","--mail",action="store_true", help="Get e-mail addresses from the crawled sites")
92-
parser.add_argument("-e","--extension",action='append',dest='extension',default=[],help="Specifiy additional website extensions to the list(.com or .org etc)")
93-
parser.add_argument("-l","--live",action="store_true",help="Check if websites are live or not (slow)")
94-
parser.add_argument("-i","--info",action="store_true",help="Info displays basic info of the scanned site (very slow)")
95-
96-
args = parser.parse_args()
97-
if args.version :
98-
print("TorBot Version:"+_VERSION_)
99-
exit()
100-
if args.update:
101-
updateTor()
102-
exit()
103-
104-
if args.quiet == 0:
105-
header()
106-
print ("Tor Ip Address :")
107-
link = args.url
108-
ext = 0
109-
live = 0
110-
save=0
111-
live = args.live
112-
ext = args.extension
113-
save = args.save
114-
a = readPage("https://check.torproject.org/",1)
115-
if link:
116-
b = readPage(link)
117-
else:
118-
b = readPage("http://torlinkbgs6aabns.onion/",0)
119-
if args.mail:
120-
getMails(b,save)
121-
if args.info:
122-
inf = info()
123-
scan(link)
124-
getLinks(b,ext,live,save)
125-
print ("\n\n")
126-
return 0
81+
parser = argparse.ArgumentParser()
82+
parser.add_argument("-v","--version",action="store_true",help="Show current version of TorBot.")
83+
parser.add_argument("--update",action="store_true",help="Update TorBot to the latest stable version")
84+
parser.add_argument("-q","--quiet",action="store_true")
85+
parser.add_argument("-u","--url",help="Specifiy a website link to crawl")
86+
parser.add_argument("-s","--save",action="store_true", help="Save results in a file")
87+
parser.add_argument("-m","--mail",action="store_true", help="Get e-mail addresses from the crawled sites")
88+
parser.add_argument("-e","--extension",action='append',dest='extension',default=[],help="Specifiy additional website extensions to the list(.com or .org etc)")
89+
parser.add_argument("-l","--live",action="store_true",help="Check if websites are live or not (slow)")
90+
args = parser.parse_args()
91+
if args.version :
92+
print("TorBot Version:"+_VERSION_)
93+
exit()
94+
if args.update:
95+
updateTor()
96+
exit()
97+
98+
if args.quiet == 0:
99+
header()
100+
print ("Tor Ip Address :")
101+
link = args.url
102+
ext = 0
103+
live = 0
104+
save=0
105+
live = args.live
106+
ext = args.extension
107+
save = args.save
108+
a = readPage("https://check.torproject.org/",1)
109+
if link:
110+
b = readPage(link)
111+
else:
112+
b = readPage("http://torlinkbgs6aabns.onion/")
113+
if args.mail:
114+
getMails(b,save)
115+
getLinks(b,ext,live,save)
116+
print ("\n\n")
117+
return 0
127118

128119
if __name__ == '__main__':
129120

0 commit comments

Comments
 (0)