forked from Cryptogenic/PS5-IPV6-Kernel-Exploit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logserver.py
34 lines (28 loc) · 873 Bytes
/
logserver.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
import socket
import time
import struct
import locale
def server_program():
host = '0.0.0.0'
port = 5655
server_socket = socket.socket()
server_socket.bind((host, port))
server_socket.listen(1)
conn, address = server_socket.accept() # accept new connection
conn.settimeout(60) # 60 second timeout
print("Connection from: " + str(address))
while True:
try:
data = conn.recv(0x100)
if not data:
return
print("[LOG] " + data.decode('utf-8'))
except socket.timeout:
print("[LOG] [ERROR] Timeout reached for receiving data (1 min)\n")
return
except socket.error:
print("[LOG] [ERROR] Failed to read from socket\n")
return
conn.close()
if __name__ == '__main__':
server_program()