-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess-handler.py
More file actions
executable file
·93 lines (73 loc) · 2.21 KB
/
process-handler.py
File metadata and controls
executable file
·93 lines (73 loc) · 2.21 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
import webbrowser
import winsound
import time
import random
import threading
import ctypes
import pyautogui
from plyer import notification
from pynput.keyboard import Key, Listener
pyautogui.FAILSAFE = False
def terminate_thread(thread):
if not thread.is_alive():
return
exc = ctypes.py_object(SystemExit)
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(ctypes.c_long(thread.ident), exc)
if res == 0:
raise ValueError("nonexistent thread id")
elif res > 1:
ctypes.pythonapi.PyThreadState_SetAsyncExc(thread.ident, None)
raise SystemError("PyThreadState_SetAsyncExc failed")
### START ###
# PAYLOAD 1
def window_spam():
while True:
webbrowser.open('https://i.imgflip.com/2ujj2e.jpg', new=1)
time.sleep(1)
# PAYLOAD 2
def sound():
frequency = random.randrange(8000, 10000)
duration = random.randrange(3000, 5000)
while True:
winsound.Beep(frequency, duration)
time.sleep(1.2)
# PAYLOAD 3
def alert():
def move_mouse(Duration):
start = time.time()
time_elapsed = time.time() - start
xsize, ysize = pyautogui.size()
while time_elapsed < Duration:
x, y = random.randrange(xsize), random.randrange(ysize)
pyautogui.moveTo(x, y, duration=0.2)
time_elapsed = time.time() - start
while True:
move_mouse(120)
time.sleep(1.2)
all_thread = []
mouse = threading.Thread(target=alert)
spam = threading.Thread(target=window_spam)
sound = threading.Thread(target=sound)
mouse.start()
all_thread.append(mouse)
spam.start()
all_thread.append(spam)
sound.start()
all_thread.append(sound)
keys = []
for i in range(0,5):
notification.notify(
title='HAHA Gotcha',
message='Press the ESC multiple times to exit out of this',
app_name='Process-manager'
)
def on_press(key):
keys.append(key)
def on_release(key):
if key == Key.esc:
terminate_thread(mouse)
terminate_thread(spam)
terminate_thread(sound)
return False
with Listener(on_press=on_press, on_release=on_release) as listener:
listener.join()