the_open_door
coffee
ESEN
← Back to index

Apache James Remote Administration (TCP 4555)

ATT&CKT1078.001

Apache James is a mail server written in Java, and besides the mail ports (25, 110, 119) it raises a remote administration console on 4555. nmap labels it rsip, because that is the protocol assigned to the port in /etc/services, so -sCV does not identify it: what is listening there is something else, and it only shows up by opening a raw connection.

That is the port's general lesson: a service -sCV cannot identify is an invitation, not a wall. Connecting is enough for the service to introduce itself.


nc -nv <ip> 4555

The banner gives the product and version (JAMES Remote Administration Tool 2.3.2), and the console asks for a username and password. The factory pair is root:root, written into the distribution's config.xml, and on 2.3.2 it is still there unless somebody changed it by hand.

Inside, HELP lists what the console allows, and there is the piece:

Nothing needs breaking: rewrite any mailbox's password and read the mail over POP3 or IMAP, which are plaintext protocols you can speak by hand.


telnet <ip> 110

Once in the mailbox, user, pass, list and retr <n> are enough to read all of it. What you are after is credentials: an organisation's internal mail is, in practice, a store of passwords sent carelessly.

Version 2.3.2 also carries CVE-2015-7611, a code execution triggered by creating a user whose name is a path (../../../../etc/bash_completion.d), so that the mailbox file lands in a directory where the system executes what it finds. The password route is usually shorter and does not need to wait for somebody to log in.

Requirements. Port 4555 reachable and the administration credential, which is almost always the factory one. It matters not to confuse the scope: setpassword changes the mailbox password, not the operating system account's. What it hands over is the mail, and the mail hands over the rest.

How to detect it. Connections to 4555 from any address that is not the administration host: the port has no legitimate volume. In the James log, a setpassword that does not come from the management procedure is exactly the signal, and it even records which user was affected. And right after, a POP3 or IMAP login for that mailbox from a new IP within seconds.

Defence. Change the default credentials and, better, do not expose 4555 at all: the remote administration console belongs on the management network or on localhost. And upgrade, because 2.3.2 is from 2009.

It is the textbook case of chained credential reuse (the mail yields the SSH password) and it starts, like so many, in going from a version to an exploit.

Machines where it's used