Version 1.2.1 → CVE-2023–27163 (Request Baskets SSRF — a basket can be configured to forward/proxy requests to an arbitrary internal URL, including internal-only services)
(root) NOPASSWD: /usr/bin/systemctl status trail.service
Exploiting systemctl status → pager escape
bash
sudo /usr/bin/systemctl status trail.service
Press enter or click to view image in full size
systemctl status pipes output through less (a pager) when run interactively
From inside the pager, typed:
!sh
This spawns a shell as root, since the pager inherits the privileges of the process that launched it (root, via sudo)
✅ Root shell obtained → root flag captured
Press enter or click to view image in full size
Press enter or click to view image in full size
5. Flags
Key Takeaways
A filtered/internal-only port spotted in the initial nmap scan (port 80 here) is a strong hint to look for an SSRF vector later — it often turns out to be an internal service reachable only through the vulnerable app itself.
CVE-2023–27163 (Request Baskets SSRF) is a clean way to proxy arbitrary internal requests through a basket’s forwarding config — useful pattern for similar “basket/webhook relay” style apps.
Maltrail v0.53 has a known unauthenticated RCE — worth a go whenever you fingerprint it, even from behind an SSRF pivot.
systemctl status (and other systemd commands) invoking a pager is a classic GTFOBins-style privesc: any sudo rule allowing a pager-backed command can usually be escaped with !sh or !bash from inside less.