Exploit databaseDownload repository ZIP
GH-8aa1e74d2f6309015cb1b7c8e4ddcd57
litobro/php2mon
Sources for CVE-2026-109618
412 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files10
litobro/php2monRevision 9e9843951663
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
php2mon/roles.py
Python · 845 bytes"""Create least-privilege DB roles and set their passwords."""
from __future__ import annotations
from pathlib import Path
ROLES_PATH = Path(__file__).with_name("roles.sql")
_ROLES = ("php2mon_sensor", "php2mon_collector", "php2mon_dashboard")
def _lit(s: str) -> str:
"""Quote a string as a SQL literal (ALTER ROLE cannot take bind parameters)."""
return "'" + s.replace("'", "''") + "'"
async def apply_roles(pool, *, sensor_pw: str, collector_pw: str, dashboard_pw: str) -> None:
async with pool.acquire() as conn:
await conn.execute(ROLES_PATH.read_text())
for role, pw in zip(_ROLES, (sensor_pw, collector_pw, dashboard_pw), strict=True):
assert role in _ROLES # role names are fixed literals, never caller input
await conn.execute(f"ALTER ROLE {role} WITH PASSWORD {_lit(pw)}")