root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat eloquia.md
// writeups

Eloquia

13 Dec 2025 · 8 min read · root access
Eloquia — Hack The Box machine

Executive summary — Eloquia is an Insane Windows box with a sophisticated web+AD chain. A custom OAuth 2.0 IdP (qooqle.htb) without a state parameter allows an account-linking CSRF: a Flask server mints a fresh code and a <meta refresh> in an article redirects the admin bot to the callback, taking over its account. With the Django panel (SQL Explorer) we abuse SQLite's load_extension() to load a reverse-shell DLL (AppLocker bypass) as eloquia\web (user flag). Another SQLite DLL calls CryptUnprotectData (DPAPI) to pull Edge's master key and decrypt saved credentials offline → Olivia.KAT over WinRM. Finally, the Failure2Ban service (LocalSystem) has a binary writable by Olivia: replacing it runs as SYSTEM on restart. Path: OAuth CSRF → SQLite RCE → DPAPI → Olivia → Failure2Ban → SYSTEM.

PlatformHack The Box
Operating systemWindows Server 2019 (IIS 10.0, WinRM, AppLocker enabled)
DifficultyInsane
StatusRetired
Target IP<TARGET_IP>
StackDjango 3.2.18 · SQLite · AngularJS · custom OAuth 2.0
vhostseloquia.htb (Django CRM + SQL Explorer) · qooqle.htb (OAuth IdP)

Attack map

[1] Recon -- IIS(80) + WinRM(5985); vhosts eloquia.htb (Django+SQL Explorer) / qooqle.htb (OAuth IdP)
        |
[2] OAuth CSRF -- falta el parametro state -> account-linking CSRF
      Flask genera code fresco + <meta refresh> en articulo -> admin bot -> callback
      +-> takeover de admin -> panel Django + SQL Explorer
        |
[3] RCE -- SQL Explorer -> SQLite load_extension() carga DLL reverse shell (bypassea AppLocker)
      +-> eloquia\web  ->  user.txt
        |
[4] Lateral -- DLL SQLite con CryptUnprotectData -> DPAPI master key de Edge ->
      descifrar AES-256-GCM de Login Data -> Olivia.KAT
      +-> evil-winrm  ->  Olivia.KAT
        |
[5] Root -- servicio Failure2Ban (LocalSystem) con binario ESCRIBIBLE por Olivia ->
      sustituir binario + loop de overwrite -> reinicio -> SYSTEM  ->  root.txt

1. Reconnaissance

nmap -sC -sV -Pn <TARGET_IP>
echo "<TARGET_IP> eloquia.htb qooqle.htb" | sudo tee -a /etc/hosts
80/tcp   open  http     IIS 10.0 (Django CRM / Qooqle OAuth IdP)
5985/tcp open  http     WinRM

eloquia.htb turns out to be Django 3.2.18 (an article-driven CRM) with an SQL Explorer plugin installed — high-value surface, since it lets you run raw SQL from the panel. qooqle.htb is a custom OAuth 2.0 IdP acting as SSO between both sites.

SQLite itself has load_extension() enabled, already an RCE vector on its own if you can execute SQL. AngularJS ships a CSP of default-src 'self' that restricts loading external resources, but not navigation — a detail that becomes key in phase 2.

🔒 Clearance required

Root Access unlocks the content you can't see — everything else on the site is already open.

See Root Access plans

No account? Create one free then upgrade from your console.