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