Skip to content

Instantly share code, notes, and snippets.

@Hackerl
Created March 10, 2021 08:01
Show Gist options
  • Save Hackerl/8c47815e6b921be0f3b44c6834f3a37a to your computer and use it in GitHub Desktop.
Save Hackerl/8c47815e6b921be0f3b44c6834f3a37a to your computer and use it in GitHub Desktop.
disguise the machine as ps4
#!/usr/bin/env python3
import socket
UDP_IP = "0.0.0.0"
UDP_PORT = 987
sock = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
sock.bind((UDP_IP, UDP_PORT))
while True:
data, addr = sock.recvfrom(1024)
print("received message from %s[%d]: %s" % (addr[0], addr[1], data.decode('utf8')))
response = "HTTP/1.1 200 OK\r\nhost-id:0123456789AB\r\nhost-type:PS4\r\nhost-name:MyPS4\r\nhost-request-port:%d\r\ndevice-discovery-protocol-version:00020020\r\nsystem-version:07020001\r\nrunning-app-name:Youtube\r\nrunning-app-titleid:CUSA01116\r\n\r\n" % addr[1]
sock.sendto(response.encode('utf8'), addr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment