MySQL Reference

April 21, 2026 ยท View on GitHub

Role In Scenario

MySQL backs the useragents database used for SIP header logging and injection exercises. It is intentionally exposed on the host and intentionally uses weak application credentials for training purposes.

  • default TCP port: 23306
  • network mode: host
  • Unix socket shared through the mysqlsock volume
  • root password generated into .env
  • application user: kamailio
  • schema creation and seeded fake customer data happen in build/kamailio/run.sh

Key Files

FilePurpose
build/mysql/validate-and-start.shstartup validation for required environment
build/mysql/Dockerfileimage customizations
compose/pbx1.ymlexposed port, credentials, and service wiring
build/mysqlclient/dump-uas.pyexports tracked user-agent data to JSON
build/dbcleaner/run.shperiodically truncates the useragents table
build/kamailio/run.shcreates the useragents schema and seeds fake customer data

Intentionally Vulnerable Behavior

  • host-exposed database port
  • weak hardcoded application password (kamailiorw)
  • useragents stores attacker-controlled SIP header content
  • customers contains fake sensitive data for extraction exercises
  • kamailio gets write access to useragents.useragents and read-only access to useragents.customers

SIP endpoint authentication is not stored here; it lives in Asterisk configuration.

Verification

./scripts/compose.sh --scenario pbx1 run --rm testing sqli --host 127.0.0.1 --extension 1000
./scripts/compose.sh --scenario pbx1 logs db