📦 Craft CMS

What is it?

  • Concept: A PHP content-management system built on the Yii 2 framework. The admin “control panel” (CP) lives at /admin; content is edited by users with roles (admin / Content Editor / etc.). Editions: Solo (free, single admin) and Pro.
  • Impact: Authenticated users — even non-admin editors — have repeatedly reached RCE through Yii object-instantiation / Twig template bugs.

How it works

  1. Requests route through one front controller (index.php); most “paths” are virtual, so directory brute-forcing is low-yield — target /admin, /index.php?p=admin/actions/*, and custom modules instead.
  2. Config + secrets live in /var/www/<site>/.env (DB creds, CRAFT_SECURITY_KEY).
  3. The security key drives Craft/Yii’s reversible symmetric encryption (Craft::$app->getSecurity()->encryptByKey/decryptByKey). Anything the app stores “encrypted” (e.g. a mail-relay password in a settings table) is recoverable once you have the key + ciphertext.

Security Quirks & Niche Facts

  • Version fingerprinting: anonymous pages hide the exact version. /admin/login confirms it’s Craft; the precise version shows in the CP footer once logged in with any account (even a non-admin editor). Also leaks via composer.lock (craftcms/cms) if the webroot is misconfigured.

Notes

  • Check CRAFT_ALLOW_ADMIN_CHANGES / CRAFT_DEV_MODE in .env — “admin changes off” limits CP tampering but doesn’t stop code-level RCE.
  • Custom modules/plugins under modules/ are prime loot: they often hold hardcoded hosts, cron logic, and secret-handling code — read the .php directly.
  • DB is usually MySQL/MariaDB on 127.0.0.1:3306 (MySQL); creds sit in the same .env.
FileCreated
HTB Machine - LayoverOctober 04, 2026

References: