├── NetLock-RMM-Server ├── version.txt ├── Members_Portal │ ├── Config.cs │ ├── Members_Portal.cs │ ├── Obfuscation.cs │ ├── Members_Portal_License_Service.cs │ ├── Handler.cs │ └── Package_Provider.cs ├── README.md ├── Logging │ └── Handler.cs ├── appsettings.Development.json ├── Configuration │ ├── SignalR.cs │ ├── Server.cs │ ├── Roles.cs │ └── MySQL.cs ├── .config │ └── dotnet-tools.json ├── Application_Settings.cs ├── Helper │ ├── Encryption.cs │ ├── Base64.cs │ ├── Random.cs │ ├── System_Information │ │ └── Server_Information_Service.cs │ └── Notifications │ │ └── Telegram.cs ├── SignalR │ └── ConnectionManager.cs ├── HWID_System │ ├── gen.cs │ ├── disk.cs │ └── winid.cs ├── Properties │ ├── PublishProfiles │ │ └── FolderProfile.pubxml │ └── launchSettings.json ├── NetLock RMM Server.csproj ├── NetLock RMM Server.sln ├── Files │ └── Compiler │ │ └── Assembly_Manipulation.cs ├── MySQL │ └── Config.cs └── appsettings.json ├── FUNDING.yml ├── NetLock-RMM-Web-Console ├── Configuration │ ├── SSO.cs │ ├── Members_Portal.cs │ ├── File Server.cs │ ├── Remote Server.cs │ ├── MySQL.cs │ └── Web_Console.cs ├── Components │ ├── Pages │ │ ├── Redirect.razor │ │ ├── Collections │ │ │ └── Scripts │ │ │ │ ├── Manage_Scripts.razor.cs │ │ │ │ └── Community Scripts │ │ │ │ ├── Publish_Dialog.razor │ │ │ │ └── Report_Dialog.razor │ │ ├── Devices │ │ │ └── Dialogs │ │ │ │ ├── Edit_Label.razor │ │ │ │ ├── Remote_File_Browser │ │ │ │ ├── Create_Directory_Dialog.razor │ │ │ │ ├── Rename_File_Dialog.razor │ │ │ │ ├── Move_Directory_Dialog.razor │ │ │ │ ├── Rename_Directory_Dialog.razor │ │ │ │ ├── Result_Dialog.razor │ │ │ │ └── Move_File_Dialog.razor │ │ │ │ ├── Bulk_Remote_Shell │ │ │ │ └── Bulk_Remote_Shell_Result_Dialog.razor │ │ │ │ └── Remote_Control │ │ │ │ └── Code_Signing_Warning_Dialog.razor │ │ ├── Error.razor │ │ ├── Tenants │ │ │ └── Export_Data_Dialog.razor │ │ └── Policies │ │ │ └── Dialogs │ │ │ └── Export_Data_Dialog.razor │ ├── _Imports.razor │ ├── Routes.razor │ ├── Shared │ │ └── Export_Data_Dialog.razor │ └── App.razor ├── Classes │ ├── Authentication │ │ ├── SsoConfig.cs │ │ ├── UserSession.cs │ │ ├── AuthProviderRegistrar.cs │ │ └── TokenService.cs │ ├── Theme │ │ └── ThemePalette.cs │ ├── Members_Portal │ │ ├── Config.cs │ │ └── Handler.cs │ ├── Helper │ │ ├── IO.cs │ │ ├── Encryption.cs │ │ ├── BCrypt.cs │ │ ├── Base64.cs │ │ └── Notifications │ │ │ └── Telegram.cs │ ├── File Server │ │ ├── Config.cs │ │ └── Handler.cs │ ├── Remote Server │ │ └── Config.cs │ ├── MySQL │ │ └── Config.cs │ └── Setup │ │ ├── DNS.cs │ │ └── Directories.cs ├── wwwroot │ ├── favicon.ico │ ├── fonts │ │ ├── Poppins-Bold.ttf │ │ ├── Poppins-Light.ttf │ │ ├── Roboto-Bold.ttf │ │ ├── Roboto-Light.ttf │ │ ├── Roboto-Medium.ttf │ │ ├── Poppins-Medium.ttf │ │ ├── Poppins-Regular.ttf │ │ ├── Roboto-Regular.ttf │ │ ├── Poppins-SemiBold.ttf │ │ ├── roboto.css │ │ └── poppins.css │ ├── media │ │ └── images │ │ │ ├── background.jpg │ │ │ ├── NetLock-RMM- Wallpaper.jpg │ │ │ └── NetLock-RMM-Logo-Transparent.png │ └── js │ │ └── copyToClipboard.js ├── appsettings.Development.json ├── .config │ └── dotnet-tools.json ├── Application_Settings.cs ├── Resources │ └── Components │ │ └── Pages │ │ └── Settings.Notifications │ │ └── Ntfy_sh │ │ └── Add_Ntfy_sh_Notification_Dialog.resx ├── Properties │ ├── PublishProfiles │ │ └── FolderProfile.pubxml │ └── launchSettings.json ├── NetLock RMM Web Console.sln ├── appsettings.json ├── Application_Paths.cs └── NetLock RMM Web Console.csproj ├── NetLock RMM Tray Icon ├── Assets │ └── trayicon.ico ├── Application_Settings.cs ├── Global │ ├── Helper │ │ └── Encryption.cs │ └── Chat │ │ └── ChatMessage.cs ├── App.axaml ├── app.manifest ├── NetLock RMM Tray Icon.sln └── NetLock RMM Tray Icon.csproj ├── Directory.Build.props ├── NetLock RMM Agent Comm ├── appsettings.json ├── appsettings.Development.json ├── Properties │ ├── launchSettings.json │ └── PublishProfiles │ │ ├── osx-x64.pubxml │ │ ├── linux-x64.pubxml │ │ ├── osx-arm64.pubxml │ │ ├── linux-arm64.pubxml │ │ ├── win-x64.pubxml │ │ └── win-arm64.pubxml ├── Global │ ├── Helper │ │ ├── Encryption.cs │ │ ├── IO.cs │ │ ├── Process_User.cs │ │ ├── Network.cs │ │ └── Random.cs │ ├── Jobs │ │ └── Handler.cs │ ├── Sensors │ │ └── Handler.cs │ └── Configuration │ │ └── Agent.cs ├── Application_Settings.cs ├── Windows │ └── Helper │ │ ├── WMI.cs │ │ └── Service.cs ├── HWID_System │ ├── disk.cs │ └── winid.cs ├── NetLock RMM Agent Comm.sln └── NetLock RMM Agent Comm.csproj ├── NetLock RMM Agent Health ├── appsettings.json ├── appsettings.Development.json ├── Application_Settings.cs ├── Properties │ ├── launchSettings.json │ └── PublishProfiles │ │ ├── osx-x64.pubxml │ │ ├── linux-x64.pubxml │ │ ├── osx-arm64.pubxml │ │ ├── linux-arm64.pubxml │ │ ├── win-x64.pubxml │ │ └── win-arm64.pubxml ├── Global │ ├── Helper │ │ ├── Encryption.cs │ │ └── IO.cs │ └── Configuration │ │ └── Agent.cs ├── NetLock RMM Agent Health.csproj ├── Initialization │ └── Health.cs ├── NetLock RMM Agent Health.sln └── Linux │ └── Helper │ └── Linux.cs ├── NetLock RMM Agent Remote ├── appsettings.json ├── appsettings.Development.json ├── Application_Settings.cs ├── Global │ ├── Helper │ │ ├── Encryption.cs │ │ ├── Randomizer.cs │ │ └── Base64.cs │ └── Configuration │ │ ├── Tray_Icon.cs │ │ └── Agent.cs ├── Properties │ ├── launchSettings.json │ └── PublishProfiles │ │ ├── osx-x64.pubxml │ │ ├── linux-x64.pubxml │ │ ├── osx-arm64.pubxml │ │ ├── linux-arm64.pubxml │ │ ├── win-x64.pubxml │ │ └── win-arm64.pubxml ├── Windows │ └── Helper │ │ ├── WMI.cs │ │ └── ScreenControl │ │ ├── Shlwapi.cs │ │ └── Sas_Diagnostics.cs ├── Initialization │ └── Health.cs ├── HWID_System │ ├── disk.cs │ └── winid.cs ├── NetLock RMM Agent Remote.sln └── NetLock RMM Agent Remote.csproj ├── NetLock-RMM-User-Process ├── README.md ├── Windows │ └── Helper │ │ ├── Dpi.cs │ │ └── Sas_Diagnostics.cs ├── Properties │ └── PublishProfiles │ │ ├── osx-x64.pubxml │ │ ├── linux-x64.pubxml │ │ ├── osx-arm64.pubxml │ │ ├── win-x64.pubxml │ │ ├── win-arm64.pubxml │ │ └── linux-arm64.pubxml ├── NetLock RMM User Process.csproj ├── NetLock RMM User Process.sln ├── Application_Paths.cs └── MacOS │ └── ScreenCaptureMacOS.cs ├── SECURITY.md ├── NetLock RMM Agent Installer ├── NetLock RMM Agent Installer.csproj ├── Properties │ └── PublishProfiles │ │ ├── osx-x64.pubxml │ │ ├── linux-x64.pubxml │ │ ├── osx-arm64.pubxml │ │ ├── linux-arm64.pubxml │ │ ├── win-x64.pubxml │ │ └── win-arm64.pubxml ├── NetLock RMM Agent Installer.sln ├── Linux │ └── Helper │ │ └── Linux.cs └── Helper │ ├── IO.cs │ └── Service.cs ├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── CHANGELOG.md /NetLock-RMM-Server/version.txt: -------------------------------------------------------------------------------- 1 | 2.0.0.0 -------------------------------------------------------------------------------- /FUNDING.yml: -------------------------------------------------------------------------------- 1 | # .github/FUNDING.yml 2 | 3 | # GitHub Sponsors 4 | github: [0x101-Cyber-Security] -------------------------------------------------------------------------------- /NetLock-RMM-Server/Members_Portal/Config.cs: -------------------------------------------------------------------------------- 1 | //OSSCH_START 22a44883-9c95-46d3-91bd-f5070ee307fc //OSSCH_END -------------------------------------------------------------------------------- /NetLock-RMM-Server/README.md: -------------------------------------------------------------------------------- 1 | # NetLock-RMM-Server 2 | The backend with which the agents communicate. 3 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Configuration/SSO.cs: -------------------------------------------------------------------------------- 1 | //OSSCH_START 1124f2ef-7c20-44e3-a0d5-fe052e5897e5 //OSSCH_END -------------------------------------------------------------------------------- /NetLock-RMM-Server/Members_Portal/Members_Portal.cs: -------------------------------------------------------------------------------- 1 | //OSSCH_START 376dd1ae-bc35-4ad5-9305-9e590bdc9a06 //OSSCH_END -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Redirect.razor: -------------------------------------------------------------------------------- 1 | @page "/redirect" 2 | 3 | @code { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Authentication/SsoConfig.cs: -------------------------------------------------------------------------------- 1 | //OSSCH_START b774a725-6c25-41e3-b077-2069b778bdc4 //OSSCH_END -------------------------------------------------------------------------------- /NetLock-RMM-Server/Logging/Handler.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Server/Logging/Handler.cs -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Theme/ThemePalette.cs: -------------------------------------------------------------------------------- 1 | using MudBlazor; 2 | 3 | //OSSCH_START d092763c-5927-48ec-a464-94795fde002f //OSSCH_END -------------------------------------------------------------------------------- /NetLock RMM Tray Icon/Assets/trayicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock RMM Tray Icon/Assets/trayicon.ico -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/favicon.ico -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/fonts/Poppins-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/fonts/Poppins-Bold.ttf -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/fonts/Poppins-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/fonts/Poppins-Light.ttf -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/fonts/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/fonts/Roboto-Bold.ttf -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/fonts/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/fonts/Roboto-Light.ttf -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/fonts/Poppins-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/fonts/Poppins-Medium.ttf -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/fonts/Poppins-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/fonts/Poppins-Regular.ttf -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/fonts/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/fonts/Roboto-Regular.ttf -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | enable 4 | 11.1.0 5 | 6 | 7 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/fonts/Poppins-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/fonts/Poppins-SemiBold.ttf -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/media/images/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/media/images/background.jpg -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Configuration/Members_Portal.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Web_Console.Configuration 2 | { 3 | //OSSCH_START 1b426c6b-2f47-4218-8aae-8e64ab99ed86 //OSSCH_END 4 | } 5 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.Hosting.Lifetime": "Information" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Members_Portal/Config.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Web_Console.Classes.Members_Portal 2 | { 3 | //OSSCH_START 6c4d6596-46a2-453e-8c56-49087159e8de //OSSCH_END 4 | } 5 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.Hosting.Lifetime": "Information" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.Hosting.Lifetime": "Information" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.AspNetCore": "Warning" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/media/images/NetLock-RMM- Wallpaper.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/media/images/NetLock-RMM- Wallpaper.jpg -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.Hosting.Lifetime": "Information" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.Hosting.Lifetime": "Information" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/appsettings.Development.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Information", 5 | "Microsoft.Hosting.Lifetime": "Information" 6 | } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NetLock RMM Tray Icon/Application_Settings.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Tray_Icon; 2 | 3 | public class Application_Settings 4 | { 5 | public static string NetLock_Local_Encryption_Key = "()TZ%/N)NZTG$/()4i59du4)"; 6 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/media/images/NetLock-RMM-Logo-Transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/wwwroot/media/images/NetLock-RMM-Logo-Transparent.png -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Application_Settings.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Agent_Remote; 2 | 3 | public class Application_Settings 4 | { 5 | public static string NetLock_Local_Encryption_Key = "()TZ%/N)NZTG$/()4i59du4)"; 6 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Collections/Scripts/Manage_Scripts.razor.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0x101-Cyber-Security/NetLock-RMM/HEAD/NetLock-RMM-Web-Console/Components/Pages/Collections/Scripts/Manage_Scripts.razor.cs -------------------------------------------------------------------------------- /NetLock-RMM-Server/Members_Portal/Obfuscation.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.ComponentModel; 3 | using System.Security.Cryptography; 4 | using System.Text.Json; 5 | using Helper; 6 | 7 | //OSSCH_START c8fc0e9f-125b-48e5-82fd-b4abfc586383 //OSSCH_END -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Members_Portal/Handler.cs: -------------------------------------------------------------------------------- 1 | using MudBlazor; 2 | using MySqlConnector; 3 | using System.Globalization; 4 | using System.Text.Json; 5 | 6 | //OSSCH_START 936d3ee0-c56d-49e6-b25c-21ed41cb4116 //OSSCH_END 7 | 8 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "8.0.10", 7 | "commands": [ 8 | "dotnet-ef" 9 | ] 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /NetLock-RMM-Server/Configuration/SignalR.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Server.Configuration 2 | { 3 | public class SignalR 4 | { 5 | public static int MaxConnectionAttempts = 5; 6 | public static int ConnectionAttemptDelayMs = 5000; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Authentication/UserSession.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Web_Console.Classes.Authentication 2 | { 3 | public class UserSession 4 | { 5 | public string UserName { get; set; } 6 | public string Role { get; set; } 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Helper/IO.cs: -------------------------------------------------------------------------------- 1 | using System.Security.Cryptography; 2 | 3 | namespace NetLock_RMM_Web_Console.Classes.Helper 4 | { 5 | public class IO 6 | { 7 | //OSSCH_START 9f50a6a7-ccc6-4959-b238-9843644f5c98 //OSSCH_END 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/.config/dotnet-tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 1, 3 | "isRoot": true, 4 | "tools": { 5 | "dotnet-ef": { 6 | "version": "8.0.7", 7 | "commands": [ 8 | "dotnet-ef" 9 | ], 10 | "rollForward": false 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /NetLock-RMM-Server/Members_Portal/Members_Portal_License_Service.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Hosting; 2 | using NetLock_RMM_Server.Configuration; 3 | using System; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | //OSSCH_START 9defa970-07f9-4030-a3ef-d46f5c147768 //OSSCH_END -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Configuration/File Server.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Web_Console.Configuration 2 | { 3 | public class File_Server 4 | { 5 | public static string Connection_String = String.Empty; 6 | public static string Hostname { get; set; } = String.Empty; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Configuration/Remote Server.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Web_Console.Configuration 2 | { 3 | public class Remote_Server 4 | { 5 | public static string Connection_String = String.Empty; 6 | public static string Hostname { get; set; } = String.Empty; 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/js/copyToClipboard.js: -------------------------------------------------------------------------------- 1 | // clipboard.js 2 | function copyToClipboard(text) { 3 | navigator.clipboard.writeText(text).then(function () { 4 | console.log('Text copied to clipboard'); 5 | }).catch(function (error) { 6 | console.error('Failed to copy text: ', error); 7 | }); 8 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/File Server/Config.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Web_Console.Classes.File_Server 2 | { 3 | public class Config 4 | { 5 | public string Server { get; set; } = String.Empty; 6 | public int Port { get; set; } = 80; 7 | public bool UseSSL { get; set; } = false; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Application_Settings.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Agent_Health; 2 | 3 | internal class Application_Settings 4 | { 5 | // Encryption key for local configuration files 6 | // This key is used to encrypt sensitive configuration data at rest 7 | public static string NetLock_Local_Encryption_Key = "()TZ%/N)NZTG$/()4i59du4)"; 8 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Remote Server/Config.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Web_Console.Classes.Remote_Server 2 | { 3 | public class Config 4 | { 5 | public string Server { get; set; } = String.Empty; 6 | public int Port { get; set; } = 80; 7 | public bool UseSSL { get; set; } = false; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Members_Portal/Handler.cs: -------------------------------------------------------------------------------- 1 | using MySqlConnector; 2 | using System.Net.Http.Headers; 3 | using System.Text.Json; 4 | using System.Net; 5 | using System.Net.Http; 6 | using System.Text; 7 | using System.Globalization; 8 | using System.IO.Compression; 9 | using System; 10 | 11 | //OSSCH_START 4681510d-ccfa-418b-b840-1ea28ca2501f //OSSCH_END -------------------------------------------------------------------------------- /NetLock RMM Tray Icon/Global/Helper/Encryption.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using Microsoft.Win32; 8 | using System.Security.Cryptography; 9 | using Global.Helper; 10 | //OSSCH_START b16507d0-684f-4b93-a5b1-80384683a59e //OSSCH_END -------------------------------------------------------------------------------- /NetLock-RMM-Server/Application_Settings.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Server 2 | { 3 | public class Application_Settings 4 | { 5 | public static string server_version = "2.5.3.4b"; 6 | public static string agent_version = "2.5.3.4"; 7 | 8 | //OSSCH_START 0374affb-7f9c-4f37-98fc-6603aa835d68 //OSSCH_END 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Global/Helper/Encryption.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using Microsoft.Win32; 8 | using System.Security.Cryptography; 9 | using Global.Helper; 10 | 11 | //OSSCH_START dcb45f97-ac20-44b1-b91b-3d4dc1a88d87 //OSSCH_END -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/README.md: -------------------------------------------------------------------------------- 1 | # NetLock-RMM-User-Process 2 | This componment handles communication between user sessions & the NetLock RMM agent services 3 | 4 | 5 | # Hide window from user 6 | Run as windows application to hide window from user. Console application for output. 7 | 8 | # UAC bypass 9 | NetLock_RMM_User_Process_UAC.exe 10 | NetLock_RMM_User_Process_UAC.dll -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "NetLock_RMM_Agent_Comm": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "environmentVariables": { 8 | "DOTNET_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Helper/Encryption.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using Microsoft.Win32; 8 | using System.Security.Cryptography; 9 | 10 | namespace Encryption 11 | { 12 | //OSSCH_START 92e0c84a-e4f7-4f87-8062-72ad5cec785c //OSSCH_END 13 | } 14 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "profiles": { 4 | "NetLock_RMM_Agent_Health": { 5 | "commandName": "Project", 6 | "dotnetRunMessages": true, 7 | "environmentVariables": { 8 | "DOTNET_ENVIRONMENT": "Development" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Configuration/Server.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Server.Configuration 2 | { 3 | public class Server 4 | { 5 | public static string agent_version = String.Empty; 6 | public static bool isDocker = false; 7 | public static bool loggingEnabled = true; 8 | public static DateTime serverStartTime = DateTime.Now; 9 | 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Helper/Encryption.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using Microsoft.Win32; 8 | using System.Security.Cryptography; 9 | 10 | namespace Encryption 11 | { 12 | //OSSCH_START 550c93c7-3ffb-49e4-b5d4-d742eb0ca92c //OSSCH_END 13 | } 14 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Global/Helper/Encryption.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using Microsoft.Win32; 8 | using System.Security.Cryptography; 9 | using Global.Helper; 10 | 11 | namespace Global.Encryption 12 | { 13 | //OSSCH_START dcafec42-c9c4-4767-bfd6-6dc8b1f7b00d //OSSCH_END 14 | } 15 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Global/Helper/Encryption.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using Microsoft.Win32; 8 | using System.Security.Cryptography; 9 | using Global.Helper; 10 | 11 | namespace Global.Encryption 12 | { 13 | //OSSCH_START df7a7e4e-d0a6-4d73-87b8-c2ecb0b99f67 //OSSCH_END 14 | } 15 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Members_Portal/Package_Provider.cs: -------------------------------------------------------------------------------- 1 | using NetLock_RMM_Server.Configuration; 2 | using System.Net; 3 | using System.IO.Compression; 4 | using Helper; 5 | using System.Runtime.CompilerServices; 6 | using System.Text.Json; 7 | using System.Net.Http.Headers; 8 | using System.IO; 9 | using System; 10 | using System.Net.Http; 11 | using System.Globalization; 12 | 13 | //OSSCH_START 216c22e4-cc4f-4a8c-88d6-57c5ffc5fa89 //OSSCH_END -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Authentication/AuthProviderRegistrar.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Configuration; 2 | using Microsoft.Extensions.DependencyInjection; 3 | using Microsoft.AspNetCore.Authentication.OpenIdConnect; 4 | using Microsoft.AspNetCore.Authentication.Cookies; 5 | using Microsoft.Identity.Web; 6 | using Microsoft.AspNetCore.Authentication; 7 | using System; 8 | // Used for SSO 9 | //OSSCH_START 50921767-f1cc-4aa1-aead-20af8e2cdebb //OSSCH_END -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Reporting a Vulnerability 2 | We value security for the project very highly. We encourage all users to report any vulnerabilities they discover to us. If you find a security vulnerability in the project, please report it responsibly by sending an email to nico.mak@0x101-cyber-security.de 3 | 4 | Reporting a critical vulnerability will be recognized with a certificate for your résumé and rewarded with a lifetime membership (limited to 50 devices). 5 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Configuration/Roles.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Server.Configuration 2 | { 3 | public class Roles 4 | { 5 | public static bool Comm = false; 6 | public static bool Update = false; 7 | public static bool Trust = false; 8 | public static bool Remote = false; 9 | public static bool Notification = false; 10 | public static bool File = false; 11 | public static bool LLM = false; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /NetLock RMM Tray Icon/App.axaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /NetLock RMM Tray Icon/Global/Chat/ChatMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace NetLock_RMM_Tray_Icon 4 | { 5 | public class ChatMessage 6 | { 7 | public string Text { get; set; } = string.Empty; 8 | public bool IsOwnMessage { get; set; } 9 | public DateTime Timestamp { get; set; } 10 | 11 | public ChatMessage(string text, bool isOwnMessage) 12 | { 13 | Text = text; 14 | IsOwnMessage = isOwnMessage; 15 | Timestamp = DateTime.Now; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "NetLock_RMM_Agent_Remote": { 4 | "commandName": "Project", 5 | "environmentVariables": { 6 | "DOTNET_ENVIRONMENT": "Development" 7 | }, 8 | "dotnetRunMessages": true 9 | }, 10 | "WSL": { 11 | "commandName": "WSL2", 12 | "environmentVariables": { 13 | "DOTNET_ENVIRONMENT": "Development" 14 | }, 15 | "distributionName": "" 16 | } 17 | }, 18 | "$schema": "http://json.schemastore.org/launchsettings.json" 19 | } -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Global/Jobs/Handler.cs: -------------------------------------------------------------------------------- 1 | using NetLock_RMM_Agent_Comm; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Timers; 8 | 9 | namespace Global.Jobs 10 | { 11 | internal class Handler 12 | { 13 | public static async void Scheduler_Tick(object source, ElapsedEventArgs e) 14 | { 15 | if (!String.IsNullOrEmpty(Device_Worker.policy_jobs_json)) 16 | Time_Scheduler.Check_Execution(); 17 | } 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Global/Sensors/Handler.cs: -------------------------------------------------------------------------------- 1 | using NetLock_RMM_Agent_Comm; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using System.Timers; 8 | 9 | namespace Global.Sensors 10 | { 11 | internal class Handler 12 | { 13 | public static async void Scheduler_Tick(object source, ElapsedEventArgs e) 14 | { 15 | if (!String.IsNullOrEmpty(Device_Worker.policy_sensors_json)) 16 | Time_Scheduler.Check_Execution(); 17 | } 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/MySQL/Config.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Web_Console.Classes.MySQL 2 | { 3 | public class Config 4 | { 5 | public string Server { get; set; } = String.Empty; 6 | public int Port { get; set; } = 3306; 7 | public string Database { get; set; } = String.Empty; 8 | public string User { get; set; } = String.Empty; 9 | public string Password { get; set; } = String.Empty; 10 | public string SslMode { get; set; } = String.Empty; 11 | public string AdditionalConnectionParameters { get; set; } = String.Empty; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/SignalR/ConnectionManager.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Concurrent; 2 | using System; 3 | 4 | namespace NetLock_RMM_Server.SignalR 5 | { 6 | public class ConnectionManager 7 | { 8 | private static readonly Lazy _instance = new Lazy(() => new ConnectionManager()); 9 | 10 | public static ConnectionManager Instance => _instance.Value; 11 | 12 | private readonly ConcurrentDictionary _clientConnections = new ConcurrentDictionary(); 13 | 14 | public ConcurrentDictionary ClientConnections => _clientConnections; 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/Windows/Helper/Dpi.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace NetLock_RMM_User_Process.Windows.Helper 9 | { 10 | internal class Dpi 11 | { 12 | [DllImport("Shcore.dll")] 13 | public static extern int SetProcessDpiAwareness(ProcessDpiAwareness value); 14 | 15 | public enum ProcessDpiAwareness 16 | { 17 | Process_DPI_Unaware = 0, 18 | Process_System_DPI_Aware = 1, 19 | Process_Per_Monitor_DPI_Aware = 2 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /NetLock RMM Agent Installer/NetLock RMM Agent Installer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | net8.0 6 | NetLock_RMM_Agent_Installer 7 | enable 8 | enable 9 | NetLock_RMM_Agent_Installer 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Configuration/MySQL.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Server.Configuration 2 | { 3 | public class MySQL 4 | { 5 | public static string Connection_String = String.Empty; 6 | public static string Server { get; set; } = String.Empty; 7 | public static int Port { get; set; } = 3306; 8 | public static string Database { get; set; } = String.Empty; 9 | public static string User { get; set; } = String.Empty; 10 | public static string Password { get; set; } = String.Empty; 11 | public static string SslMode { get; set; } = String.Empty; 12 | public static string AdditionalConnectionParameters { get; set; } = String.Empty; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Configuration/MySQL.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Web_Console.Configuration 2 | { 3 | public class MySQL 4 | { 5 | public static string Connection_String = String.Empty; 6 | public static string Server { get; set; } = String.Empty; 7 | public static int Port { get; set; } = 3306; 8 | public static string Database { get; set; } = String.Empty; 9 | public static string User { get; set; } = String.Empty; 10 | public static string Password { get; set; } = String.Empty; 11 | public static string SslMode { get; set; } = String.Empty; 12 | public static string AdditionalConnectionParameters { get; set; } = String.Empty; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Application_Settings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace NetLock_RMM_Agent_Comm 8 | { 9 | internal class Application_Settings 10 | { 11 | public static string version = "2.5.3.4"; 12 | public static string NetLock_Data_Database_String = @"Data Source=" + Application_Paths.program_data_netlock_policy_database + ";"; 13 | public static string NetLock_Events_Database_String = @"Data Source=" + Application_Paths.program_data_netlock_events_database + ";"; 14 | public static string NetLock_Local_Encryption_Key = "()TZ%/N)NZTG$/()4i59du4)"; 15 | } 16 | } -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/Properties/PublishProfiles/osx-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\osx-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | osx-x64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/Properties/PublishProfiles/linux-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\linux-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | linux-x64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/Properties/PublishProfiles/osx-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\osx-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | osx-arm64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Properties/PublishProfiles/osx-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\osx-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | osx-x64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Properties/PublishProfiles/osx-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\osx-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | osx-x64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Installer/Properties/PublishProfiles/osx-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\osx-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | osx-x64 14 | true 15 | true 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Properties/PublishProfiles/osx-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\osx-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | osx-x64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Properties/PublishProfiles/linux-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\linux-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | linux-x64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Properties/PublishProfiles/osx-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\osx-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | osx-arm64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Properties/PublishProfiles/linux-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\linux-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | linux-x64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Properties/PublishProfiles/osx-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\osx-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | osx-arm64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Properties/PublishProfiles/linux-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\linux-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | linux-x64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Properties/PublishProfiles/osx-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\osx-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | osx-arm64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Properties/PublishProfiles/linux-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\linux-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | linux-arm64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Properties/PublishProfiles/linux-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\linux-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | linux-arm64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Installer/Properties/PublishProfiles/linux-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\linux-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | linux-x64 14 | true 15 | true 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Installer/Properties/PublishProfiles/osx-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\osx-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | osx-arm64 14 | true 15 | true 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Properties/PublishProfiles/linux-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\linux-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | linux-arm64 14 | true 15 | false 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock RMM Agent Installer/Properties/PublishProfiles/linux-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\linux-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | linux-arm64 14 | true 15 | true 16 | false 17 | 18 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Application_Settings.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Web_Console 2 | { 3 | public class Application_Settings 4 | { 5 | public static string db_version = "2.5.3.4"; 6 | public static string web_console_version = "Cosmic-Dawn 2.5.3.4c"; 7 | public static string versionUrl = "https://blog.netlockrmm.com/2025/10/26/netlock-rmm-2-5-3-0-whitelabel-tray-icon/"; 8 | public static string Local_Encryption_Key = "01234567890123456789012345678901"; 9 | 10 | //OSSCH_START 2141347d-c899-41c9-9ed5-cd18ccc5f79b //OSSCH_END 11 | 12 | public static string onlyPro = "This feature is exclusive to Pro & Cloud users. Please ensure you have an active paid membership, or your changes will not take effect."; 13 | } 14 | } -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/Properties/PublishProfiles/win-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\win-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | win-x64 14 | true 15 | false 16 | false 17 | false 18 | 19 | -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/Properties/PublishProfiles/win-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\win-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | win-arm64 14 | true 15 | false 16 | false 17 | false 18 | 19 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Properties/PublishProfiles/win-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\win-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | win-x64 14 | true 15 | false 16 | false 17 | false 18 | 19 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Properties/PublishProfiles/win-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\win-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | win-x64 14 | true 15 | false 16 | false 17 | false 18 | 19 | -------------------------------------------------------------------------------- /NetLock RMM Agent Installer/Properties/PublishProfiles/win-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\win-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | win-x64 14 | true 15 | true 16 | false 17 | false 18 | 19 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Properties/PublishProfiles/win-x64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\win-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | win-x64 14 | true 15 | false 16 | false 17 | false 18 | 19 | -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/NetLock RMM User Process.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | WinExe 5 | net8.0 6 | NetLock_RMM_User_Process 7 | enable 8 | enable 9 | NetLock_RMM_User_Process 10 | app.manifest 11 | AnyCPU;x64 12 | true 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/Properties/PublishProfiles/linux-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\win-x64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | win-x64 14 | true 15 | false 16 | false 17 | false 18 | 19 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Properties/PublishProfiles/win-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\win-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | win-arm64 14 | true 15 | false 16 | false 17 | false 18 | 19 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Properties/PublishProfiles/win-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\win-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | win-arm64 14 | true 15 | false 16 | false 17 | false 18 | 19 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Properties/PublishProfiles/win-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\win-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | win-arm64 14 | true 15 | false 16 | false 17 | false 18 | 19 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/HWID_System/gen.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Security.Cryptography; 4 | using System.Runtime.InteropServices; 5 | 6 | namespace _x101.HWID_System 7 | { 8 | public static class ENGINE 9 | { 10 | [System.Reflection.ObfuscationAttribute(Feature = "Virtualization", Exclude = false)] 11 | 12 | public static async Task Get_Hwid() 13 | { 14 | if (OperatingSystem.IsWindows()) 15 | { 16 | var cpuId = CpuId.GetCpuId(); 17 | var windowsId = WindowsId.GetWindowsId(); 18 | return windowsId + cpuId; 19 | } 20 | else 21 | { 22 | return "Unknown"; 23 | } 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /NetLock RMM Agent Installer/Properties/PublishProfiles/win-arm64.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | Release 8 | Any CPU 9 | bin\Release\net8.0\publish\win-arm64\ 10 | FileSystem 11 | <_TargetId>Folder 12 | net8.0 13 | win-arm64 14 | true 15 | true 16 | false 17 | false 18 | 19 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Resources/Components/Pages/Settings.Notifications/Ntfy_sh/Add_Ntfy_sh_Notification_Dialog.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | text/microsoft-resx 4 | 5 | 6 | 1.3 7 | 8 | 9 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 10 | 11 | 12 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/_Imports.razor: -------------------------------------------------------------------------------- 1 | @using System.Net.Http 2 | @using System.Net.Http.Json 3 | @using Microsoft.AspNetCore.Components.Forms 4 | @using Microsoft.AspNetCore.Components.Routing 5 | @using Microsoft.AspNetCore.Components.Web 6 | @using static Microsoft.AspNetCore.Components.Web.RenderMode 7 | @using Microsoft.AspNetCore.Components.Web.Virtualization 8 | @using Microsoft.JSInterop 9 | @using MudBlazor 10 | @using MudBlazor.Services 11 | @using NetLock_RMM_Web_Console 12 | @using NetLock_RMM_Web_Console.Components 13 | @using Microsoft.AspNetCore.Authorization 14 | @using Microsoft.AspNetCore.Components.Authorization 15 | @using Blazored.LocalStorage 16 | @using Microsoft.Extensions.Localization 17 | @using BCrypt.Net; 18 | @using BlazorMonaco 19 | @using BlazorMonaco.Editor 20 | @using BlazorMonaco.Languages -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Configuration/Web_Console.cs: -------------------------------------------------------------------------------- 1 | namespace NetLock_RMM_Web_Console.Configuration 2 | { 3 | public class Web_Console 4 | { 5 | public static string title = String.Empty; 6 | public static string logoBase64 = String.Empty; 7 | public static string language = "en-US"; 8 | public static bool loggingEnabled = false; 9 | public static string token_service_secret_key = String.Empty; // generated on startup 10 | public static string publicOverrideUrl = String.Empty; // used to override the public URL for the web console, useful for reverse proxies or load balancers 11 | public static string agentConfigurationConnectionString = String.Empty; // used for cloud instances to 12 | public static Classes.Theme.ThemePaletteConfig? customThemePalette = null; // custom theme palette loaded from database 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/fonts/roboto.css: -------------------------------------------------------------------------------- 1 | /* Roboto Font - Local Version (GDPR compliant) */ 2 | 3 | @font-face { 4 | font-family: 'Roboto'; 5 | font-style: normal; 6 | font-weight: 300; 7 | font-display: swap; 8 | src: url('Roboto-Light.ttf') format('truetype'); 9 | } 10 | 11 | @font-face { 12 | font-family: 'Roboto'; 13 | font-style: normal; 14 | font-weight: 400; 15 | font-display: swap; 16 | src: url('Roboto-Regular.ttf') format('truetype'); 17 | } 18 | 19 | @font-face { 20 | font-family: 'Roboto'; 21 | font-style: normal; 22 | font-weight: 500; 23 | font-display: swap; 24 | src: url('Roboto-Medium.ttf') format('truetype'); 25 | } 26 | 27 | @font-face { 28 | font-family: 'Roboto'; 29 | font-style: normal; 30 | font-weight: 700; 31 | font-display: swap; 32 | src: url('Roboto-Bold.ttf') format('truetype'); 33 | } 34 | 35 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Devices/Dialogs/Edit_Label.razor: -------------------------------------------------------------------------------- 1 | @inject IDialogService DialogService 2 | 3 | 4 | 5 | 6 | 7 | 8 | Submit 9 | Cancel 10 | 11 | 12 | 13 | @code { 14 | [CascadingParameter] IMudDialogInstance MudDialog { get; set; } 15 | [Parameter] public string oldLabel { get; set; } = string.Empty; 16 | 17 | void Submit() 18 | { 19 | MudDialog.Close(DialogResult.Ok(oldLabel)); 20 | } 21 | 22 | void Cancel() 23 | { 24 | MudDialog.Cancel(); 25 | } 26 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Helper/BCrypt.cs: -------------------------------------------------------------------------------- 1 | using BCrypt.Net; 2 | 3 | namespace BCrypt 4 | { 5 | public class Handler 6 | { 7 | public static async Task Hash_Content(string input) 8 | { 9 | return await Task.Run(() => 10 | { 11 | string salt = BCrypt.Net.BCrypt.GenerateSalt(); 12 | string hashed = BCrypt.Net.BCrypt.HashPassword(input, salt); 13 | 14 | return hashed; 15 | }); 16 | } 17 | 18 | public static async Task Verify_Content(string input) 19 | { 20 | return await Task.Run(() => 21 | { 22 | string salt = BCrypt.Net.BCrypt.GenerateSalt(); 23 | string hashed = BCrypt.Net.BCrypt.HashPassword(input, salt); 24 | 25 | return hashed; 26 | }); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/NetLock RMM Agent Health.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | dotnet-NetLock_RMM_Agent_Health-0d488fd0-d2b3-4258-8aa4-9ab5d22f2dd6 8 | NetLock_RMM_Agent_Health 9 | NetLock_RMM_Agent_Health 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | true 8 | false 9 | true 10 | Release 11 | Any CPU 12 | FileSystem 13 | bin\Release\net9.0\publish\ 14 | FileSystem 15 | <_TargetId>Folder 16 | 17 | net9.0 18 | 65c2864c-5b94-4560-8b27-492be00b1e7f 19 | false 20 | 21 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Properties/PublishProfiles/FolderProfile.pubxml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | true 8 | false 9 | true 10 | Release 11 | Any CPU 12 | FileSystem 13 | bin\Release\net9.0\publish\ 14 | FileSystem 15 | <_TargetId>Folder 16 | 17 | net9.0 18 | c49d8a10-3530-483d-ae9b-71f451c13206 19 | false 20 | 21 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Initialization/Health.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using System.Diagnostics; 8 | using Global.Helper; 9 | using Global.Configuration; 10 | using NetLock_RMM_Agent_Health; 11 | 12 | namespace Global.Initialization 13 | { 14 | internal class Health 15 | { 16 | // Check if the directories are in place 17 | public static void Check_Directories() 18 | { 19 | try 20 | { 21 | // Program Data 22 | if (!Directory.Exists(Application_Paths.program_data_logs)) 23 | Directory.CreateDirectory(Application_Paths.program_data_logs); 24 | } 25 | catch (Exception ex) 26 | { 27 | Logging.Error("Initialization.Health.Check_Directories", "", ex.ToString()); 28 | } 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /NetLock RMM Tray Icon/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Global/Configuration/Tray_Icon.cs: -------------------------------------------------------------------------------- 1 | namespace Global.Configuration; 2 | 3 | public class Tray_Icon 4 | { 5 | public class TrayIconConfigRoot 6 | { 7 | public Tray_Icon.RemoteScreenControlConfig RemoteScreenControl { get; set; } 8 | } 9 | 10 | static class AppConfig 11 | { 12 | public static RemoteScreenControlConfig? RemoteScreenControlConfig { get; set; } 13 | } 14 | 15 | public class RemoteScreenControlConfig 16 | { 17 | public string? RequestTitle { get; set; } = "A admin wants to control your screen"; 18 | public string? RequestMessage { get; set; } = "Do you want to allow remote screen control?"; 19 | public string? AcceptButtonTitle { get; set; } = "Accept"; 20 | public string? DeclineButtonTitle { get; set; } = "Decline"; 21 | public string? StopButtonTitle { get; set; } = "Stop Remote Screen Control"; 22 | public string? SessionActiveText { get; set; } = "A admin is controlling your screen"; 23 | } 24 | } -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/wwwroot/fonts/poppins.css: -------------------------------------------------------------------------------- 1 | /* Poppins Font - Local Version (GDPR compliant) */ 2 | 3 | @font-face { 4 | font-family: 'Poppins'; 5 | font-style: normal; 6 | font-weight: 300; 7 | font-display: swap; 8 | src: url('Poppins-Light.ttf') format('truetype'); 9 | } 10 | 11 | @font-face { 12 | font-family: 'Poppins'; 13 | font-style: normal; 14 | font-weight: 400; 15 | font-display: swap; 16 | src: url('Poppins-Regular.ttf') format('truetype'); 17 | } 18 | 19 | @font-face { 20 | font-family: 'Poppins'; 21 | font-style: normal; 22 | font-weight: 500; 23 | font-display: swap; 24 | src: url('Poppins-Medium.ttf') format('truetype'); 25 | } 26 | 27 | @font-face { 28 | font-family: 'Poppins'; 29 | font-style: normal; 30 | font-weight: 600; 31 | font-display: swap; 32 | src: url('Poppins-SemiBold.ttf') format('truetype'); 33 | } 34 | 35 | @font-face { 36 | font-family: 'Poppins'; 37 | font-style: normal; 38 | font-weight: 700; 39 | font-display: swap; 40 | src: url('Poppins-Bold.ttf') format('truetype'); 41 | } 42 | 43 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Windows/Helper/WMI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Management; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Global.Helper; 8 | 9 | namespace Windows.Helper 10 | { 11 | internal class WMI 12 | { 13 | public static string Search(string scope, string queryString, string column) 14 | { 15 | try 16 | { 17 | using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, queryString)) 18 | { 19 | foreach (ManagementObject reader in searcher.Get()) 20 | { 21 | return reader[column].ToString(); 22 | } 23 | } 24 | 25 | return "-"; 26 | } 27 | catch (Exception ex) 28 | { 29 | Logging.Error("Helper.WMI_Handler.Search", $"Scope: {scope} Query: {queryString}", $"Failed: {ex.ToString()}"); 30 | return "-"; 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/NetLock RMM Agent Health.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.12.35514.174 d17.12 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetLock RMM Agent Health", "NetLock RMM Agent Health.csproj", "{101245EC-E6F2-4364-B3F8-254D965EF65C}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {101245EC-E6F2-4364-B3F8-254D965EF65C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {101245EC-E6F2-4364-B3F8-254D965EF65C}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {101245EC-E6F2-4364-B3F8-254D965EF65C}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {101245EC-E6F2-4364-B3F8-254D965EF65C}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Windows/Helper/WMI.cs: -------------------------------------------------------------------------------- 1 | using Global.Helper; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Management; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Windows.Helper 10 | { 11 | internal class WMI 12 | { 13 | public static string Search(string scope, string queryString, string column) 14 | { 15 | try 16 | { 17 | using (ManagementObjectSearcher searcher = new ManagementObjectSearcher(scope, queryString)) 18 | { 19 | foreach (ManagementObject reader in searcher.Get()) 20 | { 21 | return reader[column].ToString(); 22 | } 23 | } 24 | 25 | return "-"; 26 | } 27 | catch (Exception ex) 28 | { 29 | Logging.Error("Helper.WMI_Handler.Search", $"Scope: {scope} Query: {queryString}", $"Failed: {ex.ToString()}"); 30 | return "-"; 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /NetLock RMM Agent Installer/NetLock RMM Agent Installer.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.12.35514.174 d17.12 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetLock RMM Agent Installer", "NetLock RMM Agent Installer.csproj", "{F119E316-7BED-4933-84D3-2033F15AAED3}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {F119E316-7BED-4933-84D3-2033F15AAED3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {F119E316-7BED-4933-84D3-2033F15AAED3}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {F119E316-7BED-4933-84D3-2033F15AAED3}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {F119E316-7BED-4933-84D3-2033F15AAED3}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Global/Helper/IO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Security.Cryptography; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Global.Helper 10 | { 11 | internal class IO 12 | { 13 | public static string Get_SHA512(string FilePath) 14 | { 15 | try 16 | { 17 | using (FileStream stream = File.OpenRead(FilePath)) 18 | { 19 | SHA512Managed sha512 = new SHA512Managed(); 20 | byte[] checksum_sha512 = sha512.ComputeHash(stream); 21 | string hash = BitConverter.ToString(checksum_sha512).Replace("-", String.Empty); 22 | 23 | Logging.Debug("Helper.IO.Get_SHA512", "hash", hash); 24 | 25 | return hash; 26 | } 27 | } 28 | catch (Exception ex) 29 | { 30 | Logging.Error("Helper.IO.Get_SHA512", "General error", ex.ToString()); 31 | return ex.ToString(); 32 | } 33 | } 34 | 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/NetLock RMM Server.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | true 8 | NetLock_RMM_Server 9 | False 10 | NetLock_RMM_Server 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/NetLock RMM Server.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.8.34316.72 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetLock RMM Server", "NetLock RMM Server.csproj", "{65C2864C-5B94-4560-8B27-492BE00B1E7F}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {65C2864C-5B94-4560-8B27-492BE00B1E7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {65C2864C-5B94-4560-8B27-492BE00B1E7F}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {65C2864C-5B94-4560-8B27-492BE00B1E7F}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {65C2864C-5B94-4560-8B27-492BE00B1E7F}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {096EFB0D-EDFE-4971-B3FF-CA5B04A4D3BF} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Files/Compiler/Assembly_Manipulation.cs: -------------------------------------------------------------------------------- 1 | using System.IO.Compression; 2 | using System.Runtime.InteropServices; 3 | using System.Text; 4 | 5 | namespace NetLock_RMM_Server.Files.Compiler 6 | { 7 | public class Assembly_Manipulation 8 | { 9 | public static async Task Embedd_Server_Config(string path, string content) 10 | { 11 | try 12 | { 13 | using (FileStream fs = new FileStream(path, FileMode.Append, FileAccess.Write)) 14 | using (BinaryWriter writer = new BinaryWriter(fs)) 15 | { 16 | writer.Write(Encoding.UTF8.GetBytes("SERVERCONFIGMARKER")); // Marker schreiben 17 | writer.Write(Encoding.UTF8.GetBytes(await Base64.Handler.Encode(content))); // Base64-String anhängen 18 | } 19 | 20 | return true; 21 | } 22 | catch (Exception ex) 23 | { 24 | Logging.Handler.Error("NetLock_RMM_Server.Helper.Compiler.Ressource_Manipulation.Write_Ressource", "General error", ex.ToString()); 25 | Console.WriteLine(ex.ToString()); 26 | return false; 27 | } 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Global/Configuration/Agent.cs: -------------------------------------------------------------------------------- 1 | namespace Global.Configuration 2 | { 3 | public class Agent 4 | { 5 | public static bool debug_mode { get; set; } = false; //enables/disables logging 6 | public static bool ssl { get; set; } = false; 7 | public static string package_guid { get; set; } = String.Empty; 8 | public static string communication_servers { get; set; } = String.Empty; 9 | public static string remote_servers { get; set; } = String.Empty; 10 | public static string update_servers { get; set; } = String.Empty; 11 | public static string trust_servers { get; set; } = String.Empty; 12 | public static string file_servers { get; set; } = String.Empty; 13 | public static string tenant_guid { get; set; } = String.Empty; 14 | public static string location_guid { get; set; } = String.Empty; 15 | public static string language { get; set; } = String.Empty; 16 | public static string http_https { get; set; } = String.Empty; 17 | public static string device_name { get; set; } = String.Empty; 18 | public static string hwid { get; set; } = String.Empty; 19 | public static string platform { get; set; } = String.Empty; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Global/Configuration/Agent.cs: -------------------------------------------------------------------------------- 1 | namespace Global.Configuration 2 | { 3 | public class Agent 4 | { 5 | public static bool debug_mode { get; set; } = false; //enables/disables logging 6 | public static bool ssl { get; set; } = false; 7 | public static string package_guid { get; set; } = String.Empty; 8 | public static string communication_servers { get; set; } = String.Empty; 9 | public static string remote_servers { get; set; } = String.Empty; 10 | public static string update_servers { get; set; } = String.Empty; 11 | public static string trust_servers { get; set; } = String.Empty; 12 | public static string file_servers { get; set; } = String.Empty; 13 | public static string tenant_guid { get; set; } = String.Empty; 14 | public static string location_guid { get; set; } = String.Empty; 15 | public static string language { get; set; } = String.Empty; 16 | public static string http_https { get; set; } = String.Empty; 17 | public static string device_name { get; set; } = String.Empty; 18 | public static string hwid { get; set; } = String.Empty; 19 | public static string platform { get; set; } = String.Empty; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /NetLock RMM Tray Icon/NetLock RMM Tray Icon.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.14.36310.24 d17.14 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetLock RMM Tray Icon", "NetLock RMM Tray Icon.csproj", "{2CA4D400-9860-4051-BF8E-8660E54E2280}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {2CA4D400-9860-4051-BF8E-8660E54E2280}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {2CA4D400-9860-4051-BF8E-8660E54E2280}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {2CA4D400-9860-4051-BF8E-8660E54E2280}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {2CA4D400-9860-4051-BF8E-8660E54E2280}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {B1BE7AE1-D43C-41B0-AC79-8DB4B5A6AFD0} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/NetLock RMM Web Console.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.10.35013.160 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NetLock RMM Web Console", "NetLock RMM Web Console.csproj", "{C49D8A10-3530-483D-AE9B-71F451C13206}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {C49D8A10-3530-483D-AE9B-71F451C13206}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {C49D8A10-3530-483D-AE9B-71F451C13206}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {C49D8A10-3530-483D-AE9B-71F451C13206}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {C49D8A10-3530-483D-AE9B-71F451C13206}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {E55F4080-5913-4AFB-A0DC-102B8110AADC} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json.schemastore.org/launchsettings.json", 3 | "iisSettings": { 4 | "windowsAuthentication": false, 5 | "anonymousAuthentication": true, 6 | "iisExpress": { 7 | "applicationUrl": "http://localhost:32855", 8 | "sslPort": 44321 9 | } 10 | }, 11 | "profiles": { 12 | "http": { 13 | "commandName": "Project", 14 | "dotnetRunMessages": true, 15 | "launchBrowser": true, 16 | "applicationUrl": "http://localhost:5000", 17 | "environmentVariables": { 18 | "ASPNETCORE_ENVIRONMENT": "Development" 19 | } 20 | }, 21 | "https": { 22 | "commandName": "Project", 23 | "dotnetRunMessages": true, 24 | "launchBrowser": true, 25 | "applicationUrl": "https://localhost:7253;http://localhost:5131", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | }, 30 | "IIS Express": { 31 | "commandName": "IISExpress", 32 | "launchBrowser": true, 33 | "environmentVariables": { 34 | "ASPNETCORE_ENVIRONMENT": "Development" 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Setup/DNS.cs: -------------------------------------------------------------------------------- 1 | using System.Net; 2 | 3 | namespace NetLock_RMM_Web_Console.Classes.Setup 4 | { 5 | public class DNS 6 | { 7 | public static async Task<(bool, string)> Check_Dns_Forward_Reverse(string host) 8 | { 9 | try 10 | { 11 | IPAddress[] addresses = await Dns.GetHostAddressesAsync(host); 12 | 13 | foreach (var ip in addresses) 14 | { 15 | IPHostEntry reverse = await Dns.GetHostEntryAsync(ip); 16 | 17 | if (!reverse.HostName.Equals(host, StringComparison.OrdinalIgnoreCase)) 18 | { 19 | return (false, reverse.HostName); // Hostnames do not match 20 | } 21 | else 22 | { 23 | return (true, reverse.HostName); 24 | } 25 | } 26 | 27 | return (false, "No IP addresses found."); 28 | } 29 | catch (Exception ex) 30 | { 31 | Logging.Handler.Error("DNS", "Check_Dns_Forward_Reverse", ex.Message); 32 | return (false, "Undefined."); 33 | } 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "http": { 4 | "commandName": "Project", 5 | "launchUrl": "swagger", 6 | "environmentVariables": { 7 | "ASPNETCORE_ENVIRONMENT": "Development" 8 | }, 9 | "dotnetRunMessages": true, 10 | "applicationUrl": "http://localhost:7080" 11 | }, 12 | "https": { 13 | "commandName": "Project", 14 | "launchBrowser": true, 15 | "launchUrl": "swagger", 16 | "environmentVariables": { 17 | "ASPNETCORE_ENVIRONMENT": "Development" 18 | }, 19 | "dotnetRunMessages": true, 20 | "applicationUrl": "https://localhost:7173;http://localhost:5054" 21 | }, 22 | "IIS Express": { 23 | "commandName": "IISExpress", 24 | "launchBrowser": true, 25 | "launchUrl": "swagger", 26 | "environmentVariables": { 27 | "ASPNETCORE_ENVIRONMENT": "Development" 28 | } 29 | } 30 | }, 31 | "$schema": "http://json.schemastore.org/launchsettings.json", 32 | "iisSettings": { 33 | "windowsAuthentication": false, 34 | "anonymousAuthentication": true, 35 | "iisExpress": { 36 | "applicationUrl": "http://localhost:28260", 37 | "sslPort": 44374 38 | } 39 | }, 40 | "agent_versions": { 41 | "windows": "1.0.0.0" 42 | } 43 | } -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Initialization/Health.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using System.Diagnostics; 8 | using NetLock_RMM_Agent_Remote; 9 | using Global.Helper; 10 | 11 | namespace Global.Initialization 12 | { 13 | internal class Health 14 | { 15 | // Check if the directories are in place 16 | public static void Check_Directories() 17 | { 18 | try 19 | { 20 | // Program Data 21 | if (!Directory.Exists(Application_Paths.program_data)) 22 | Directory.CreateDirectory(Application_Paths.program_data); 23 | 24 | // Logs 25 | if (!Directory.Exists(Application_Paths.program_data_logs)) 26 | Directory.CreateDirectory(Application_Paths.program_data_logs); 27 | 28 | // Scripts 29 | if (!Directory.Exists(Application_Paths.program_data_scripts)) 30 | Directory.CreateDirectory(Application_Paths.program_data_scripts); 31 | } 32 | catch (Exception ex) 33 | { 34 | Logging.Error("Initialization.Health.Check_Directories", "", ex.ToString()); 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Error.razor: -------------------------------------------------------------------------------- 1 | @page "/Error" 2 | @using System.Diagnostics 3 | 4 | Error 5 | 6 |

