repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
meshcentral.mdMarkdown123 lines6.6 KiBsource raw download

title: "MeshCentral" section: "Network Services" sectionSlug: "network-services-pentesting" sourcePath: "src/network-services-pentesting/pentesting-web/meshcentral.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/network-services-pentesting/pentesting-web/meshcentral.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

MeshCentral#

Overview#

MeshCentral is a self-hosted remote monitoring / device management platform that mixes an admin web UI with agent-facing WebSocket endpoints. During a pentest, treat it as both a web target and an RMM control plane: a single browser-side bug in the dashboard can become fleet-wide command execution because the product already exposes legitimate remote execution features.

Relevant endpoints from the public exploit chain:[1]

If you identify MeshCentral, review the generic XSS and WebSocket Attacks pages, then test how agent-controlled metadata reaches the UI and how the UI talks to privileged WebSocket APIs.

High-value attack surface#

1. Agent-submitted metadata rendered in the admin UI#

Do not limit testing to normal dashboard users. MeshCentral agents submit host metadata that is later rendered to administrators, so fields such as device name, OS description, volume labels, sensor names, or similar agent-fed attributes should be treated as stored XSS candidates.[2]

In the published 2026 chain, a rogue/compromised agent injected HTML/JS into osdesc inside the coreinfo message. When an admin opened the device details panel, the payload executed in the admin origin.[1][2]

Agent impersonation from a low-privileged host#

If you compromise a managed endpoint, check whether local users can read MeshCentral enrollment material. In the public advisory chain, low-privileged Windows users could read MeshAgent.msh and MeshAgent.db, which exposed enough data to impersonate the enrolled node:[3]

Typical extraction flow:[3]

uv run extract_agent_identity.py /path/to/MeshCentral/ -o client.json
uv run rogue_agent.py -s mesh.lab.local --identity client.json

This is a useful pattern beyond MeshCentral: whenever an RMM/MDM agent stores tenant identifiers, node identity, or client certificates/keys in locally readable files, a local foothold may be enough to re-register or impersonate the device remotely.

MeshCentral agent authentication flow#

When emulating a MeshAgent, the public PoC used the following handshake against /agent.ashx:[3]

  1. Connect and recover the TLS certificate hash.
  2. Send Cmd 1 with a nonce and cert hash.
  3. Send Cmd 4 to trust the server / skip its signature validation.
  4. Receive server Cmd 1 nonce.
  5. Send Cmd 2 with the agent certificate and RSA-SHA384 signature.
  6. Send Cmd 3 with agent info / metadata.
  7. Wait for Cmd 4 to confirm authentication.

Once authenticated, an attacker-controlled agent can update metadata fields that later reach the UI.

Stored XSS -> privileged WebSocket API abuse#

The important escalation is not the alert box. The key trick is that same-origin JavaScript executing in the MeshCentral admin console can open the privileged WebSocket API with the victim admin session automatically attached by the browser.[1]

Minimal browser primitive:[1]

const ws = new WebSocket(location.origin.replace(/^http/, 'ws') + '/control.ashx')

From there, the published chain waited for serverinfo, enumerated nodes, and then used the built-in remote execution action:[1]

ws.send(JSON.stringify({action:'nodes',responseid:'poc'}))
ws.send(JSON.stringify({
  action:'runcommands',
  nodeids:[nodeId],
  type:0,
  cmds:'whoami > C:\\pwned.txt',
  runAsUser:0,
  responseid:'rce-'+nodeId
}))

Important fields:[1]

This is the general RMM/MDM lesson: stored XSS in a management console is often equivalent to authenticated API abuse and remote code execution because the platform already exposes privileged operator actions.[1]

Pentest checklist#

Mitigation / detection notes#

References#