Two well-known defaults share it: YARN's NodeManager web UI and the Orthanc DICOM server's REST API.
IANA assigns 8042 to FireScope Agent, which is not what you will find. In a Hadoop cluster, yarn.nodemanager.webapp.address defaults to ${yarn.nodemanager.hostname}:8042, so every NodeManager serves its web UI here. In medical imaging, Orthanc's default configuration "creates a HTTP server for the REST API that listens on the port 8042", which is also its web interface. Context — a datacentre cluster versus a hospital or research network — tells you which one you found.
Do not expose
The YARN NodeManager UI exposes cluster topology, running containers and application logs with no authentication in a default install. Orthanc on 8042 fronts a store of patient DICOM images. Neither should be reachable from the internet.
$ curl -sI http://TARGET:8042/Seen this on your network? Beige Box scans your Wi-Fi and shows every open port on every device — and its Ports tool links straight back here.
Get Beige Box →also available as JSON · Markdown
Corrections or a missing port? Reply @rimrocksystems.