Error.

7 |

An error occurred while processing your request.

8 | 9 | @if (ShowRequestId) 10 | { 11 |

12 | Request ID: @RequestId 13 |

14 | } 15 | 16 |

Development Mode

17 |

18 | Swapping to Development environment will display more detailed information about the error that occurred. 19 |

20 |

21 | The Development environment shouldn't be enabled for deployed applications. 22 | It can result in displaying sensitive information from exceptions to end users. 23 | For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development 24 | and restarting the app. 25 |

26 | 27 | @code{ 28 | [CascadingParameter] 29 | private HttpContext? HttpContext { get; set; } 30 | 31 | private string? RequestId { get; set; } 32 | private bool ShowRequestId => !string.IsNullOrEmpty(RequestId); 33 | 34 | protected override void OnInitialized() => 35 | RequestId = Activity.Current?.Id ?? HttpContext?.TraceIdentifier; 36 | } 37 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/HWID_System/disk.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Management; 3 | 4 | namespace _x101.HWID_System 5 | { 6 | internal class DiskId 7 | { 8 | [System.Reflection.ObfuscationAttribute(Feature = "Virtualization", Exclude = false)] 9 | 10 | public static string GetDiskId() 11 | { 12 | return GetDiskId(""); 13 | } 14 | private static string GetDiskId(string diskLetter) 15 | { 16 | //Find first drive 17 | if (string.IsNullOrEmpty(diskLetter)) 18 | { 19 | foreach (var compDrive in DriveInfo.GetDrives()) 20 | { 21 | if (compDrive.IsReady) 22 | { 23 | diskLetter = compDrive.RootDirectory.ToString(); 24 | break; 25 | } 26 | } 27 | } 28 | if (!string.IsNullOrEmpty(diskLetter) && diskLetter.EndsWith(":\\")) 29 | { 30 | //C:\ -> C 31 | diskLetter = diskLetter.Substring(0, diskLetter.Length - 2); 32 | } 33 | var disk = new ManagementObject(@"win32_logicaldisk.deviceid=""" + diskLetter + @":"""); 34 | disk.Get(); 35 | 36 | var volumeSerial = disk["VolumeSerialNumber"].ToString(); 37 | disk.Dispose(); 38 | 39 | return volumeSerial; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/HWID_System/disk.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Management; 3 | 4 | namespace _x101.HWID_System 5 | { 6 | internal class DiskId 7 | { 8 | [System.Reflection.ObfuscationAttribute(Feature = "Virtualization", Exclude = false)] 9 | 10 | public static string GetDiskId() 11 | { 12 | return GetDiskId(""); 13 | } 14 | private static string GetDiskId(string diskLetter) 15 | { 16 | //Find first drive 17 | if (string.IsNullOrEmpty(diskLetter)) 18 | { 19 | foreach (var compDrive in DriveInfo.GetDrives()) 20 | { 21 | if (compDrive.IsReady) 22 | { 23 | diskLetter = compDrive.RootDirectory.ToString(); 24 | break; 25 | } 26 | } 27 | } 28 | if (!string.IsNullOrEmpty(diskLetter) && diskLetter.EndsWith(":\\")) 29 | { 30 | //C:\ -> C 31 | diskLetter = diskLetter.Substring(0, diskLetter.Length - 2); 32 | } 33 | var disk = new ManagementObject(@"win32_logicaldisk.deviceid=""" + diskLetter + @":"""); 34 | disk.Get(); 35 | 36 | var volumeSerial = disk["VolumeSerialNumber"].ToString(); 37 | disk.Dispose(); 38 | 39 | return volumeSerial; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/HWID_System/disk.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Management; 3 | 4 | namespace _x101.HWID_System 5 | { 6 | internal class DiskId 7 | { 8 | [System.Reflection.ObfuscationAttribute(Feature = "Virtualization", Exclude = false)] 9 | 10 | public static string GetDiskId() 11 | { 12 | return GetDiskId(""); 13 | } 14 | private static string GetDiskId(string diskLetter) 15 | { 16 | //Find first drive 17 | if (string.IsNullOrEmpty(diskLetter)) 18 | { 19 | foreach (var compDrive in DriveInfo.GetDrives()) 20 | { 21 | if (compDrive.IsReady) 22 | { 23 | diskLetter = compDrive.RootDirectory.ToString(); 24 | break; 25 | } 26 | } 27 | } 28 | if (!string.IsNullOrEmpty(diskLetter) && diskLetter.EndsWith(":\\")) 29 | { 30 | //C:\ -> C 31 | diskLetter = diskLetter.Substring(0, diskLetter.Length - 2); 32 | } 33 | var disk = new ManagementObject(@"win32_logicaldisk.deviceid=""" + diskLetter + @":"""); 34 | disk.Get(); 35 | 36 | var volumeSerial = disk["VolumeSerialNumber"].ToString(); 37 | disk.Dispose(); 38 | 39 | return volumeSerial; 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/NetLock RMM Agent Comm.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.12.35514.174 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetLock RMM Agent Comm", "NetLock RMM Agent Comm.csproj", "{74DA604D-11A8-4A67-B1B3-735AE8704648}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Release|Any CPU = Release|Any CPU 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {74DA604D-11A8-4A67-B1B3-735AE8704648}.Debug|Any CPU.ActiveCfg = Debug|x64 17 | {74DA604D-11A8-4A67-B1B3-735AE8704648}.Debug|Any CPU.Build.0 = Debug|x64 18 | {74DA604D-11A8-4A67-B1B3-735AE8704648}.Debug|x64.ActiveCfg = Debug|x64 19 | {74DA604D-11A8-4A67-B1B3-735AE8704648}.Debug|x64.Build.0 = Debug|x64 20 | {74DA604D-11A8-4A67-B1B3-735AE8704648}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {74DA604D-11A8-4A67-B1B3-735AE8704648}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {74DA604D-11A8-4A67-B1B3-735AE8704648}.Release|x64.ActiveCfg = Release|x64 23 | {74DA604D-11A8-4A67-B1B3-735AE8704648}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /NetLock RMM Agent Installer/Linux/Helper/Linux.cs: -------------------------------------------------------------------------------- 1 | using Helper; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Linux.Helper 9 | { 10 | internal class Linux 11 | { 12 | // Helper method to create service files dynamically 13 | public static void CreateServiceFile(string serviceFilePath, string serviceName, string executablePath, string workingDirectory, string logFilePath) 14 | { 15 | // Wenn der Pfad Leerzeichen enthält, setzen wir ihn in doppelte Anführungszeichen 16 | string formattedExecutablePath = $"\"{executablePath}\""; 17 | 18 | string serviceContent = @$"[Unit] 19 | Description={serviceName} 20 | After=network.target 21 | 22 | [Service] 23 | ExecStart={formattedExecutablePath} 24 | Restart=always 25 | RestartSec=5s 26 | User=root 27 | WorkingDirectory={workingDirectory} 28 | KillSignal=SIGINT 29 | StandardOutput=append:{logFilePath} 30 | StandardError=append:{logFilePath} 31 | LimitNOFILE=65536 32 | 33 | [Install] 34 | WantedBy=multi-user.target 35 | "; 36 | 37 | // Write the service file 38 | System.IO.File.WriteAllText(serviceFilePath, serviceContent); 39 | 40 | // Set correct permissions 41 | Bash.Execute_Script("Setting correct permissions", false, 42 | $"chmod 644 {serviceFilePath}"); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Helper/Base64.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace Base64 4 | { 5 | internal class Handler 6 | { 7 | public static async Task Encode(string content) 8 | { 9 | byte[] data = Encoding.UTF8.GetBytes(content); 10 | return await Task.Run(() => Convert.ToBase64String(data)); 11 | } 12 | 13 | public static async Task Decode(string encodedContent) 14 | { 15 | try 16 | { 17 | byte[] data = Convert.FromBase64String(encodedContent); 18 | return await Task.Run(() => Encoding.UTF8.GetString(data)); 19 | } 20 | catch (Exception ex) 21 | { 22 | Logging.Handler.Error("Base64.Handler.Decode", "", ex.Message); 23 | return ""; 24 | } 25 | } 26 | 27 | 28 | /*public static void Write_File(string path, string base64) 29 | { 30 | try 31 | { 32 | File.WriteAllText(path, DecodeAsync(base64)); 33 | } 34 | catch (Exception ex) 35 | { 36 | Logging.Handler.Error("Helper.Base64.Write_File", "failed", "Details: " + Environment.NewLine + 37 | "Path: " + path + Environment.NewLine + 38 | "Base64: " + base64 + Environment.NewLine + 39 | "Error: " + ex.Message); 40 | } 41 | }*/ 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/NetLock RMM Agent Remote.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.12.35514.174 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetLock RMM Agent Remote", "NetLock RMM Agent Remote.csproj", "{00844A40-E629-40A5-B49C-5477B222044A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Release|Any CPU = Release|Any CPU 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {00844A40-E629-40A5-B49C-5477B222044A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {00844A40-E629-40A5-B49C-5477B222044A}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {00844A40-E629-40A5-B49C-5477B222044A}.Debug|x64.ActiveCfg = Debug|x64 19 | {00844A40-E629-40A5-B49C-5477B222044A}.Debug|x64.Build.0 = Debug|x64 20 | {00844A40-E629-40A5-B49C-5477B222044A}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {00844A40-E629-40A5-B49C-5477B222044A}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {00844A40-E629-40A5-B49C-5477B222044A}.Release|x64.ActiveCfg = Release|x64 23 | {00844A40-E629-40A5-B49C-5477B222044A}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/File Server/Handler.cs: -------------------------------------------------------------------------------- 1 | using MySqlConnector; 2 | using System.Data.Common; 3 | 4 | namespace NetLock_RMM_Web_Console.Classes.File_Server 5 | { 6 | public class Handler 7 | { 8 | // Get password of file by guid from database 9 | public static async Task Get_File_Password_By_Guid(string guid) 10 | { 11 | try 12 | { 13 | string password = ""; 14 | using (var conn = new MySqlConnection(Configuration.MySQL.Connection_String)) 15 | { 16 | conn.Open(); 17 | using (var cmd = new MySqlCommand("SELECT password FROM files WHERE guid = @guid", conn)) 18 | { 19 | cmd.Parameters.AddWithValue("@guid", guid); 20 | using (var reader = cmd.ExecuteReader()) 21 | { 22 | if (reader.Read()) 23 | { 24 | password = reader.GetString(0); 25 | } 26 | } 27 | } 28 | } 29 | return password; 30 | } 31 | catch (Exception ex) 32 | { 33 | Logging.Handler.Error("File_Server.Handler.Get_File_Password_By_Guid", guid, ex.ToString()); 34 | return String.Empty; 35 | } 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /NetLock RMM Tray Icon/NetLock RMM Tray Icon.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | WinExe 4 | net8.0 5 | enable 6 | true 7 | app.manifest 8 | true 9 | NetLock_RMM_Tray_Icon 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | None 20 | All 21 | 22 | 23 | 24 | 25 | 26 | 27 | Always 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/NetLock RMM Agent Comm.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | dotnet-NetLock_RMM_Agent_Comm-996a4a14-ff4d-462b-835a-8048ee189bfc 8 | NetLock_RMM_Agent_Comm 9 | NetLock_RMM_Agent_Comm 10 | AnyCPU;x64 11 | 12 | 13 | 14 | bin\Debug\net8.0\ 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Windows/Helper/ScreenControl/Shlwapi.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace Windows.Helper.ScreenControl; 4 | 5 | // https://docs.microsoft.com/en-us/windows/win32/api/shlwapi/nf-shlwapi-isos 6 | public class Shlwapi 7 | { 8 | [DllImport("shlwapi.dll", SetLastError = true)] 9 | [return: MarshalAs(UnmanagedType.Bool)] 10 | public static extern bool IsOS(OsType osType); 11 | } 12 | 13 | public enum OsType 14 | { 15 | OS_WINDOWS = 0, 16 | OS_NT = 1, 17 | OS_WIN95ORGREATER = 2, 18 | OS_NT4ORGREATER = 3, 19 | OS_WIN98ORGREATER = 5, 20 | OS_WIN98_GOLD = 6, 21 | OS_WIN2000ORGREATER = 7, 22 | OS_WIN2000PRO = 8, 23 | OS_WIN2000SERVER = 9, 24 | OS_WIN2000ADVSERVER = 10, 25 | OS_WIN2000DATACENTER = 11, 26 | OS_WIN2000TERMINAL = 12, 27 | OS_EMBEDDED = 13, 28 | OS_TERMINALCLIENT = 14, 29 | OS_TERMINALREMOTEADMIN = 15, 30 | OS_WIN95_GOLD = 16, 31 | OS_MEORGREATER = 17, 32 | OS_XPORGREATER = 18, 33 | OS_HOME = 19, 34 | OS_PROFESSIONAL = 20, 35 | OS_DATACENTER = 21, 36 | OS_ADVSERVER = 22, 37 | OS_SERVER = 23, 38 | OS_TERMINALSERVER = 24, 39 | OS_PERSONALTERMINALSERVER = 25, 40 | OS_FASTUSERSWITCHING = 26, 41 | OS_WELCOMELOGONUI = 27, 42 | OS_DOMAINMEMBER = 28, 43 | OS_ANYSERVER = 29, 44 | OS_WOW6432 = 30, 45 | OS_WEBSERVER = 31, 46 | OS_SMALLBUSINESSSERVER = 32, 47 | OS_TABLETPC = 33, 48 | OS_SERVERADMINUI = 34, 49 | OS_MEDIACENTER = 35, 50 | OS_APPLIANCE = 36, 51 | } 52 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/NetLock RMM Agent Remote.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net8.0 5 | enable 6 | enable 7 | dotnet-NetLock_RMM_Agent_Remote-069835b7-0e4e-42de-bf97-f65bf75bb24d 8 | NetLock_RMM_Agent_Remote 9 | NetLock_RMM_Agent_Remote 10 | AnyCPU;x64 11 | 12 | 13 | 14 | 15 | true 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/NetLock RMM User Process.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.10.35013.160 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetLock RMM User Process", "NetLock RMM User Process.csproj", "{F4AB4F9E-D0FE-4DFD-A6A1-BEC5C464EB0D}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Release|Any CPU = Release|Any CPU 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {F4AB4F9E-D0FE-4DFD-A6A1-BEC5C464EB0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {F4AB4F9E-D0FE-4DFD-A6A1-BEC5C464EB0D}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {F4AB4F9E-D0FE-4DFD-A6A1-BEC5C464EB0D}.Debug|x64.ActiveCfg = Debug|x64 19 | {F4AB4F9E-D0FE-4DFD-A6A1-BEC5C464EB0D}.Debug|x64.Build.0 = Debug|x64 20 | {F4AB4F9E-D0FE-4DFD-A6A1-BEC5C464EB0D}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {F4AB4F9E-D0FE-4DFD-A6A1-BEC5C464EB0D}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {F4AB4F9E-D0FE-4DFD-A6A1-BEC5C464EB0D}.Release|x64.ActiveCfg = Release|x64 23 | {F4AB4F9E-D0FE-4DFD-A6A1-BEC5C464EB0D}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {DE2A22C4-4B10-4879-A3AE-5349CC927269} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Routes.razor: -------------------------------------------------------------------------------- 1 | @inject NavigationManager NavigationManager 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |

Sorry, you're not authorized to view this page.

10 | 11 | @{ 12 | NavigationManager.NavigateTo("/", true); 13 | } 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 |
25 | 26 | Not found 27 | 28 |

Sorry, there's nothing at this address.

29 |
30 |
31 |
32 |
-------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Global/Helper/Process_User.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Diagnostics; 7 | using System.IO; 8 | using System.Security.Cryptography; 9 | using System.Runtime.InteropServices; 10 | using System.Security.Principal; 11 | 12 | namespace Global.Helper 13 | { 14 | internal class Process_User 15 | { 16 | public static string Get(Process process) 17 | { 18 | IntPtr processHandle = IntPtr.Zero; 19 | try 20 | { 21 | OpenProcessToken(process.Handle, 8, out processHandle); 22 | WindowsIdentity wi = new WindowsIdentity(processHandle); 23 | string user = wi.Name; 24 | return user.Contains(@"\") ? user.Substring(user.IndexOf(@"\") + 1) : user; 25 | } 26 | catch 27 | { 28 | return null; 29 | } 30 | finally 31 | { 32 | if (processHandle != IntPtr.Zero) 33 | { 34 | CloseHandle(processHandle); 35 | } 36 | } 37 | } 38 | 39 | [DllImport("advapi32.dll", SetLastError = true)] 40 | private static extern bool OpenProcessToken(IntPtr ProcessHandle, uint DesiredAccess, out IntPtr TokenHandle); 41 | [DllImport("kernel32.dll", SetLastError = true)] 42 | [return: MarshalAs(UnmanagedType.Bool)] 43 | private static extern bool CloseHandle(IntPtr hObject); 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Error", 6 | "Microsoft.Hosting.Lifetime": "Warning" 7 | }, 8 | "Custom": { 9 | "Enabled": true 10 | } 11 | }, 12 | "AllowedHosts": "*", 13 | "Kestrel": { 14 | "Endpoint": { 15 | "Http": { 16 | "Enabled": true, 17 | "Port": 5000 18 | }, 19 | "Https": { 20 | "Enabled": false, 21 | "Port": 5001, 22 | "Force": false, 23 | "Hsts": { 24 | "Enabled": false 25 | }, 26 | "Certificate": { 27 | "Path": "C:\\temp\\localhost.pfx", 28 | "Password": "" 29 | } 30 | } 31 | }, 32 | "KnownProxies": [] 33 | }, 34 | "NetLock_Remote_Server": { 35 | "Server": "127.0.0.1", 36 | "Port": 7080, 37 | "UseSSL": false 38 | }, 39 | "NetLock_File_Server": { 40 | "Server": "127.0.0.1", 41 | "Port": 7080, 42 | "UseSSL": false 43 | }, 44 | "MySQL": { 45 | "Server": "127.0.0.1", 46 | "Port": 3306, 47 | "Database": "netlock", 48 | "User": "root", 49 | "Password": "Bochum234", 50 | "SslMode": "None", 51 | "AdditionalConnectionParameters": "AllowPublicKeyRetrieval=True;" 52 | }, 53 | "Webinterface": { 54 | "Language": "en-US", 55 | "Membership_Reminder": false, 56 | "PublicOverrideUrl": "http://localhost:7080" 57 | }, 58 | "Members_Portal_Api": { 59 | "Enabled": true, 60 | "Cloud": false, 61 | "ApiKeyOverride": "2b77005b-61a3-4fa8-83c9-5b9f3621f758-ba910728-1b53-4cb5-9159-3eb4140a2eed", 62 | "ServerGuid": "Test-Guid" 63 | } 64 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Setup/Directories.cs: -------------------------------------------------------------------------------- 1 | 2 | namespace NetLock_RMM_Web_Console.Classes.Setup 3 | { 4 | public class Directories 5 | { 6 | public static void Check_Directories() 7 | { 8 | // Create the directories if they do not exist 9 | if (!Directory.Exists(Application_Paths.logs_dir)) 10 | Directory.CreateDirectory(Application_Paths.logs_dir); 11 | 12 | if (!Directory.Exists(Application_Paths.internal_dir)) 13 | Directory.CreateDirectory(Application_Paths.internal_dir); 14 | 15 | if (!Directory.Exists(Application_Paths.internal_temp_dir)) 16 | Directory.CreateDirectory(Application_Paths.internal_temp_dir); 17 | 18 | if(!Directory.Exists(Application_Paths._private_files_devices)) 19 | Directory.CreateDirectory(Application_Paths._private_files_devices); 20 | 21 | if (!Directory.Exists(Application_Paths.certificates_path)) 22 | Directory.CreateDirectory(Application_Paths.certificates_path); 23 | 24 | if (!Directory.Exists(Application_Paths.internal_recordings_dir)) 25 | Directory.CreateDirectory(Application_Paths.internal_recordings_dir); 26 | } 27 | 28 | public static void Delete_Directories() 29 | { 30 | if (Directory.Exists(Application_Paths.internal_temp_dir)) 31 | Directory.Delete(Application_Paths.internal_temp_dir, true); 32 | 33 | if (Directory.Exists(Application_Paths.logs_dir)) 34 | Directory.Delete(Application_Paths.logs_dir, true); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Collections/Scripts/Community Scripts/Publish_Dialog.razor: -------------------------------------------------------------------------------- 1 | @using System.Security.Claims 2 | 3 | @inject AuthenticationStateProvider AuthenticationStateProvider 4 | @inject NavigationManager NavigationManager 5 | @inject IDialogService DialogService 6 | 7 | 8 | 9 | 10 | 11 | If you'd like community members to be able to contact you with feedback, you may include your contact details. 12 | 13 | 14 | Cancel 15 | Publish 16 | 17 | 18 | 19 | @code { 20 | [CascadingParameter] IMudDialogInstance MudDialog { get; set; } 21 | public string FirstInput { get; set; } = string.Empty; 22 | 23 | protected override async Task OnInitializedAsync() 24 | { 25 | // Get the current user from the authentication state 26 | var user = (await AuthenticationStateProvider.GetAuthenticationStateAsync()).User; 27 | 28 | // Check if user is authenticated 29 | if (user?.Identity is not { IsAuthenticated: true }) 30 | { 31 | NavigationManager.NavigateTo("/login", true); 32 | return; 33 | } 34 | } 35 | 36 | void Submit() 37 | { 38 | MudDialog.Close(DialogResult.Ok(FirstInput)); 39 | } 40 | 41 | void Cancel() 42 | { 43 | MudDialog.Cancel(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Helper/Random.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace Randomizer 8 | { 9 | public class Handler 10 | { 11 | public static string Generate_Password(bool special, int length) 12 | { 13 | string chars = null; 14 | 15 | System.Random random = new System.Random(); 16 | if (special) 17 | chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!§$%&/()=?*[]#-"; 18 | else 19 | chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 20 | 21 | return new string(Enumerable.Repeat(chars, length).Select(s => s[random.Next(s.Length)]).ToArray()); 22 | } 23 | 24 | public static string Token(bool special, int length) 25 | { 26 | string chars = null; 27 | 28 | System.Random random = new System.Random(); 29 | if (special) 30 | chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!§$%&/()=?*[]#-"; 31 | else 32 | chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 33 | 34 | return new string(Enumerable.Repeat(chars, length).Select(s => s[random.Next(s.Length)]).ToArray()); 35 | } 36 | 37 | public static string Windows_Credentials(int length) 38 | { 39 | string chars = null; 40 | 41 | System.Random random = new System.Random(); 42 | chars = "abcdefghijklmnopqrstuvwxyz0123456789"; 43 | 44 | return new string(Enumerable.Repeat(chars, length).Select(s => s[random.Next(s.Length)]).ToArray()); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Shared/Export_Data_Dialog.razor: -------------------------------------------------------------------------------- 1 | @using MySqlConnector; 2 | @using System.Data.Common; 3 | @using System.Text.Json; 4 | 5 | @inject NavigationManager NavigationManager 6 | @inject ILocalStorageService localStorage 7 | @inject IDialogService DialogService 8 | @inject ISnackbar Snackbar 9 | @inject IStringLocalizer Localizer 10 | 11 | 12 | 13 | @Localizer["export_data"] 14 | 15 | 16 | @Localizer["text"] 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | @Localizer["cancel"] 25 | @Localizer["export"] 26 | 27 | 28 | 29 | 30 | @code { 31 | 32 | private string type = "Spreadsheet (.xlsx)"; 33 | 34 | [CascadingParameter] 35 | private IMudDialogInstance MudDialog { get; set; } = default!; 36 | 37 | private bool Form_Valid() 38 | { 39 | if (String.IsNullOrEmpty(type)) 40 | return true; 41 | else 42 | return false; 43 | } 44 | 45 | private void OK() 46 | { 47 | this.MudDialog.Close(DialogResult.Ok(type)); 48 | } 49 | 50 | private void Cancel() => MudDialog.Cancel(); 51 | } -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Global/Configuration/Agent.cs: -------------------------------------------------------------------------------- 1 | namespace Global.Configuration 2 | { 3 | public class Agent 4 | { 5 | public static bool debug_mode { get; set; } = false; //enables/disables logging 6 | public static bool ssl { get; set; } = false; 7 | public static string package_guid { get; set; } = String.Empty; 8 | public static string communication_servers { get; set; } = String.Empty; 9 | public static string remote_servers { get; set; } = String.Empty; 10 | public static string update_servers { get; set; } = String.Empty; 11 | public static string trust_servers { get; set; } = String.Empty; 12 | public static string file_servers { get; set; } = String.Empty; 13 | public static string tenant_guid { get; set; } = String.Empty; 14 | public static string location_guid { get; set; } = String.Empty; 15 | public static string language { get; set; } = String.Empty; 16 | public static string http_https { get; set; } = String.Empty; 17 | public static string device_name { get; set; } = String.Empty; 18 | public static string hwid { get; set; } = String.Empty; 19 | public static string platform { get; set; } = String.Empty; 20 | } 21 | 22 | public class AgentSettings 23 | { 24 | public bool RemoteServiceEnabled { get; set; } = false; 25 | public bool RemoteShellEnabled { get; set; } = false; 26 | public bool RemoteFileBrowserEnabled { get; set; } = false; 27 | public bool RemoteTaskManagerEnabled { get; set; } = false; 28 | public bool RemoteServiceManagerEnabled { get; set; } = false; 29 | public bool RemoteScreenControlEnabled { get; set; } = false; 30 | public bool RemoteScreenControlUnattendedAccess { get; set; } = false; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Collections/Scripts/Community Scripts/Report_Dialog.razor: -------------------------------------------------------------------------------- 1 | @using System.Security.Claims 2 | 3 | @inject AuthenticationStateProvider AuthenticationStateProvider 4 | @inject NavigationManager NavigationManager 5 | @inject IDialogService DialogService 6 | 7 | 8 | 9 | 10 | 11 | @if (String.IsNullOrEmpty(FirstInput)) 12 | { 13 | Please provide a reason for reporting this content. This will help us take appropriate action. 14 | } 15 | 16 | 17 | Cancel 18 | Report 19 | 20 | 21 | 22 | @code { 23 | [CascadingParameter] IMudDialogInstance MudDialog { get; set; } 24 | public string FirstInput { get; set; } = string.Empty; 25 | 26 | protected override async Task OnInitializedAsync() 27 | { 28 | // Get the current user from the authentication state 29 | var user = (await AuthenticationStateProvider.GetAuthenticationStateAsync()).User; 30 | 31 | // Check if user is authenticated 32 | if (user?.Identity is not { IsAuthenticated: true }) 33 | { 34 | NavigationManager.NavigateTo("/login", true); 35 | return; 36 | } 37 | } 38 | 39 | void Submit() 40 | { 41 | MudDialog.Close(DialogResult.Ok(FirstInput)); 42 | } 43 | 44 | void Cancel() 45 | { 46 | MudDialog.Cancel(); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Authentication/TokenService.cs: -------------------------------------------------------------------------------- 1 | using System.IdentityModel.Tokens.Jwt; 2 | using System.Security.Claims; 3 | using Microsoft.IdentityModel.Tokens; 4 | using System.Text; 5 | using NetLock_RMM_Web_Console.Classes.Authentication; 6 | using System.Configuration; 7 | 8 | public class TokenService 9 | { 10 | private readonly SymmetricSecurityKey _signingKey = new(Encoding.UTF8.GetBytes(NetLock_RMM_Web_Console.Configuration.Web_Console.token_service_secret_key)); 11 | 12 | public string GenerateToken(UserSession userSession) 13 | { 14 | try 15 | { 16 | var claims = new List 17 | { 18 | new(ClaimTypes.Email, userSession.UserName), 19 | new(ClaimTypes.Role, userSession.Role), 20 | }; 21 | 22 | var tokenDescriptor = new SecurityTokenDescriptor 23 | { 24 | Subject = new ClaimsIdentity(claims), 25 | Expires = DateTime.UtcNow.AddHours(16), // 16 hours are a usual work day (with pause included and for dashboard monitoring) 26 | SigningCredentials = new SigningCredentials(_signingKey, SecurityAlgorithms.HmacSha256Signature), 27 | Issuer = CustomAuthenticationStateProvider.Issuer, // New entry 28 | Audience = CustomAuthenticationStateProvider.Audience // New entry 29 | }; 30 | 31 | var tokenHandler = new JwtSecurityTokenHandler(); 32 | var token = tokenHandler.CreateToken(tokenDescriptor); 33 | 34 | return tokenHandler.WriteToken(token); 35 | } 36 | catch (Exception ex) 37 | { 38 | Logging.Handler.Error("Classes.Authentification.TokenService", "GenerateToken", ex.ToString()); 39 | 40 | // Log the exception if needed 41 | return string.Empty; 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Helper/System_Information/Server_Information_Service.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Extensions.Hosting; 2 | using System; 3 | using System.Configuration; 4 | using System.Threading; 5 | using System.Threading.Tasks; 6 | 7 | public class Server_Information_Service : BackgroundService 8 | { 9 | private readonly TimeSpan _interval = TimeSpan.FromMinutes(1); 10 | 11 | protected override async Task ExecuteAsync(CancellationToken stoppingToken) 12 | { 13 | while (!stoppingToken.IsCancellationRequested) 14 | { 15 | try 16 | { 17 | await Update_Server_Information(); 18 | await Task.Delay(_interval, stoppingToken); 19 | } 20 | catch (TaskCanceledException ex) 21 | { 22 | Logging.Handler.Debug("Server_Information_Service.ExecuteAsync", "Task canceled: ", ex.ToString()); 23 | // Task was terminated, terminate cleanly 24 | break; 25 | } 26 | catch (Exception ex) 27 | { 28 | Logging.Handler.Error("ServerInformationService", "ExecuteAsync", ex.ToString()); 29 | } 30 | } 31 | } 32 | 33 | private async Task Update_Server_Information() 34 | { 35 | try 36 | { 37 | Logging.Handler.Debug("Server_Information_Service.UpdateServerInformation", "Server Information Update Task started at:", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); 38 | await NetLock_RMM_Server.MySQL.Handler.Update_Server_Information(); 39 | Logging.Handler.Debug("Server_Information_Service.UpdateServerInformation", "Server Information Update Task finished at:", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); 40 | } 41 | catch (Exception ex) 42 | { 43 | Logging.Handler.Error("ServerInformationService", "UpdateServerInformation", ex.ToString()); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Global/Helper/Network.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Net.NetworkInformation; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Global.Helper 9 | { 10 | internal class Network 11 | { 12 | public static string Get_Local_IP_Address() 13 | { 14 | try 15 | { 16 | // Retrieve all network interfaces of the system 17 | NetworkInterface[] networkInterfaces = NetworkInterface.GetAllNetworkInterfaces(); 18 | 19 | // Select the first network interface that has a valid IPv4 address 20 | NetworkInterface ipv4Interface = networkInterfaces.FirstOrDefault( 21 | nic => nic.NetworkInterfaceType != NetworkInterfaceType.Loopback && 22 | nic.NetworkInterfaceType != NetworkInterfaceType.Tunnel && 23 | nic.GetIPProperties().GatewayAddresses.Any() && 24 | nic.GetIPProperties().UnicastAddresses.Any(a => a.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)); 25 | 26 | if (ipv4Interface != null) 27 | { 28 | // Return the first valid IPv4 address of the selected network adapter 29 | return ipv4Interface.GetIPProperties().UnicastAddresses 30 | .FirstOrDefault(a => a.Address.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) 31 | .Address.ToString(); 32 | } 33 | else 34 | { 35 | return "-"; 36 | } 37 | } 38 | catch (Exception ex) 39 | { 40 | Logging.Error("Global.Helper.Network", "Get_Local_IP_Address", ex.ToString()); 41 | return "-"; 42 | } 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Linux/Helper/Linux.cs: -------------------------------------------------------------------------------- 1 | using Global.Helper; 2 | using Helper; 3 | using NetLock_RMM_Agent_Health; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | 10 | namespace Linux.Helper 11 | { 12 | internal class Linux 13 | { 14 | // Helper method to create the installer service 15 | public static void CreateInstallerService() 16 | { 17 | // Set permissions 18 | Logging.Debug("Main", "Argument", $"sudo chmod +x \"{Application_Paths.c_temp_netlock_installer_path}\""); 19 | Bash.Execute_Script("Installer Permissions", false, $"sudo chmod +x \"{Application_Paths.c_temp_netlock_installer_path}\""); 20 | 21 | // Compose systemd service file content 22 | string serviceContent = @$"[Unit] 23 | Description=netlock-rmm-agent-installer 24 | After=network.target 25 | 26 | [Service] 27 | ExecStart=""/tmp/netlock rmm/installer/NetLock_RMM_Agent_Installer"" ""fix"" ""/var/0x101 Cyber Security/NetLock RMM/Comm Agent/server_config.json"" 28 | Restart=no 29 | RestartSec=5s 30 | User=root 31 | WorkingDirectory=/tmp/netlock rmm/installer 32 | KillSignal=SIGINT 33 | StandardOutput=append:/var/log/netlock-rmm-agent-installer.log 34 | StandardError=append:/var/log/netlock-rmm-agent-installer.log 35 | LimitNOFILE=65536 36 | 37 | [Install] 38 | WantedBy=multi-user.target 39 | "; 40 | 41 | // Write the service file 42 | System.IO.File.WriteAllText("/etc/systemd/system/netlock-rmm-agent-installer.service", serviceContent); 43 | 44 | // Set correct permissions on the service file 45 | Bash.Execute_Script("Set service file permissions", false, $"chmod 644 \"/etc/systemd/system/netlock-rmm-agent-installer.service\""); 46 | 47 | // Reload daemon 48 | Bash.Execute_Script("Reload services", false, "systemctl daemon-reload"); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Global/Helper/Random.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Security.Cryptography; 7 | 8 | namespace Global.Helper 9 | { 10 | public class Randomizer 11 | { 12 | public static async Task Generate_Access_Key(int length) 13 | { 14 | string ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 15 | 16 | try 17 | { 18 | using (var rng = new RNGCryptoServiceProvider()) 19 | { 20 | byte[] randomBytes = new byte[length]; 21 | rng.GetBytes(randomBytes); 22 | 23 | StringBuilder stringBuilder = new StringBuilder(length); 24 | foreach (byte b in randomBytes) 25 | { 26 | stringBuilder.Append(ValidChars[b % ValidChars.Length]); 27 | } 28 | 29 | return stringBuilder.ToString(); 30 | } 31 | } 32 | catch (Exception ex) 33 | { 34 | Logging.Error("Randomizer.Handler.Generate_Access_Key", "", ex.Message); 35 | return String.Empty; 36 | } 37 | } 38 | 39 | public static string Standard(int length) 40 | { 41 | try 42 | { 43 | Random random = new Random(); 44 | const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 45 | string random_id = new string(Enumerable.Repeat(chars, length).Select(s => s[random.Next(s.Length)]).ToArray()); 46 | 47 | return random_id; 48 | } 49 | catch (Exception ex) 50 | { 51 | Logging.Error("Randomizer.Handler.Standard", "", ex.ToString()); 52 | return "1234567890"; 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Global/Helper/Randomizer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Security.Cryptography; 7 | 8 | namespace Global.Helper 9 | { 10 | public class Randomizer 11 | { 12 | public static async Task Generate_Access_Key(int length) 13 | { 14 | string ValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 15 | 16 | try 17 | { 18 | using (var rng = new RNGCryptoServiceProvider()) 19 | { 20 | byte[] randomBytes = new byte[length]; 21 | rng.GetBytes(randomBytes); 22 | 23 | StringBuilder stringBuilder = new StringBuilder(length); 24 | foreach (byte b in randomBytes) 25 | { 26 | stringBuilder.Append(ValidChars[b % ValidChars.Length]); 27 | } 28 | 29 | return stringBuilder.ToString(); 30 | } 31 | } 32 | catch (Exception ex) 33 | { 34 | Logging.Error("Randomizer.Handler.Generate_Access_Key", "", ex.Message); 35 | return string.Empty; 36 | } 37 | } 38 | 39 | public static string Standard(int length) 40 | { 41 | try 42 | { 43 | Random random = new Random(); 44 | const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; 45 | string random_id = new string(Enumerable.Repeat(chars, length).Select(s => s[random.Next(s.Length)]).ToArray()); 46 | 47 | return random_id; 48 | } 49 | catch (Exception ex) 50 | { 51 | Logging.Error("Randomizer.Handler.Standard", "", ex.ToString()); 52 | return "1234567890"; 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /NetLock-RMM-Server/HWID_System/winid.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Management; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | 7 | namespace _x101.HWID_System 8 | { 9 | internal class WindowsId 10 | { 11 | [System.Reflection.ObfuscationAttribute(Feature = "Virtualization", Exclude = false)] 12 | 13 | public static string GetWindowsId() 14 | { 15 | try 16 | { 17 | string cpuId = GetHardwareId("Win32_Processor", "ProcessorId"); 18 | string biosSerial = GetHardwareId("Win32_BIOS", "SerialNumber"); 19 | string motherboardSerial = GetHardwareId("Win32_BaseBoard", "SerialNumber"); 20 | string diskSerial = GetHardwareId("Win32_DiskDrive", "SerialNumber"); 21 | 22 | // Combine identifiers 23 | string combinedId = $"{cpuId}{biosSerial}{motherboardSerial}{diskSerial}"; 24 | 25 | // Generate MD5 hash 26 | using (var md5 = MD5.Create()) 27 | { 28 | byte[] hashBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(combinedId)); 29 | return BitConverter.ToString(hashBytes).Replace("-", ""); 30 | } 31 | } 32 | catch 33 | { 34 | return "Unknown"; 35 | } 36 | } 37 | 38 | private static string GetHardwareId(string wmiClass, string wmiProperty) 39 | { 40 | try 41 | { 42 | using (var searcher = new ManagementObjectSearcher($"SELECT {wmiProperty} FROM {wmiClass}")) 43 | { 44 | return searcher.Get() 45 | .Cast() 46 | .Select(mo => mo[wmiProperty]?.ToString()) 47 | .FirstOrDefault() ?? ""; 48 | } 49 | } 50 | catch 51 | { 52 | return ""; 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/HWID_System/winid.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Management; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | 7 | namespace _x101.HWID_System 8 | { 9 | internal class WindowsId 10 | { 11 | [System.Reflection.ObfuscationAttribute(Feature = "Virtualization", Exclude = false)] 12 | 13 | public static string GetWindowsId() 14 | { 15 | try 16 | { 17 | string cpuId = GetHardwareId("Win32_Processor", "ProcessorId"); 18 | string biosSerial = GetHardwareId("Win32_BIOS", "SerialNumber"); 19 | string motherboardSerial = GetHardwareId("Win32_BaseBoard", "SerialNumber"); 20 | string diskSerial = GetHardwareId("Win32_DiskDrive", "SerialNumber"); 21 | 22 | // Combine identifiers 23 | string combinedId = $"{cpuId}{biosSerial}{motherboardSerial}{diskSerial}"; 24 | 25 | // Generate MD5 hash 26 | using (var md5 = MD5.Create()) 27 | { 28 | byte[] hashBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(combinedId)); 29 | return BitConverter.ToString(hashBytes).Replace("-", ""); 30 | } 31 | } 32 | catch 33 | { 34 | return "Unknown"; 35 | } 36 | } 37 | 38 | private static string GetHardwareId(string wmiClass, string wmiProperty) 39 | { 40 | try 41 | { 42 | using (var searcher = new ManagementObjectSearcher($"SELECT {wmiProperty} FROM {wmiClass}")) 43 | { 44 | return searcher.Get() 45 | .Cast() 46 | .Select(mo => mo[wmiProperty]?.ToString()) 47 | .FirstOrDefault() ?? ""; 48 | } 49 | } 50 | catch 51 | { 52 | return ""; 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/HWID_System/winid.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Management; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | 7 | namespace _x101.HWID_System 8 | { 9 | internal class WindowsId 10 | { 11 | [System.Reflection.ObfuscationAttribute(Feature = "Virtualization", Exclude = false)] 12 | 13 | public static string GetWindowsId() 14 | { 15 | try 16 | { 17 | string cpuId = GetHardwareId("Win32_Processor", "ProcessorId"); 18 | string biosSerial = GetHardwareId("Win32_BIOS", "SerialNumber"); 19 | string motherboardSerial = GetHardwareId("Win32_BaseBoard", "SerialNumber"); 20 | string diskSerial = GetHardwareId("Win32_DiskDrive", "SerialNumber"); 21 | 22 | // Combine identifiers 23 | string combinedId = $"{cpuId}{biosSerial}{motherboardSerial}{diskSerial}"; 24 | 25 | // Generate MD5 hash 26 | using (var md5 = MD5.Create()) 27 | { 28 | byte[] hashBytes = md5.ComputeHash(Encoding.UTF8.GetBytes(combinedId)); 29 | return BitConverter.ToString(hashBytes).Replace("-", ""); 30 | } 31 | } 32 | catch 33 | { 34 | return "Unknown"; 35 | } 36 | } 37 | 38 | private static string GetHardwareId(string wmiClass, string wmiProperty) 39 | { 40 | try 41 | { 42 | using (var searcher = new ManagementObjectSearcher($"SELECT {wmiProperty} FROM {wmiClass}")) 43 | { 44 | return searcher.Get() 45 | .Cast() 46 | .Select(mo => mo[wmiProperty]?.ToString()) 47 | .FirstOrDefault() ?? ""; 48 | } 49 | } 50 | catch 51 | { 52 | return ""; 53 | } 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/Windows/Helper/Sas_Diagnostics.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Security.Principal; 4 | using System.Runtime.InteropServices; 5 | 6 | namespace NetLock_RMM_User_Process.Windows.Helper 7 | { 8 | internal class Sas_Diagnostics 9 | { 10 | [DllImport("kernel32.dll")] 11 | static extern uint WTSGetActiveConsoleSessionId(); 12 | 13 | [DllImport("wtsapi32.dll", SetLastError = true)] 14 | static extern bool WTSQueryUserToken(uint SessionId, out nint phToken); 15 | 16 | public static void LogContext() 17 | { 18 | uint sessionId = WTSGetActiveConsoleSessionId(); 19 | Handler.Debug("Windows.Helper.ScreenControl.Sas_Diagnostics.LogContext", "LogContext", $"ActiveConsoleSessionId: {sessionId}"); 20 | Console.WriteLine($"[SAS] ActiveConsoleSessionId = {sessionId}"); 21 | 22 | bool isElevated = new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); 23 | Handler.Debug("Windows.Helper.ScreenControl.Sas_Diagnostics.LogContext", "LogContext", $"IsElevated/Administrator: {isElevated}"); 24 | Console.WriteLine($"[SAS] IsElevated/Administrator = {isElevated}"); 25 | 26 | bool isLocalSystem = WindowsIdentity.GetCurrent().Name.Equals("NT AUTHORITY\\SYSTEM", StringComparison.OrdinalIgnoreCase); 27 | Handler.Debug("Windows.Helper.ScreenControl.Sas_Diagnostics.LogContext", "LogContext", $"IsLocalSystem: {isLocalSystem}"); 28 | Console.WriteLine($"[SAS] Running as LocalSystem = {isLocalSystem}"); 29 | 30 | bool gotToken = WTSQueryUserToken(sessionId, out var userToken); 31 | Handler.Debug("Windows.Helper.ScreenControl.Sas_Diagnostics.LogContext", "LogContext", $"WTSQueryUserToken({sessionId}) -> {gotToken}"); 32 | Console.WriteLine($"[SAS] WTSQueryUserToken({sessionId}) -> {gotToken}"); 33 | if (gotToken) CloseHandle(userToken); 34 | } 35 | 36 | [DllImport("kernel32.dll", SetLastError = true)] 37 | static extern bool CloseHandle(nint hObject); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Global/Helper/Base64.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | 8 | namespace Global.Helper 9 | { 10 | internal class Base64 11 | { 12 | public static async Task Encode(string content) 13 | { 14 | byte[] data = Encoding.UTF8.GetBytes(content); 15 | return await Task.Run(() => Convert.ToBase64String(data)); 16 | } 17 | 18 | public static async Task Decode(string encodedContent) 19 | { 20 | try 21 | { 22 | byte[] data = Convert.FromBase64String(encodedContent); 23 | return await Task.Run(() => Encoding.UTF8.GetString(data)); 24 | } 25 | catch (Exception ex) 26 | { 27 | //Logging.Handler.Error("Base64.Handler.Decode", "", ex.Message); 28 | return ""; 29 | } 30 | } 31 | 32 | public static string Decode_Syncron(string encodedContent) 33 | { 34 | try 35 | { 36 | byte[] data = Convert.FromBase64String(encodedContent); 37 | return Encoding.UTF8.GetString(data); 38 | } 39 | catch (Exception ex) 40 | { 41 | //Logging.Handler.Error("Base64.Handler.Decode", "", ex.Message); 42 | return ""; 43 | } 44 | } 45 | 46 | 47 | /*public static void Write_File(string path, string base64) 48 | { 49 | try 50 | { 51 | File.WriteAllText(path, DecodeAsync(base64)); 52 | } 53 | catch (Exception ex) 54 | { 55 | Logging.Handler.Error("Helper.Base64.Write_File", "failed", "Details: " + Environment.NewLine + 56 | "Path: " + path + Environment.NewLine + 57 | "Base64: " + base64 + Environment.NewLine + 58 | "Error: " + ex.Message); 59 | } 60 | }*/ 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Devices/Dialogs/Remote_File_Browser/Create_Directory_Dialog.razor: -------------------------------------------------------------------------------- 1 | @using MySqlConnector; 2 | @using System.Data.Common; 3 | @using System.Text.Json; 4 | @using System.Security.Claims 5 | 6 | @inject NavigationManager NavigationManager 7 | @inject ILocalStorageService localStorage 8 | @inject IDialogService DialogService 9 | @inject ISnackbar Snackbar 10 | @inject IJSRuntime JSRuntime 11 | @inject IStringLocalizer Localizer 12 | @inject AuthenticationStateProvider AuthenticationStateProvider 13 | 14 | 15 | 16 | @Localizer["title"] 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @Localizer["confirm"] 26 | 27 | 28 | 29 | @code { 30 | 31 | [CascadingParameter] IMudDialogInstance MudDialog { get; set; } 32 | 33 | private string directory = String.Empty; 34 | 35 | protected override async Task OnInitializedAsync() 36 | { 37 | // Get the current user from the authentication state 38 | var user = (await AuthenticationStateProvider.GetAuthenticationStateAsync()).User; 39 | 40 | // Check if user is authenticated 41 | if (user?.Identity is not { IsAuthenticated: true }) 42 | { 43 | NavigationManager.NavigateTo("/login", true); 44 | return; 45 | } 46 | } 47 | 48 | private async Task OK() 49 | { 50 | this.Snackbar.Configuration.ShowCloseIcon = true; 51 | this.Snackbar.Configuration.PositionClass = Defaults.Classes.Position.BottomRight; 52 | 53 | this.MudDialog.Close(DialogResult.Ok(directory)); 54 | } 55 | 56 | private void Cancel() => MudDialog.Cancel(); 57 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Devices/Dialogs/Remote_File_Browser/Rename_File_Dialog.razor: -------------------------------------------------------------------------------- 1 | @using MySqlConnector; 2 | @using System.Data.Common; 3 | @using System.Text.Json; 4 | @using System.Security.Claims 5 | 6 | @inject NavigationManager NavigationManager 7 | @inject ILocalStorageService localStorage 8 | @inject IDialogService DialogService 9 | @inject ISnackbar Snackbar 10 | @inject IJSRuntime JSRuntime 11 | @inject IStringLocalizer Localizer 12 | @inject AuthenticationStateProvider AuthenticationStateProvider 13 | 14 | 15 | 16 | @Localizer["title"] 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @Localizer["confirm"] 26 | 27 | 28 | 29 | @code { 30 | 31 | [CascadingParameter] IMudDialogInstance MudDialog { get; set; } 32 | [Parameter] public string _remote_file_path { get; set; } 33 | 34 | protected override async Task OnInitializedAsync() 35 | { 36 | // Get the current user from the authentication state 37 | var user = (await AuthenticationStateProvider.GetAuthenticationStateAsync()).User; 38 | 39 | // Check if user is authenticated 40 | if (user?.Identity is not { IsAuthenticated: true }) 41 | { 42 | NavigationManager.NavigateTo("/login", true); 43 | return; 44 | } 45 | } 46 | 47 | private async Task OK() 48 | { 49 | this.Snackbar.Configuration.ShowCloseIcon = true; 50 | this.Snackbar.Configuration.PositionClass = Defaults.Classes.Position.BottomRight; 51 | 52 | this.MudDialog.Close(DialogResult.Ok(_remote_file_path)); 53 | } 54 | 55 | private void Cancel() => MudDialog.Cancel(); 56 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Devices/Dialogs/Remote_File_Browser/Move_Directory_Dialog.razor: -------------------------------------------------------------------------------- 1 | @using MySqlConnector; 2 | @using System.Data.Common; 3 | @using System.Text.Json; 4 | @using System.Security.Claims 5 | 6 | @inject NavigationManager NavigationManager 7 | @inject ILocalStorageService localStorage 8 | @inject IDialogService DialogService 9 | @inject ISnackbar Snackbar 10 | @inject IJSRuntime JSRuntime 11 | @inject IStringLocalizer Localizer 12 | @inject AuthenticationStateProvider AuthenticationStateProvider 13 | 14 | 15 | 16 | @Localizer["title"] 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @Localizer["confirm"] 26 | 27 | 28 | 29 | @code { 30 | 31 | [CascadingParameter] IMudDialogInstance MudDialog { get; set; } 32 | [Parameter] public string _remote_file_path { get; set; } 33 | 34 | protected override async Task OnInitializedAsync() 35 | { 36 | // Get the current user from the authentication state 37 | var user = (await AuthenticationStateProvider.GetAuthenticationStateAsync()).User; 38 | 39 | // Check if user is authenticated 40 | if (user?.Identity is not { IsAuthenticated: true }) 41 | { 42 | NavigationManager.NavigateTo("/login", true); 43 | return; 44 | } 45 | } 46 | 47 | private async Task OK() 48 | { 49 | this.Snackbar.Configuration.ShowCloseIcon = true; 50 | this.Snackbar.Configuration.PositionClass = Defaults.Classes.Position.BottomRight; 51 | 52 | this.MudDialog.Close(DialogResult.Ok(_remote_file_path)); 53 | } 54 | 55 | private void Cancel() => MudDialog.Cancel(); 56 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Devices/Dialogs/Remote_File_Browser/Rename_Directory_Dialog.razor: -------------------------------------------------------------------------------- 1 | @using MySqlConnector; 2 | @using System.Data.Common; 3 | @using System.Text.Json; 4 | @using System.Security.Claims 5 | 6 | @inject NavigationManager NavigationManager 7 | @inject ILocalStorageService localStorage 8 | @inject IDialogService DialogService 9 | @inject ISnackbar Snackbar 10 | @inject IJSRuntime JSRuntime 11 | @inject IStringLocalizer Localizer 12 | @inject AuthenticationStateProvider AuthenticationStateProvider 13 | 14 | 15 | 16 | @Localizer["title"] 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @Localizer["confirm"] 26 | 27 | 28 | 29 | @code { 30 | 31 | [CascadingParameter] IMudDialogInstance MudDialog { get; set; } 32 | [Parameter] public string _remote_file_path { get; set; } 33 | 34 | protected override async Task OnInitializedAsync() 35 | { 36 | // Get the current user from the authentication state 37 | var user = (await AuthenticationStateProvider.GetAuthenticationStateAsync()).User; 38 | 39 | // Check if user is authenticated 40 | if (user?.Identity is not { IsAuthenticated: true }) 41 | { 42 | NavigationManager.NavigateTo("/login", true); 43 | return; 44 | } 45 | } 46 | 47 | private async Task OK() 48 | { 49 | this.Snackbar.Configuration.ShowCloseIcon = true; 50 | this.Snackbar.Configuration.PositionClass = Defaults.Classes.Position.BottomRight; 51 | 52 | this.MudDialog.Close(DialogResult.Ok(_remote_file_path)); 53 | } 54 | 55 | private void Cancel() => MudDialog.Cancel(); 56 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Devices/Dialogs/Remote_File_Browser/Result_Dialog.razor: -------------------------------------------------------------------------------- 1 | @using MySqlConnector; 2 | @using System.Data.Common; 3 | @using System.Text.Json; 4 | @using System.Security.Claims 5 | 6 | @inject NavigationManager NavigationManager 7 | @inject ILocalStorageService localStorage 8 | @inject IDialogService DialogService 9 | @inject ISnackbar Snackbar 10 | @inject IJSRuntime JSRuntime 11 | @inject IStringLocalizer Localizer 12 | @inject AuthenticationStateProvider AuthenticationStateProvider 13 | 14 | 15 | 16 | @Localizer["title"] 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @Localizer["close"] 26 | 27 | 28 | 29 | @code { 30 | 31 | [CascadingParameter] IMudDialogInstance MudDialog { get; set; } 32 | 33 | [Parameter] public string result { get; set; } 34 | 35 | protected override async Task OnInitializedAsync() 36 | { 37 | // Get the current user from the authentication state 38 | var user = (await AuthenticationStateProvider.GetAuthenticationStateAsync()).User; 39 | 40 | // Check if user is authenticated 41 | if (user?.Identity is not { IsAuthenticated: true }) 42 | { 43 | NavigationManager.NavigateTo("/login", true); 44 | return; 45 | } 46 | } 47 | 48 | private async Task OK() 49 | { 50 | this.Snackbar.Configuration.ShowCloseIcon = true; 51 | this.Snackbar.Configuration.PositionClass = Defaults.Classes.Position.BottomRight; 52 | 53 | this.MudDialog.Close(DialogResult.Ok("success")); 54 | } 55 | 56 | private void Cancel() => MudDialog.Cancel(); 57 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Devices/Dialogs/Remote_File_Browser/Move_File_Dialog.razor: -------------------------------------------------------------------------------- 1 | @using MySqlConnector; 2 | @using System.Data.Common; 3 | @using System.Text.Json; 4 | @using System.Security.Claims 5 | 6 | @inject NavigationManager NavigationManager 7 | @inject ILocalStorageService localStorage 8 | @inject IDialogService DialogService 9 | @inject ISnackbar Snackbar 10 | @inject IJSRuntime JSRuntime 11 | @inject IStringLocalizer Localizer 12 | @inject AuthenticationStateProvider AuthenticationStateProvider 13 | 14 | 15 | 16 | @Localizer["title"] 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | @Localizer["confirm"] 26 | 27 | 28 | 29 | @code { 30 | 31 | [CascadingParameter] IMudDialogInstance MudDialog { get; set; } 32 | [Parameter] public string _remote_file_path { get; set; } 33 | 34 | protected override async Task OnInitializedAsync() 35 | { 36 | // Get the current user from the authentication state 37 | var user = (await AuthenticationStateProvider.GetAuthenticationStateAsync()).User; 38 | 39 | // Check if user is authenticated 40 | if (user?.Identity is not { IsAuthenticated: true }) 41 | { 42 | NavigationManager.NavigateTo("/login", true); 43 | return; 44 | } 45 | } 46 | 47 | private async Task OK() 48 | { 49 | this.Snackbar.Configuration.ShowCloseIcon = true; 50 | this.Snackbar.Configuration.PositionClass = Defaults.Classes.Position.BottomRight; 51 | 52 | this.MudDialog.Close(DialogResult.Ok(_remote_file_path)); 53 | } 54 | 55 | private void Cancel() => MudDialog.Cancel(); 56 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Devices/Dialogs/Bulk_Remote_Shell/Bulk_Remote_Shell_Result_Dialog.razor: -------------------------------------------------------------------------------- 1 | @inject ISnackbar Snackbar 2 | @inject IJSRuntime JSRuntime 3 | 4 | 5 | 6 | 7 | 8 | @DeviceName - Output 9 | 10 | 11 | 12 | @if (HasError) 13 | { 14 | 15 | Execution failed or returned an error 16 | 17 | } 18 | 19 | 20 |
@Output
21 |
22 | 23 | 28 | Copy to Clipboard 29 | 30 |
31 | 32 | Close 33 | 34 |
35 | 36 | @code { 37 | [CascadingParameter] IMudDialogInstance MudDialog { get; set; } 38 | 39 | [Parameter] public string DeviceName { get; set; } 40 | [Parameter] public string Output { get; set; } 41 | [Parameter] public bool HasError { get; set; } 42 | 43 | private async Task CopyToClipboard() 44 | { 45 | try 46 | { 47 | await JSRuntime.InvokeVoidAsync("navigator.clipboard.writeText", Output); 48 | Snackbar.Add("Output copied to clipboard", Severity.Success); 49 | } 50 | catch (Exception) 51 | { 52 | Snackbar.Add("Failed to copy to clipboard", Severity.Error); 53 | } 54 | } 55 | 56 | private void Close() 57 | { 58 | MudDialog.Close(); 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Application_Paths.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace NetLock_RMM_Web_Console 4 | { 5 | public class Application_Paths 6 | { 7 | //public static string logs_dir = @"C:\ProgramData\0x101 Cyber Security\NetLock RMM\Web Console\Logs"; 8 | public static string logs_dir = Path.Combine(GetBasePath(), "0x101 Cyber Security", "NetLock RMM", "Web Console", "Logs"); 9 | 10 | public static string _private_files_devices = "devices"; 11 | 12 | public static string internal_dir = Path.Combine(GetCurrentDirectory(), "internal"); 13 | public static string internal_temp_dir = Path.Combine(GetCurrentDirectory(), "internal", "temp"); 14 | 15 | public static string internal_recordings_dir = Path.Combine(GetCurrentDirectory(), "internal", "recordings"); 16 | 17 | //OSSCH_START fb852d6a-6bb3-477c-bea9-e0a25606a2e5 //OSSCH_END 18 | 19 | public static string certificates_path = Path.Combine(GetCurrentDirectory(), "certificates"); 20 | 21 | private static string GetBasePath() 22 | { 23 | if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) 24 | { 25 | return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData); 26 | } 27 | else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && Application_Settings.IsLiveEnvironment) 28 | { 29 | return "/var"; 30 | } 31 | else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && !Application_Settings.IsLiveEnvironment) 32 | { 33 | return "/home/nico-mak/.local/share"; 34 | } 35 | else 36 | { 37 | throw new NotSupportedException("Unsupported OS"); 38 | } 39 | } 40 | 41 | private static string GetCurrentDirectory() 42 | { 43 | return AppContext.BaseDirectory; 44 | } 45 | 46 | //public static string debug_txt_path = @"C:\ProgramData\0x101 Cyber Security\NetLock RMM\Web Console\debug.txt"; 47 | 48 | //URLs 49 | public static string redirect_path = "/redirect"; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/MySQL/Config.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | 3 | namespace NetLock_RMM_Server.MySQL 4 | { 5 | public class Config 6 | { 7 | public string Server { get; set; } 8 | public int Port { get; set; } 9 | public string Database { get; set; } 10 | public string User { get; set; } 11 | public string Password { get; set; } 12 | public string SslMode { get; set; } 13 | public string AdditionalConnectionParameters { get; set; } 14 | 15 | public class MySQL 16 | { 17 | public string Server { get; set; } 18 | public int Port { get; set; } 19 | public string Database { get; set; } 20 | public string User { get; set; } 21 | public string Password { get; set; } 22 | public string SslMode { get; set; } 23 | public string AdditionalConnectionParameters { get; set; } 24 | 25 | } 26 | 27 | public class RootData 28 | { 29 | public MySQL MySQL { get; set; } 30 | } 31 | 32 | // Read appsettings.json file and get mysql database name 33 | public static async Task Get_Database_Name() 34 | { 35 | try 36 | { 37 | // Read appssettings.json file 38 | string json = await File.ReadAllTextAsync("appsettings.json"); 39 | 40 | //Logging.Handler.Debug("Classes.MySQL.MySQLConfig.Get_Database_Name", "json", json); 41 | 42 | // Deserialize JSON string 43 | RootData rootData = JsonSerializer.Deserialize(json); 44 | 45 | // Get MySQL configuration 46 | string database = rootData.MySQL.Database; 47 | 48 | // Return MySQL configuration 49 | //Logging.Handler.Debug("Classes.MySQL.MySQLConfig.Get_Database_Name", "database", database); 50 | return database; 51 | } 52 | catch (Exception ex) 53 | { 54 | Logging.Handler.Error("Classes.MySQL.MySQLConfig.Get_Database_Name", "General error", ex.ToString()); 55 | return String.Empty; 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Helper/Base64.cs: -------------------------------------------------------------------------------- 1 | using System.Text; 2 | 3 | namespace Base64 4 | { 5 | internal class Handler 6 | { 7 | public static async Task Encode(string content) 8 | { 9 | byte[] data = Encoding.UTF8.GetBytes(content); 10 | return await Task.Run(() => Convert.ToBase64String(data)); 11 | } 12 | 13 | /*public static async Task EncodeUtf16LE(string content) 14 | { 15 | byte[] data = Encoding.Unicode.GetBytes(content); // UTF-16 LE statt UTF-8 16 | return await Task.Run(() => Convert.ToBase64String(data)); 17 | }*/ 18 | 19 | public static async Task Decode(string encodedContent) 20 | { 21 | try 22 | { 23 | byte[] data = Convert.FromBase64String(encodedContent); 24 | return await Task.Run(() => Encoding.UTF8.GetString(data)); 25 | } 26 | catch (Exception ex) 27 | { 28 | //Logging.Handler.Error("Base64.Handler.Decode", "", ex.Message); 29 | return ""; 30 | } 31 | } 32 | 33 | public static string Decode_Syncron(string encodedContent) 34 | { 35 | try 36 | { 37 | byte[] data = Convert.FromBase64String(encodedContent); 38 | return Encoding.UTF8.GetString(data); 39 | } 40 | catch (Exception ex) 41 | { 42 | //Logging.Handler.Error("Base64.Handler.Decode", "", ex.Message); 43 | return ""; 44 | } 45 | } 46 | 47 | 48 | /*public static void Write_File(string path, string base64) 49 | { 50 | try 51 | { 52 | File.WriteAllText(path, DecodeAsync(base64)); 53 | } 54 | catch (Exception ex) 55 | { 56 | Logging.Handler.Error("Helper.Base64.Write_File", "failed", "Details: " + Environment.NewLine + 57 | "Path: " + path + Environment.NewLine + 58 | "Base64: " + base64 + Environment.NewLine + 59 | "Error: " + ex.Message); 60 | } 61 | }*/ 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/appsettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "Logging": { 3 | "LogLevel": { 4 | "Default": "Warning", 5 | "Microsoft": "Error", 6 | "Microsoft.Hosting.Lifetime": "Warning", 7 | "Microsoft.AspNetCore.SignalR": "Error", 8 | "Microsoft.AspNetCore.Http.Connections": "Error" 9 | }, 10 | "Custom": { 11 | "Enabled": true, 12 | "VerbosityLevel": 0 13 | } 14 | }, 15 | "AllowedHosts": "*", 16 | "Kestrel": { 17 | "Endpoint": { 18 | "Http": { 19 | "Enabled": true, 20 | "Port": 7080 21 | }, 22 | "Https": { 23 | "Enabled": false, 24 | "Port": 7443, 25 | "Force": true, 26 | "Hsts": { 27 | "Enabled": true 28 | }, 29 | "Certificate": { 30 | "Path": "/path/to/certificates/certificate.pfx", 31 | "Password": "your-cert-password" 32 | } 33 | } 34 | }, 35 | "Limits": { 36 | "MaxConcurrentConnections": 2000, 37 | "MaxConcurrentUpgradedConnections": 2000, 38 | "MaxRequestBodySize": 10737418240, 39 | "KeepAliveTimeout": 120 40 | }, 41 | "Roles": { 42 | "Comm": true, 43 | "Update": true, 44 | "Trust": true, 45 | "Remote": true, 46 | "Notification": true, 47 | "File": true, 48 | "LLM": true 49 | } 50 | }, 51 | "SignalR": { 52 | "MaximumReceiveMessageSize": 102400000, 53 | "ClientTimeoutInterval": 120, 54 | "KeepAliveInterval": 15, 55 | "HandshakeTimeout": 30, 56 | "EnableDetailedErrors": true, 57 | "StreamBufferCapacity": 20, 58 | "MaximumParallelInvocationsPerClient": 5, 59 | "MaxConnectionAttempts": 5, 60 | "ConnectionAttemptDelayMs": 5000 61 | }, 62 | "MySQL": { 63 | "Server": "127.0.0.1", 64 | "Port": 3306, 65 | "Database": "netlock", 66 | "User": "root", 67 | "Password": "Bochum234", 68 | "SslMode": "None", 69 | "AdditionalConnectionParameters": "" 70 | }, 71 | "Members_Portal_Api": { 72 | "Enabled": true, 73 | "Cloud": true, 74 | "ApiKeyOverride": "2b77005b-61a3-4fa8-83c9-5b9f3621f758-ba910728-1b53-4cb5-9159-3eb4140a2eed", 75 | "ServerGuid": "Test-Guid" 76 | }, 77 | "Environment": { 78 | "Docker": false 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/Application_Paths.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Runtime.InteropServices; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace NetLock_RMM_User_Process 9 | { 10 | internal class Application_Paths 11 | { 12 | public static string application_data_debug_txt = Path.Combine(GetBasePath_CommonApplicationData(), "NetLock RMM User Process", "debug.txt"); 13 | public static string application_data_logs = Path.Combine(GetBasePath_CommonApplicationData(), "NetLock RMM User Process", "Logs"); 14 | 15 | private static string GetBasePath_CommonApplicationData() 16 | { 17 | if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) 18 | { 19 | return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData); 20 | } 21 | else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) 22 | { 23 | return "/var"; 24 | } 25 | else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) 26 | { 27 | return "/Library/Application Support"; 28 | } 29 | else if (OperatingSystem.IsMacOS()) 30 | { 31 | return "/Library/Application Support"; 32 | } 33 | else 34 | { 35 | throw new NotSupportedException("Unsupported OS"); 36 | } 37 | } 38 | 39 | private static string GetBasePath_ProgramFiles() 40 | { 41 | if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) 42 | { 43 | return Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); 44 | } 45 | else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) 46 | { 47 | return "/usr"; 48 | } 49 | else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) 50 | { 51 | return "/Applications"; 52 | } 53 | else if (OperatingSystem.IsMacOS()) 54 | { 55 | return "/Applications"; 56 | } 57 | else 58 | { 59 | throw new NotSupportedException("Unsupported OS"); 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /NetLock-RMM-Server/Helper/Notifications/Telegram.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using MySqlConnector; 3 | using System.Data.Common; 4 | using System.Net; 5 | using Telegram.Bot; 6 | using NetLock_RMM_Server.Configuration; 7 | 8 | namespace Helper.Notifications 9 | { 10 | public class Telegram 11 | { 12 | public static async Task Send_Message(string id, string message) 13 | { 14 | string bot_token = String.Empty; 15 | string chat_id = String.Empty; 16 | 17 | MySqlConnection conn = new MySqlConnection(MySQL.Connection_String); 18 | 19 | try 20 | { 21 | await conn.OpenAsync(); 22 | 23 | MySqlCommand command = new MySqlCommand("SELECT * FROM telegram_notifications WHERE id = @id;", conn); 24 | command.Parameters.AddWithValue("@id", id); 25 | 26 | using (DbDataReader reader = await command.ExecuteReaderAsync()) 27 | { 28 | if (reader.HasRows) 29 | { 30 | while (await reader.ReadAsync()) 31 | { 32 | bot_token = reader["bot_token"].ToString() ?? String.Empty; 33 | chat_id = reader["chat_id"].ToString() ?? String.Empty; 34 | } 35 | } 36 | } 37 | } 38 | catch (Exception ex) 39 | { 40 | Logging.Handler.Error("Classes.Helper.Notifications.Telegram", "Send_Message.Query_Connector_Info", ex.ToString()); 41 | } 42 | finally 43 | { 44 | await conn.CloseAsync(); 45 | } 46 | 47 | //Send message 48 | try 49 | { 50 | var botClient = new TelegramBotClient(bot_token); 51 | var messageText = message; 52 | 53 | await botClient.SendMessage(chat_id, messageText); 54 | 55 | return true; 56 | } 57 | catch (Exception ex) 58 | { 59 | Logging.Handler.Error("Classes.Helper.Notifications.Telegram", "Send_Message.Send", "status_code: " + ex.ToString()); 60 | return false; 61 | } 62 | 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Classes/Helper/Notifications/Telegram.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Http; 2 | using MySqlConnector; 3 | using System.Data.Common; 4 | using System.Net; 5 | using Telegram.Bot; 6 | 7 | namespace NetLock_RMM_Web_Console.Classes.Helper.Notifications 8 | { 9 | public class Telegram 10 | { 11 | public static async Task Send_Message(string id, string message) 12 | { 13 | string bot_token = String.Empty; 14 | string chat_id = String.Empty; 15 | 16 | MySqlConnection conn = new MySqlConnection(Configuration.MySQL.Connection_String); 17 | 18 | try 19 | { 20 | await conn.OpenAsync(); 21 | 22 | MySqlCommand command = new MySqlCommand("SELECT * FROM telegram_notifications WHERE id = @id;", conn); 23 | command.Parameters.AddWithValue("@id", id); 24 | 25 | using (DbDataReader reader = await command.ExecuteReaderAsync()) 26 | { 27 | if (reader.HasRows) 28 | { 29 | while (await reader.ReadAsync()) 30 | { 31 | bot_token = reader["bot_token"].ToString() ?? String.Empty; 32 | chat_id = reader["chat_id"].ToString() ?? String.Empty; 33 | } 34 | } 35 | } 36 | } 37 | catch (Exception ex) 38 | { 39 | Logging.Handler.Error("Classes.Helper.Notifications.Telegram", "Send_Message.Query_Connector_Info", ex.Message); 40 | } 41 | finally 42 | { 43 | conn.Close(); 44 | } 45 | 46 | //Send message 47 | try 48 | { 49 | var botClient = new TelegramBotClient(bot_token); 50 | var messageText = message; 51 | 52 | await botClient.SendMessage(chat_id, messageText); 53 | 54 | return "success"; 55 | } 56 | catch (Exception ex) 57 | { 58 | Logging.Handler.Error("Classes.Helper.Notifications.Telegram", "Send_Message.Send", "status_code: " + ex.Message); 59 | return ex.Message; 60 | } 61 | 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /NetLock RMM Agent Remote/Windows/Helper/ScreenControl/Sas_Diagnostics.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Diagnostics; 3 | using System.Security.Principal; 4 | using System.Runtime.InteropServices; 5 | using Global.Helper; 6 | 7 | namespace Windows.Helper.ScreenControl 8 | { 9 | internal class Sas_Diagnostics 10 | { 11 | [DllImport("kernel32.dll")] 12 | static extern uint WTSGetActiveConsoleSessionId(); 13 | 14 | [DllImport("wtsapi32.dll", SetLastError = true)] 15 | static extern bool WTSQueryUserToken(uint SessionId, out IntPtr phToken); 16 | 17 | 18 | public static void LogContext() 19 | { 20 | try 21 | { 22 | uint sessionId = WTSGetActiveConsoleSessionId(); 23 | Logging.Debug("Windows.Helper.ScreenControl.Sas_Diagnostics.LogContext", "LogContext", $"ActiveConsoleSessionId: {sessionId}"); 24 | Console.WriteLine($"[SAS] ActiveConsoleSessionId = {sessionId}"); 25 | 26 | bool isElevated = new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator); 27 | Logging.Debug("Windows.Helper.ScreenControl.Sas_Diagnostics.LogContext", "LogContext", $"IsElevated/Administrator: {isElevated}"); 28 | Console.WriteLine($"[SAS] IsElevated/Administrator = {isElevated}"); 29 | 30 | bool isLocalSystem = WindowsIdentity.GetCurrent().Name.Equals("NT AUTHORITY\\SYSTEM", StringComparison.OrdinalIgnoreCase); 31 | Logging.Debug("Windows.Helper.ScreenControl.Sas_Diagnostics.LogContext", "LogContext", $"IsLocalSystem: {isLocalSystem}"); 32 | Console.WriteLine($"[SAS] Running as LocalSystem = {isLocalSystem}"); 33 | 34 | bool gotToken = WTSQueryUserToken(sessionId, out var userToken); 35 | Logging.Debug("Windows.Helper.ScreenControl.Sas_Diagnostics.LogContext", "LogContext", $"WTSQueryUserToken({sessionId}) -> {gotToken}"); 36 | Console.WriteLine($"[SAS] WTSQueryUserToken({sessionId}) -> {gotToken}"); 37 | if (gotToken) Kernel32.CloseHandle(userToken); 38 | } 39 | catch (Exception ex) 40 | { 41 | Logging.Error("Windows.Helper.ScreenControl.Sas_Diagnostics.LogContext", "General error", ex.ToString()); 42 | 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /NetLock-RMM-User-Process/MacOS/ScreenCaptureMacOS.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Drawing.Imaging; 3 | using System.Drawing; 4 | using System.IO; 5 | using NetLock_RMM_User_Process; 6 | 7 | public class ScreenCaptureMacOS 8 | { 9 | /// 10 | /// This code was just playing around. It's not used in the project. In Q3 I will revisit this and try to realize screen capturing through native MacOS APIs. Connected with the planned Support Mode. 11 | /// 12 | /// 13 | /// 14 | public static async Task CaptureScreenToBase64(int screenIndex) 15 | { 16 | try 17 | { 18 | // Screenshot-Pfad 19 | string screenshotPath = "screenshot.png"; 20 | 21 | // Screenshot mit Terminal-Befehl aufnehmen 22 | string command = $"screencapture '{screenshotPath}'"; 23 | string output = MacOS.Helper.Zsh.Execute_Script("test", false, command); 24 | 25 | Console.WriteLine($"Screenshot command output: {output}"); 26 | 27 | // Überprüfen, ob das Screenshot erstellt wurde 28 | if (!File.Exists(screenshotPath)) 29 | { 30 | Console.WriteLine("Screenshot not found."); 31 | return null; 32 | } 33 | 34 | // Screenshot als Base64 kodieren 35 | byte[] screenshotBytes = await File.ReadAllBytesAsync(screenshotPath); 36 | string base64Screenshot = Convert.ToBase64String(screenshotBytes); 37 | 38 | return base64Screenshot; 39 | } 40 | catch (Exception ex) 41 | { 42 | Console.WriteLine($"Error capturing screen: {ex.ToString()}"); 43 | return null; 44 | } 45 | } 46 | 47 | private static ImageCodecInfo GetEncoder(ImageFormat format) 48 | { 49 | try 50 | { 51 | ImageCodecInfo[] codecs = ImageCodecInfo.GetImageDecoders(); 52 | foreach (ImageCodecInfo codec in codecs) 53 | { 54 | if (codec.FormatID == format.Guid) 55 | { 56 | return codec; 57 | } 58 | } 59 | return null; 60 | } 61 | catch (Exception ex) 62 | { 63 | Console.WriteLine($"Error getting encoder: {ex.ToString()}"); 64 | return null; 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Devices/Dialogs/Remote_Control/Code_Signing_Warning_Dialog.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Code Signing Not Available 5 | 6 | Your Windows agents are not digitally signed. This may cause issues with unattended access, UAC dialogs, 7 | or applications running with administrator privileges. These limitations are enforced by Microsoft as a 8 | security measure when code signing is missing. 9 | 10 | 11 | 12 | 13 | If you experience such issues, consider upgrading to one of our paid plans, which include code signing. 14 | 15 | 16 | 17 | 18 | 19 | 20 | Available from Tier 1 for professional deployments 21 | 22 | 23 | 24 | Code signed Windows agents 25 | No UAC warnings 26 | Trusted by Windows 27 | Full administrator privileges 28 | 29 | 30 | 31 | Continue Anyway 32 | 33 | View Pricing 34 | 35 | 36 | 37 | 38 | @code { 39 | [CascadingParameter] IMudDialogInstance MudDialog { get; set; } = null!; 40 | 41 | private void Cancel() 42 | { 43 | MudDialog.Close(DialogResult.Ok(false)); 44 | } 45 | 46 | private void ViewPricing() 47 | { 48 | MudDialog.Close(DialogResult.Ok(true)); 49 | } 50 | } 51 | 52 | -------------------------------------------------------------------------------- /NetLock RMM Agent Health/Global/Helper/IO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Security.Cryptography; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Global.Helper 10 | { 11 | internal class IO 12 | { 13 | public static string Get_SHA512(string FilePath) 14 | { 15 | try 16 | { 17 | using (FileStream stream = File.OpenRead(FilePath)) 18 | { 19 | SHA512Managed sha512 = new SHA512Managed(); 20 | byte[] checksum_sha512 = sha512.ComputeHash(stream); 21 | string hash = BitConverter.ToString(checksum_sha512).Replace("-", String.Empty); 22 | 23 | Logging.Debug("Helper.IO.Get_SHA512", "hash", hash); 24 | 25 | return hash; 26 | } 27 | } 28 | catch (Exception ex) 29 | { 30 | Logging.Error("Helper.IO.Get_SHA512", "General error", ex.ToString()); 31 | return ex.Message; 32 | } 33 | } 34 | 35 | public static void Delete_File(string path) 36 | { 37 | try 38 | { 39 | if (File.Exists(path)) 40 | File.Delete(path); 41 | 42 | Logging.Debug("Helper.IO.Delete_File", "Deleted file.", path); 43 | } 44 | catch (Exception ex) 45 | { 46 | Logging.Error("Helper.IO.Delete_File", "Delete file failed: " + path, ex.ToString()); 47 | Console.WriteLine("[" + DateTime.Now + "] - [Helper.IO.Delete_File] -> Delete file failed: " + ex.Message); 48 | } 49 | } 50 | 51 | public static void Delete_Directory(string path) 52 | { 53 | try 54 | { 55 | if (Directory.Exists(path)) 56 | Directory.Delete(path, true); 57 | 58 | Logging.Debug("Helper.IO.Delete_Directory", "Deleted directory.", path); 59 | } 60 | catch (Exception ex) 61 | { 62 | Logging.Error("Helper.IO.Delete_Directory", "Delete directory failed: " + path, ex.ToString()); 63 | Console.WriteLine("[" + DateTime.Now + "] - [Helper.IO.Delete_Directory] -> Delete directory failed: " + ex.Message); 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /NetLock RMM Agent Installer/Helper/IO.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Security.Cryptography; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace Helper 10 | { 11 | internal class IO 12 | { 13 | public static string Get_SHA512(string FilePath) 14 | { 15 | try 16 | { 17 | using (FileStream stream = File.OpenRead(FilePath)) 18 | { 19 | SHA512Managed sha512 = new SHA512Managed(); 20 | byte[] checksum_sha512 = sha512.ComputeHash(stream); 21 | string hash = BitConverter.ToString(checksum_sha512).Replace("-", String.Empty); 22 | 23 | Logging.Handler.Debug("Helper.IO.Get_SHA512", "hash", hash); 24 | 25 | return hash; 26 | } 27 | } 28 | catch (Exception ex) 29 | { 30 | Logging.Handler.Error("Helper.IO.Get_SHA512", "General error", ex.ToString()); 31 | return ex.Message; 32 | } 33 | } 34 | 35 | public static void Delete_File(string path) 36 | { 37 | try 38 | { 39 | if (File.Exists(path)) 40 | File.Delete(path); 41 | 42 | Logging.Handler.Debug("Helper.IO.Delete_File", "Deleted file.", path); 43 | } 44 | catch (Exception ex) 45 | { 46 | Logging.Handler.Error("Helper.IO.Delete_File", "Delete file failed: " + path, ex.ToString()); 47 | Console.WriteLine("[" + DateTime.Now + "] - [Helper.IO.Delete_File] -> Delete file failed: " + ex.Message); 48 | } 49 | } 50 | 51 | public static void Delete_Directory(string path) 52 | { 53 | try 54 | { 55 | if (Directory.Exists(path)) 56 | Directory.Delete(path, true); 57 | 58 | Logging.Handler.Debug("Helper.IO.Delete_Directory", "Deleted directory.", path); 59 | } 60 | catch (Exception ex) 61 | { 62 | Logging.Handler.Error("Helper.IO.Delete_Directory", "Delete directory failed: " + path, ex.ToString()); 63 | Console.WriteLine("[" + DateTime.Now + "] - [Helper.IO.Delete_Directory] -> Delete directory failed: " + ex.Message); 64 | } 65 | } 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Tenants/Export_Data_Dialog.razor: -------------------------------------------------------------------------------- 1 | @using MySqlConnector; 2 | @using System.Data.Common; 3 | @using System.Text.Json; 4 | @using System.Security.Claims 5 | 6 | @inject NavigationManager NavigationManager 7 | @inject ILocalStorageService localStorage 8 | @inject IDialogService DialogService 9 | @inject ISnackbar Snackbar 10 | @inject IJSRuntime JSRuntime 11 | @inject IStringLocalizer Localizer 12 | @inject AuthenticationStateProvider AuthenticationStateProvider 13 | 14 | 15 | 16 | @Localizer["export_data"] 17 | 18 | 19 | @Localizer["text"] 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | @Localizer["cancel"] 30 | @Localizer["export"] 31 | 32 | 33 | 34 | @code { 35 | 36 | private string type = string.Empty; 37 | 38 | [CascadingParameter] 39 | private IMudDialogInstance MudDialog { get; set; } = default!; 40 | 41 | private bool Form_Valid() 42 | { 43 | if (String.IsNullOrEmpty(type)) 44 | return true; 45 | else 46 | return false; 47 | } 48 | 49 | protected override async Task OnInitializedAsync() 50 | { 51 | // Get the current user from the authentication state 52 | var user = (await AuthenticationStateProvider.GetAuthenticationStateAsync()).User; 53 | 54 | // Check if user is authenticated 55 | if (user?.Identity is not { IsAuthenticated: true }) 56 | { 57 | NavigationManager.NavigateTo("/login", true); 58 | return; 59 | } 60 | } 61 | 62 | private void OK() 63 | { 64 | this.MudDialog.Close(DialogResult.Ok(type)); 65 | } 66 | 67 | private void Cancel() => MudDialog.Cancel(); 68 | } -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | ## Latest Release 4 | 5 | ### ⚠️ Important Notice 6 | 7 | **Breaking Changes:** 8 | - All agents must be updated to the latest version for remote access to function properly 9 | - Review and update your policies to enable remote capabilities in agent settings 10 | - The new tray icon must be enabled in policy settings for attended remote access 11 | 12 | ### ✨ New Features 13 | 14 | #### User Tray Icon 15 | - Introduced fully customizable tray icon for enhanced user engagement 16 | - Added new remote access experience with user-controlled accept/decline functionality 17 | - Administrator-controlled remote access behavior through policy settings 18 | - Ideal for situations requiring confidentiality and user consent 19 | 20 | #### Device Labels 21 | - New device labels provide clearer device overview 22 | - Automation policy preview shows which policies are applied to each device 23 | 24 | #### Shutdown & Reboot Actions 25 | - Quick shutdown and reboot actions added 26 | - Direct device control without navigating through remote shell → script selection → execution 27 | 28 | #### Agent Policy Controls 29 | - Configure device synchronization frequency with server 30 | - Override global auto-update settings per assigned policy 31 | - Enable or disable specific remote features per policy 32 | - Enable or disable entire remote service per policy 33 | - Policy settings are managed directly by remote devices (requires policy sync) 34 | - Define unattended access permissions or require user confirmation before connection 35 | 36 | ### 🔧 Improvements 37 | 38 | - **Remote Agent Service:** Complete overhaul of connection behavior 39 | - Automatic connection re-establishment after system reboot when network connectivity is restored 40 | - Fixed edge cases where security programs could silently block connections 41 | 42 | - **User Session Tracking:** Last active user now correctly reflects RDP sessions 43 | 44 | - **Linux Software Inventory:** Added support for additional package managers: 45 | - Yum 46 | - Zypper 47 | - Pacman 48 | - DNF 49 | 50 | - **Remote Screen Control:** Performance optimizations 51 | - Reduced CPU resource usage 52 | - ~33% reduction in bandwidth consumption 53 | - Noticeable performance improvements 54 | 55 | - **Agent Installer:** Added support for hidden and no-log parameters 56 | 57 | - Various small tweaks and improvements 58 | 59 | ### 💬 Feedback 60 | 61 | We value your feedback! Please share your experience to help us continue improving NetLock RMM. 62 | 63 | --- 64 | 65 | *Release Date: December 7, 2025* 66 | -------------------------------------------------------------------------------- /NetLock RMM Agent Comm/Windows/Helper/Service.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.ServiceProcess; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | using Global.Helper; 8 | 9 | namespace Windows.Helper 10 | { 11 | internal class Service 12 | { 13 | public static bool Start(string name) 14 | { 15 | try 16 | { 17 | Logging.Debug("Windows.Helper.Start", "Starting service.", name); 18 | Console.WriteLine("[" + DateTime.Now + "] - [Windows.Helper.Start] -> Starting service: " + name); 19 | 20 | ServiceController sc = new ServiceController(name); 21 | sc.Start(); 22 | sc.WaitForStatus(ServiceControllerStatus.Running); 23 | 24 | Logging.Debug("Windows.Helper.Start", "Starting service.", "Done."); 25 | Console.WriteLine("[" + DateTime.Now + "] - [Windows.Helper.Start] -> Starting service: Done."); 26 | 27 | return true; 28 | } 29 | catch (Exception ex) 30 | { 31 | Logging.Error("Windows.Helper.Start", "Starting service failed: " + name, ex.ToString()); 32 | Console.WriteLine("[" + DateTime.Now + "] - [Windows.Helper.Start] -> Starting service failed: " + ex.Message); 33 | return false; 34 | } 35 | } 36 | 37 | public static bool Stop(string name) 38 | { 39 | try 40 | { 41 | Logging.Debug("Windows.Helper.Stop", "Stop service.", name); 42 | Console.WriteLine("[" + DateTime.Now + "] - [Mode: Fix] -> Stopping service: " + name); 43 | 44 | ServiceController sc = new ServiceController(name); 45 | sc.Stop(); 46 | sc.WaitForStatus(ServiceControllerStatus.Stopped); 47 | 48 | Logging.Debug("Windows.Helper.Stop", "Stop service.", "Done."); 49 | Console.WriteLine("[" + DateTime.Now + "] - [Mode: Fix] -> Stop service: Done."); 50 | 51 | return true; 52 | } 53 | catch (Exception ex) 54 | { 55 | Logging.Error("Windows.Helper.Stop", "Stopping service failed: " + name, ex.ToString()); 56 | Console.WriteLine("[" + DateTime.Now + "] - [Windows.Helper.Stop] -> Stopping service failed: " + ex.Message); 57 | return false; 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /NetLock RMM Agent Installer/Helper/Service.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.ServiceProcess; 5 | using System.Text; 6 | using System.Threading.Tasks; 7 | 8 | namespace Helper 9 | { 10 | internal class Service 11 | { 12 | public static bool Start(string name) 13 | { 14 | try 15 | { 16 | Logging.Handler.Debug("Helper.Service.Start", "Starting service.", name); 17 | Console.WriteLine("[" + DateTime.Now + "] - [Helper.Service.Start] -> Starting service: " + name); 18 | 19 | ServiceController sc = new ServiceController(name); 20 | sc.Start(); 21 | sc.WaitForStatus(ServiceControllerStatus.Running); 22 | 23 | Logging.Handler.Debug("Helper.Service.Start", "Starting service.", "Done."); 24 | Console.WriteLine("[" + DateTime.Now + "] - [Helper.Service.Start] -> Starting service: Done."); 25 | 26 | return true; 27 | } 28 | catch (Exception ex) 29 | { 30 | Logging.Handler.Error("Helper.Service.Start", "Starting service failed: " + name, ex.ToString()); 31 | Console.WriteLine("[" + DateTime.Now + "] - [Helper.Service.Start] -> Starting service failed: " + ex.Message); 32 | return false; 33 | } 34 | } 35 | 36 | public static bool Stop(string name) 37 | { 38 | try 39 | { 40 | Logging.Handler.Debug("Helper.Service.Stop", "Stop service.", name); 41 | Console.WriteLine("[" + DateTime.Now + "] - [Mode: Fix] -> Stopping service: " + name); 42 | 43 | ServiceController sc = new ServiceController(name); 44 | sc.Stop(); 45 | sc.WaitForStatus(ServiceControllerStatus.Stopped); 46 | 47 | Logging.Handler.Debug("Helper.Service.Stop", "Stop service.", "Done."); 48 | Console.WriteLine("[" + DateTime.Now + "] - [Mode: Fix] -> Stop service: Done."); 49 | 50 | return true; 51 | } 52 | catch (Exception ex) 53 | { 54 | Logging.Handler.Error("Helper.Service.Stop", "Stopping service failed: " + name, ex.ToString()); 55 | Console.WriteLine("[" + DateTime.Now + "] - [Helper.Service.Stop] -> Stopping service failed: " + ex.Message); 56 | return false; 57 | } 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/Pages/Policies/Dialogs/Export_Data_Dialog.razor: -------------------------------------------------------------------------------- 1 | @using MySqlConnector; 2 | @using System.Data.Common; 3 | @using System.Text.Json; 4 | @using System.Security.Claims 5 | 6 | @inject NavigationManager NavigationManager 7 | @inject ILocalStorageService localStorage 8 | @inject IDialogService DialogService 9 | @inject ISnackbar Snackbar 10 | @inject IJSRuntime JSRuntime 11 | @inject IStringLocalizer Localizer 12 | @inject AuthenticationStateProvider AuthenticationStateProvider 13 | 14 | 15 | 16 | @Localizer["export_data"] 17 | 18 | 19 | @Localizer["text"] 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | @Localizer["cancel"] 30 | @Localizer["export"] 31 | 32 | 33 | 34 | @code { 35 | 36 | private string type = string.Empty; 37 | 38 | [CascadingParameter] 39 | private IMudDialogInstance MudDialog { get; set; } = default!; 40 | 41 | private bool Form_Valid() 42 | { 43 | if (String.IsNullOrEmpty(type)) 44 | return true; 45 | else 46 | return false; 47 | } 48 | 49 | protected override async Task OnInitializedAsync() 50 | { 51 | // Get the current user from the authentication state 52 | var user = (await AuthenticationStateProvider.GetAuthenticationStateAsync()).User; 53 | 54 | // Check if user is authenticated 55 | if (user?.Identity is not { IsAuthenticated: true }) 56 | { 57 | NavigationManager.NavigateTo("/login", true); 58 | return; 59 | } 60 | } 61 | 62 | private void OK() 63 | { 64 | this.MudDialog.Close(DialogResult.Ok(type)); 65 | } 66 | 67 | private void Cancel() => MudDialog.Cancel(); 68 | } -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/Components/App.razor: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | NetLock RMM - Web Console 18 | 19 | 20 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /NetLock-RMM-Web-Console/NetLock RMM Web Console.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | net9.0 5 | enable 6 | enable 7 | $(MSBuildProjectName.Replace(" ", "_")) 8 | $(AssemblyName.Replace(' ', '_')) 9 | $(AssemblyName) 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | --------------------------------------------------------------------------------