The detection identifies potential use of the NinjaRMM tool by adversaries to establish remote management and command-and-control capabilities through file signature analysis. SOC teams should proactively hunt for this behavior in Azure Sentinel to detect and mitigate persistent threats leveraging legitimate RMM tools for C2 and persistence.
KQL Query
let Time_start = now(-5d);
let Time_end = now();
//
DeviceFileCertificateInfo
| where Timestamp between (Time_start..Time_end)
| where Signer has 'NinjaRMM'
| summarize FirstSeen=min(Timestamp), LastSeen=max(Timestamp),
Report=make_set(ReportId), Count=count() by DeviceId, DeviceName
id: 662b8f73-a1f2-48a9-966d-43ffa3555a29
name: Remote Management and Monitoring tool - NinjaRMM - File Signature
description: |
Remote Monitoring and Management (RMM) programs are IT to manage remote endpoints. Attackers have begun to abuse these programs to persist or provide C2 channels.
https://github.com/jischell-msft/RemoteManagementMonitoringTools
requiredDataConnectors:
- connectorId: MicrosoftThreatProtection
dataTypes:
- DeviceFileCertificateInfo
tactics: CommandAndControl
relevantTechniques: T1219
query: |
let Time_start = now(-5d);
let Time_end = now();
//
DeviceFileCertificateInfo
| where Timestamp between (Time_start..Time_end)
| where Signer has 'NinjaRMM'
| summarize FirstSeen=min(Timestamp), LastSeen=max(Timestamp),
Report=make_set(ReportId), Count=count() by DeviceId, DeviceName
Scenario: Scheduled system cleanup task using NinjaRMM
Description: A legitimate scheduled job runs to clean up temporary files or logs, which may trigger file signature checks.
Filter/Exclusion: process.parent_process_name == "ninjaRMM.exe" or process.name == "CleanupTask.exe"
Scenario: Admin uses NinjaRMM to deploy a legitimate script or configuration file
Description: An IT admin deploys a script (e.g., setup.bat or config.ps1) via NinjaRMM to configure endpoints.
Filter/Exclusion: process.name == "ninjaRMM.exe" and file.hash == "known_legit_script_hash"
Scenario: User initiates remote desktop session via NinjaRMM
Description: A user connects to a remote machine using NinjaRMM’s remote desktop feature, which may trigger file-based detection.
Filter/Exclusion: process.name == "ninjaRMM.exe" and process.command_line contains "rdp"
Scenario: NinjaRMM agent updates itself or communicates with the server
Description: The NinjaRMM agent performs a routine update or sync with the server, which may be flagged by file signature checks.
Filter/Exclusion: process.name == "ninjaRMM.exe" and process.command_line contains "update" or "sync"
Scenario: IT team uses NinjaRMM to deploy a patch or software update
Description: A patch or software update is deployed via NinjaRMM, which may trigger file-based detection due to the update file’s signature.
Filter/Exclusion: process.name == "ninjaRMM.exe" and file.name contains "patch" or "update"