server (version 0.0.1)
index
server.py

This package implements a basic asynchronous DNS client and server
with a feature to exfiltrate data through DNS.

 
Classes
       
asyncio.protocols.DatagramProtocol(asyncio.protocols.BaseProtocol)
DNSDatagramProtocol

 
class DNSDatagramProtocol(asyncio.protocols.DatagramProtocol)
    Asynchronous DNS UDP protocol handler.
 
 
Method resolution order:
DNSDatagramProtocol
asyncio.protocols.DatagramProtocol
asyncio.protocols.BaseProtocol
builtins.object

Methods defined here:
connection_made(self, transport) -> None
Called when a connection is made.
 
The argument is the transport representing the pipe connection.
To receive data, wait for data_received() calls.
When the connection is closed, connection_lost() is called.
datagram_received(self, data: bytes, addr: Tuple[str, int]) -> None
Called when some datagram is received.

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Methods inherited from asyncio.protocols.DatagramProtocol:
error_received(self, exc)
Called when a send or receive operation raises an OSError.
 
(Other than BlockingIOError or InterruptedError.)

Methods inherited from asyncio.protocols.BaseProtocol:
connection_lost(self, exc)
Called when the connection is lost or closed.
 
The argument is an exception object or None (the latter
meaning a regular EOF is received or the connection was
aborted or closed).
pause_writing(self)
Called when the transport's buffer goes over the high-water mark.
 
Pause and resume calls are paired -- pause_writing() is called
once when the buffer goes strictly over the high-water mark
(even if subsequent writes increases the buffer size even
more), and eventually resume_writing() is called once when the
buffer size reaches the low-water mark.
 
Note that if the buffer size equals the high-water mark,
pause_writing() is not called -- it must go strictly over.
Conversely, resume_writing() is called when the buffer size is
equal or lower than the low-water mark.  These end conditions
are important to ensure that things go as expected when either
mark is zero.
 
NOTE: This is the only Protocol callback that is not called
through EventLoop.call_soon() -- if it were, it would have no
effect when it's most needed (when the app keeps writing
without yielding until pause_writing() is called).
resume_writing(self)
Called when the transport's buffer drains below the low-water mark.
 
See pause_writing() for details.

 
Functions
       
exit(status=None, /)
Exit the interpreter by raising SystemExit(status).
 
If the status is omitted or None, it defaults to zero (i.e., success).
If the status is an integer, it will be used as the system exit status.
If it is another kind of object, it will be printed and the system
exit status will be one (i.e., failure).
get_event_loop()
Return an asyncio event loop.
 
When called from a coroutine or a callback (e.g. scheduled with
call_soon or similar API), this function will always return the
running event loop.
 
If there is no running event loop set, the function will return
the result of `get_event_loop_policy().get_event_loop()` call.
get_response(domain_name: str, transaction_id: int) -> str
This function returns the IP address from domain name and transaction ID.
 
You should replace this function with your own function.
handle_dns_request(request_data: bytes) -> Optional[bytes]
Handle an incoming DNS query and build a response.
 
Args:
    request_data: Raw DNS query packet bytes.
 
Returns:
    Raw DNS response packet bytes or None if invalid query.
async handle_tcp_connection(reader, writer) -> None
Handle an incoming TCP DNS connection.
 
Args:
    reader: StreamReader for TCP connection.
    writer: StreamWriter for TCP connection.
main() -> int
Synchronous entry point for the DNS async server.
 
Returns:
    Exit code.
pack(...)
pack(format, v1, v2, ...) -> bytes
 
Return a bytes object containing the values v1, v2, ... packed according
to the format string.  See help(struct) for more on format strings.
async start_async_dns_server(host: str = '0.0.0.0', port: int = 5353) -> None
Start the asynchronous DNS server handling both UDP and TCP.
 
Args:
    host: IP address to bind to.
    port: Port number to bind to.
unpack(format, buffer, /)
Return a tuple containing values unpacked according to the format string.
 
The buffer's size in bytes must be calcsize(format).
 
See help(struct) for more on format strings.

 
Data
        AF_INET = <AddressFamily.AF_INET: 2>
List = typing.List
Optional = typing.Optional
SOCK_DGRAM = <SocketKind.SOCK_DGRAM: 2>
Tuple = typing.Tuple
__author_email__ = 'mauricelambert434@gmail.com'
__copyright__ = '\nPyAsyncDNS Copyright (C) 2025 Maurice Lambert...ome to redistribute it\nunder certain conditions.\n'
__description__ = '\nThis package implements a basic asynchronous DN...r\nwith a feature to exfiltrate data through DNS.\n'
__license__ = 'GPL-3.0 License'
__maintainer__ = 'Maurice Lambert'
__maintainer_email__ = 'mauricelambert434@gmail.com'
__url__ = 'https://github.com/mauricelambert/PyAsyncDNS'
argv = [r'C:\Program Files\Python310\lib\pydoc.py', '-w', r'server.py']
copyright = '\nPyAsyncDNS Copyright (C) 2025 Maurice Lambert...ome to redistribute it\nunder certain conditions.\n'
executable = r'C:\Program Files\Python310\python.exe'
license = 'GPL-3.0 License'
stderr = <_io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>

 
Author
        Maurice Lambert