root@sparrow:~/writeups$ cat opensecret.md
// writeups
OpenSecret
26 Jan 2026
· 2 min read
A ticketing portal name-drops JWT as a red herring. The flag is hardcoded in the client-side JavaScript — readable in DevTools ▸ Sources without ever touching the token.
Challenge overview
| Field | Value |
|---|---|
| Platform | Hack The Box · Challenge |
| Category | Web |
| Difficulty | Very Easy |
| State | Retired |
Attack map
[Web] helpdesk portal
│
▼
[DevTools ▸ Sources] .js files
│
▼
[JS] hardcoded flag
│
▼
[FLAG]Un portal de tickets menciona JWT para despistar. La flag está hardcodeada en el JavaScript del cliente: se lee en DevTools ▸ Sources sin tocar el token.
Ficha del challenge
| Campo | Valor |
|---|---|
| Plataforma | Hack The Box · Challenge |
| Categoría | Web |
| Dificultad | Very Easy |
| Estado | Retirado |
Mapa del ataque
[Web] portal de helpdesk
│
▼
[DevTools ▸ Sources] archivos .js
│
▼
[JS] flag hardcodeada
│
▼
[FLAG]
1. Don't take the bait
The description talks JWT (alg:none, weak secret, role escalation). Before going down that road, the golden web rule is to check the client code first.
2. Open Sources in DevTools
The Sources tab lists every JS/HTML file the browser downloaded. That's where developers accidentally leave secrets.
# F12 ▸ Sources ▸ abrir index / *.js3. Find the hardcoded flag
const secret = "HTB{0p3n_s3cr3ts_ar3_n0t_s3cr3ts}";4. Flag
HTB{0p3n_s3cr3ts_ar3_n0t_s3cr3ts}The name OpenSecret was the hint: a secret in the frontend isn't a secret.
Chain summary
| Phase | Component | Vulnerability | Impact |
|---|---|---|---|
| Recon | Client-side JavaScript | Hardcoded secret | Flag exposed in the browser |
Lessons learned
- Everything that reaches the browser — JS, HTML, comments, localStorage — is accessible to the user.
- On a "Very Easy" web, check Sources, comments, LocalStorage/SessionStorage and Network before attacking the logic.
- Red herrings (JWT here) exist to waste your time — always start with the simple path.
1. No caer en la pista falsa
La descripción habla de JWT (alg:none, weak secret, escalada de rol). Antes de complicarse con eso, la regla de oro web es revisar el código cliente.
2. Abrir Sources en DevTools
La pestaña Sources lista todos los ficheros JS/HTML que el navegador ha descargado. Ahí es donde los desarrolladores dejan secretos por descuido.
# F12 ▸ Sources ▸ abrir index / *.js3. Encontrar la flag hardcodeada
const secret = "HTB{0p3n_s3cr3ts_ar3_n0t_s3cr3ts}";4. Flag
HTB{0p3n_s3cr3ts_ar3_n0t_s3cr3ts}El nombre OpenSecret era la pista: un secreto en el frontend no es secreto.
Resumen de la cadena
| Fase | Componente | Vulnerabilidad | Impacto |
|---|---|---|---|
| Recon | JavaScript de cliente | Secreto hardcodeado | Flag expuesta en el navegador |
Lecciones aprendidas
- Todo lo que llega al navegador —JS, HTML, comentarios, localStorage— es accesible al usuario.
- Ante un web "Very Easy", revisa Sources, comentarios, LocalStorage/SessionStorage y Network antes de atacar la lógica.
- Las pistas falsas (aquí, JWT) buscan hacerte perder tiempo: empieza siempre por lo simple.