# quic_server_sim.py - Vulnerable QUIC server (simulated handshake)
import socket
def send_quic_initial(conn, addr, server_salt):
# Respond with a large "server hello" without validating source address
# In real QUIC, the server must echo the client's token; here we skip that.
payload = b'\x00' * 1200 # large response
conn.sendto(payload, addr)
server_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
server_socket.bind(('0.0.0.0', 4433))
print("QUIC server on :4433")
while True:
data, addr = server_socket.recvfrom(1024)
# Vulnerability: respond to any initial packet, no token verification
send_quic_initial(server_socket, addr, b'salt')
某个 QUIC 服务器实现未能在握手期间强制实施源地址验证,使攻击者能够使用伪造的源 IP 发送小型 Initial 数据包。服务器会回送更大的数据包,从而造成 DDoS 放大攻击。
python quic_server_sim.py