🐰Rabbit Store (Linux)

Demonstrate your web application testing skills and the basics of Linux to escalate your privileges.

Enumeración de Red

Nmap

Scan general y específico de servicios
sudo nmap -sS --min-rate 5000 -p- --open -n -Pn 10.10.53.118 -oN puertos
nmap -sCV -p22,80,4369,25672 -oN nmap

Resultado nmap

PORT      STATE SERVICE VERSION
22/tcp    open  ssh     OpenSSH 8.9p1 Ubuntu 3ubuntu0.10 (Ubuntu Linux; protocol 2.0)
| ssh-hostkey: 
|   256 3f:da:55:0b:b3:a9:3b:09:5f:b1:db:53:5e:0b:ef:e2 (ECDSA)
|_  256 b7:d3:2e:a7:08:91:66:6b:30:d2:0c:f7:90:cf:9a:f4 (ED25519)
80/tcp    open  http    Apache httpd 2.4.52
|_http-title: Did not follow redirect to <http://cloudsite.thm/>
|_http-server-header: Apache/2.4.52 (Ubuntu)
4369/tcp  open  epmd    Erlang Port Mapper Daemon
| epmd-info: 
|   epmd_port: 4369
|   nodes: 
|_    rabbit: 25672
25672/tcp open  unknown
Service Info: Host: 127.0.1.1; OS: Linux; CPE: cpe:/o:linux:linux_kernel
  • cloudsite.thm → /etc/hosts

Erlang Port Mapper Daemon (epmd) used by default on RabbitMQ and CouchDB installations.

Enumeración de Servicio Web - p80

http://cloudsite.thm

  • nothing

  • Login/Register → storage.cloudsite.thm

Análisis de Registration Workflow

  • Registro de test account → cloudsite.thm/dashboard/inactive

Mensaje en dashboard/inactive

Sorry, this service is only for internal users working within the organization and our clients. If you are one of our clients, please ask the administrator to activate your subscription.

Análisis de Sesión

JWT Auth Bypass?

JWT Decode & Manipulation

  • "subscription": "inactive" → "subscription": "active"

(Error: “Invalid Token”)

Explotación: Mass Assignment - API

PoC

“User registered successfully”

  • Login Redirect → cloudsite.thm/dashboard/active

Acceso Nueva Función: File Upload

Análisis de File Upload

Funciones:

  • "Upload from Localhost"

  • "Upload from URL"

Upload from Localhost

Success: Image uploaded successfully!

File path: /api/uploads/<string>

  • Filtro de Nombre y de Extensión

Upload from URL

  • Success.

SSRF vulnerability?

Fuzzing API

Ffuf

Resultado Ffuf

  • /docs - 403 Forbidden

Internal LFI?

Explotación: SSRF a LFI

Upload from URL

Contenido de Archivo Descargado: "Access denied"

Explotación: SSRF a Internal Port Scanning

  • Ports:

    • 80

    • 3000 → Express? (Tecnología usada en la web)

    • 8000

    • 15672

Explotación: SSRF a LFI II

Upload from URL

Contenido /docs

Análisis de API Endpoint

  • GET /api/fetch_messeges_from_chatbot"GET method not allowed"

  • POST /api/fetch_messeges_from_chatbot500 ERROR

SSTi Test

SSTi Vulnerability

Ejemplo de Código Vulnerable

Explotando: SSTi a RCE

Intrusión en el Sistema

Shell: azrael

Enumeración Post-Intrusión

Servicio sospechoso

Recurso

If you can leak the Authentication cookie you will be able to execute code on the host. Usually, this cookie is located in ~/.erlang.cookie and is generated by erlang at the first start.

  • No cookie

  • /usr/lib/erlang → No cookie

Recurso

The global erlang cookie file is typically in /var/lib/rabbitmq/.erlang.cookie

  • Cookie leak!

  • exploit/multi/misc/erlang_cookie_rce

Escalada de Privilegios

Shell: rabbitmq

Escalada de Privilegios II: RabbitMQ - Schema Definition Export

RabbitMQ Manual

error: cookie file must be accessible by owner only

  • Administrator

The password for the root user is the SHA-256 hashed value of the RabbitMQ root user's password. Please don't attempt to crack SHA-256.

Creación de nuevo usuario administrador

Recurso

Exportación de admin hash

RabbitMQ Password Cracking

Recurso

  • Root hash

Compromiso del Sistema

Shell: Root

Última actualización