
#!/usr/bin/env python3
import socket
import sys
def hex_bytes(x: str) -> bytes:
return bytes.fromhex(x)
def check_af_alg_aead():
print("=== AF_ALG AEAD reachability check ===")
# 1. Try to create an AF_ALG socket
try:
s = socket.socket(socket.AF_ALG, socket.SOCK_SEQPACKET, 0)
except OSError as e:
print(f"[OK] Could not create AF_ALG socket: {e}")
print(" AF_ALG is not usable from userspace on this system.")
return 0
print("[INFO] AF_ALG socket created.")
# 2. Try to bind to the AEAD interface used by the exploit
try:
s.bind(("aead", "authencesn(hmac(sha256),cbc(aes))"))
except OSError as e:
print(f"[OK] Could not bind to AEAD interface: {e}")
print(" The specific AEAD path used by the exploit is NOT available.")
return 0
print("[INFO] Bound to AEAD interface 'authencesn(hmac(sha256),cbc(aes))'.")
# 3. Try to set key and authsize (still non-destructive)
try:
s.setsockopt(socket.SOL_ALG, socket.ALG_SET_KEY,
hex_bytes('0800010000000010' + '0' * 64))
s.setsockopt(socket.SOL_ALG, socket.ALG_SET_AEAD_AUTHSIZE, None, 4)
except OSError as e:
print(f"[OK] Could not configure AEAD parameters: {e}")
print(" The full AEAD configuration path is not usable.")
return 0
print("[WARN] AF_ALG AEAD interface is reachable and configurable.")
print(" This strongly suggests the kernel path used by the exploit is available.")
print(" If your kernel version is known to be vulnerable, this system is likely exploitable.")
return 1
if __name__ == "__main__":
rc = check_af_alg_aead()
sys.exit(rc)


May 3, 2026, 11:10:43 PM | by Admin