|
| 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 | + |
1 | 7 | from modules import *
|
2 | 8 |
|
3 | 9 | import socket
|
|
8 | 14 | from stem.control import Controller
|
9 | 15 |
|
10 | 16 | 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) |
13 | 19 | #TorBot VERSION
|
14 |
| -_VERSION_ = "1.1.0_dev" |
| 20 | +_VERSION_ = "1.0.1" |
15 | 21 | #TOR SETUP GLOBAL Vars
|
16 | 22 | SOCKS_PORT = 9050 # TOR proxy port that is default from torrc, change to whatever torrc is configured to
|
17 | 23 | socks.set_default_proxy(socks.SOCKS5, "127.0.0.1",SOCKS_PORT)
|
18 | 24 | socket.socket = socks.socksocket
|
19 |
| - |
20 |
| - |
21 |
| - |
22 |
| - |
23 | 25 | # Perform DNS resolution through the socket
|
24 | 26 | def getaddrinfo(*args):
|
25 | 27 | return [(socket.AF_INET, socket.SOCK_STREAM, 6, '', (args[0], args[1]))]
|
26 | 28 |
|
27 | 29 | socket.getaddrinfo = getaddrinfo
|
28 | 30 |
|
29 |
| - |
30 |
| - |
31 |
| - |
32 | 31 | def header():
|
33 | 32 | """ Display the header of TorBot """
|
34 |
| - print( "######################################################") |
| 33 | + print("#######################################################") |
35 | 34 | print( "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWMMMMMMMMMMMMM")
|
36 | 35 | print( "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWMMMMMMMMMMMMMM")
|
37 | 36 | print( "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNXNWWWWWMMMMMMMMMM")
|
@@ -73,57 +72,49 @@ def header():
|
73 | 72 | print("#######################################################")
|
74 | 73 | print("# TorBot - A python Tor Crawler #")
|
75 | 74 | print("# GitHub : https://github.com/DedsecInside/TorBot #")
|
76 |
| - print("# Help : use -h for help text #") |
77 | 75 | print("#######################################################")
|
78 | 76 | print(Bcolors.FAIL + "LICENSE: GNU Public License" + Bcolors.ENDC)
|
79 | 77 | print()
|
80 | 78 |
|
81 | 79 |
|
82 |
| - |
83 |
| - |
84 | 80 | 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 |
127 | 118 |
|
128 | 119 | if __name__ == '__main__':
|
129 | 120 |
|
|
0 commit comments