MCPcopy Create free account
hub / github.com/Cryptogenic/PS5-IPV6-Kernel-Exploit / DNSQuery

Class DNSQuery

fakedns.py:38–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36
37
38class DNSQuery:
39 def __init__(self, data):
40 self.data = data
41 self.domain = b''
42 tipo = (data[2] >> 3) & 15 # Opcode bits
43 if tipo == 0: # Standard query
44 ini = 12
45 lon = data[ini]
46 while lon != 0:
47 self.domain += data[ini + 1:ini + lon + 1] + b'.'
48 ini += lon + 1 # you can implement CNAME and PTR
49 lon = data[ini]
50 self.type = data[ini:][1:3]
51 else:
52 self.type = data[-4:-2]
53
54# Because python doesn't have native ENUM in 2.7:
55# https://en.wikipedia.org/wiki/List_of_DNS_record_types

Callers 1

respondFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected