4369 - Pentesting Erlang Port Mapper Daemon (epmd)
Informazioni di base
Il Erlang Port Mapper Daemon (epmd) funge da coordinatore per le istanze distribuite di Erlang. È responsabile del mapping dei nomi simbolici dei nodi agli indirizzi delle macchine, garantendo essenzialmente che ogni nome del nodo sia associato a un indirizzo specifico. Questo ruolo di epmd è cruciale per l'interazione e la comunicazione senza soluzione di continuità tra diversi nodi Erlang in una rete.
Porta predefinita: 4369
Questo viene utilizzato di default nelle installazioni di RabbitMQ e CouchDB.
Enumerazione
Manuale
Automatico
The Erlang Port Mapper Daemon (EPMD) is a service that runs on the default port 4369 in Erlang-based systems. It is responsible for managing the distribution of Erlang nodes and facilitating communication between them.
During a penetration test, it is important to identify if EPMD is running on the target system. This can be done automatically using various tools and techniques.
One approach is to use the nmap
tool with the epmd
script. This script sends a request to the target system's port 4369 and checks if EPMD is running. The command to run this script is as follows:
Another option is to use the erl_scan
module in Erlang to check if EPMD is running on a specific IP address. This can be done by executing the following command:
Additionally, there are also tools like epmd_discover
and epmd_scan
that can be used to automatically discover and scan for EPMD services on a network.
By automating the process of identifying EPMD services, penetration testers can efficiently gather information about the target system and proceed with further analysis and exploitation.
Erlang Cookie RCE
Connessione Remota
Se riesci a ottenere la cookie di autenticazione, sarai in grado di eseguire codice sull'host. Di solito, questa cookie si trova in ~/.erlang.cookie
ed è generata da Erlang al primo avvio. Se non viene modificata o impostata manualmente, è una stringa casuale [A:Z] con una lunghezza di 20 caratteri.
Maggiori informazioni su https://insinuator.net/2017/10/erlang-distribution-rce-and-a-cookie-bruteforcer/ L'autore condivide anche un programma per forzare la cookie:
Connessione Locale
In questo caso sfrutteremo CouchDB per ottenere privilegi locali:
Esempio tratto da https://0xdf.gitlab.io/2018/09/15/htb-canape.html#couchdb-execution Puoi utilizzare la macchina Canape HTB per praticare come sfruttare questa vulnerabilità.
Metasploit
Shodan
port:4369 "alla porta"
Last updated