{"id":208155,"date":"2023-12-06T08:00:11","date_gmt":"2023-12-06T08:00:11","guid":{"rendered":"https:\/\/www.ninjaone.com\/script-hub\/rilevare-un-software-di-accesso-remoto-con-powershell-2\/"},"modified":"2024-03-05T16:40:18","modified_gmt":"2024-03-05T16:40:18","slug":"rilevare-un-software-di-accesso-remoto-con-powershell-2__trashed","status":"publish","type":"script_hub","link":"https:\/\/www.ninjaone.com\/it\/script-hub\/rilevare-un-software-di-accesso-remoto-con-powershell-2__trashed\/","title":{"rendered":"Come rilevare un software di accesso remoto su un sistema utilizzando PowerShell"},"content":{"rendered":"<p>Con l&#8217;aumento del lavoro da remoto e l&#8217;adozione diffusa delle tecnologie cloud, garantire la sicurezza degli endpoint \u00e8 diventato fondamentale per i professionisti IT di tutto il mondo. <strong>Poter rilevare un software di accesso remoto<\/strong> \u00e8 una preoccupazione crescente, poich\u00e9 spesso uno strumento di questo tipo pu\u00f2 essere il punto di ingresso per entit\u00e0 dannose.<\/p>\n<h2>Background<\/h2>\n<p>Gli strumenti di accesso remoto (RAT) esistono da tempo. Se da un lato possono essere estremamente utili per la risoluzione dei problemi e le attivit\u00e0 amministrative in remoto, dall&#8217;altro possono essere sfruttati da criminali informatici per ottenere un accesso non autorizzato ai sistemi. Capire come rilevare un software di accesso remoto su un sistema \u00e8 fondamentale per i professionisti IT e i <a href=\"https:\/\/www.ninjaone.com\/what-is-an-msp\/\">Managed Service Provider (MSP)<\/a>. Sono loro a rappresentare la prima linea di difesa contro potenziali violazioni della sicurezza e accessi non autorizzati ai dati.<\/p>\n<h2>Lo script per rilevare un software di accesso remoto<\/h2>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"powershell\">#Requires -Version 5.1\r\n\r\n&lt;#\r\n.SYNOPSIS\r\n    This script will look for remote access tools installed on the system. It can be given a list of tools to ignore as well as grab the exclusion list from a designated custom field.\r\n    \r\n    DISCLAIMER: This script is provided as a best effort for detecting remote access software installed on an agent, but it is not guaranteed to be 100% accurate. \r\n    Some remote access software may not be detected, or false positives may be reported. Use this script at your own risk and verify its results with other methods where possible.\r\n.DESCRIPTION\r\n    This script will look for remote access tools installed on the system. Below is the full list of tools. Please note you can give it a list of tools to ignore and you can have\r\n    it grab the list from a custom field of your choosing.\r\n\r\n    DISCLAIMER: This script is provided as a best effort for detecting remote access software installed on an agent, but it is not guaranteed to be 100% accurate. \r\n    Some remote access software may not be detected, or false positives may be reported. Use this script at your own risk and verify its results with other methods where possible.\r\n\r\n    Remote Tools: AeroAdmin, Ammyy Admin, AnyDesk, BeyondTrust, Chrome Remote Desktop, Connectwise Control, DWService, GoToMyPC, LiteManager, LogMeIn, ManageEngine,\r\n    NoMachine, Parsec, Remote Utilities, RemotePC, Splashtop, Supremo, TeamViewer, TightVNC, UltraVNC, VNC Connect (RealVNC), Zoho Assist\r\n    RMM's: Atera, Automate, Datto RMM, Kaseya, N-Able N-Central, N-Able N-Sight, Syncro\r\n\r\n.EXAMPLE\r\n    (No Parameters)\r\n    Name                    CurrentlyRunning    HasRunningService   UninstallString\r\n    ----                    ----------------    -----------------   ---------------\r\n    Connectwise Control     Yes                 Yes                 MsiExec \/X{examplestring}\r\n    Chrome Remote Desktop   Yes                 Yes                 MsiExec \/X{examplestring}\r\n\r\nPARAMETER: -ExcludeTools \"Chrome Remote Desktop,Connectwise Control\"\r\n    A comma seperated list of tools you'd like to exclude from alerting on.\r\n.EXAMPLE\r\n    -ExcludeTools \"Chrome Remote Desktop,Connectwise Control\"\r\n    We couldn't find any active remote access tools!\r\n\r\nPARAMETER: -ExclusionsFromCustomField \"ReplaceMeWithAnyTextCustomField\"\r\n    The name of a custom field that contains a comma seperated list of tools to exclude from alerting. ex. \"ApprovedRemoteTools\"\r\n.EXAMPLE\r\n    -ExclusionsFromCustomField \"ReplaceMeWithAnyTextCustomField\"\r\n    We couldn't find any active remote access tools!\r\n\r\nPARAMETER: -ExportCSV \"ReplaceMeWithAnyMultiLineCustomField\"\r\n    The name of a multiline custom field to export to in csv format. ex. \"RemoteTools\"\r\n.EXAMPLE\r\n    -ExportCSV \"ReplaceMeWithAnyMultiLineCustomField\"\r\n    Name                    CurrentlyRunning    HasRunningService   UninstallString\r\n    ----                    ----------------    -----------------   ---------------\r\n    Connectwise Control     Yes                 Yes                 MsiExec \/X{examplestring}\r\n    Chrome Remote Desktop   Yes                 Yes                 MsiExec \/X{examplestring}\r\n\r\nPARAMETER: -ExportJSON \"ReplaceMeWithAnyMultiLineCustomField\"\r\n    The name of a multiline custom field to export to in JSON format. ex. \"RemoteTools\"\r\n.EXAMPLE\r\n    -ExportJSON \"ReplaceMeWithAnyMultiLineCustomField\"\r\n    Name                    CurrentlyRunning    HasRunningService   UninstallString\r\n    ----                    ----------------    -----------------   ---------------\r\n    Connectwise Control     Yes                 Yes                 MsiExec \/X{examplestring}\r\n    Chrome Remote Desktop   Yes                 Yes                 MsiExec \/X{examplestring}\r\n\r\nPARAMETER: -ShowNotFound\r\n    Show the tools the script did not find as well.\r\n.EXAMPLE\r\n    -ShowNotFound\r\n    Name                    CurrentlyRunning    HasRunningService   UninstallString\r\n    ----                    ----------------    -----------------   ---------------\r\n    AeroAdmin               No                  No\r\n    Ammyy Admin             No                  No\r\n    BeyondTrust             No                  No\r\n    Connectwise Control     Yes                 Yes                 MsiExec \/X{examplestring}\r\n    Chrome Remote Desktop   Yes                 Yes                 MsiExec \/X{examplestring}\r\n    \r\n.OUTPUTS\r\n    None\r\n.NOTES\r\n    General notes: CustomFields must be multiline for export. Regular text is fine for ExclusionsFromCustomField\r\n    Release notes:\r\n    Initial Release\r\nBy using this script, you indicate your acceptance of the following legal terms as well as our Terms of Use at https:\/\/www.ninjaone.com\/terms-of-use.\r\n    Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms. \r\n    Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party. \r\n    Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library or website belonging to or under the control of any other software provider. \r\n    Warranty Disclaimer: The script is provided \u201cas is\u201d and \u201cas available\u201d, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations. \r\n    Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks. \r\n    Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script. \r\n    EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).\r\n#&gt;\r\n\r\n[CmdletBinding()]\r\nparam (\r\n    [Parameter()]\r\n    [String]$ExcludeTools,\r\n    [Parameter()]\r\n    [String]$ExclusionsFromCustomField,\r\n    [Parameter()]\r\n    [String]$ExportCSV,\r\n    [Parameter()]\r\n    [String]$ExportJSON,\r\n    [Parameter()]\r\n    [Switch]$ShowNotFound\r\n    &lt;#\r\n        ## ParameterName Requirement DefaultValue Type Options Description ##\r\n        ExcludeTools Optional none TEXT Comma seperated list of tools you would not like to look for.\r\n        ExclusionsFromCustomField Optional none TEXT Name of custom field you would like to grab exclusions from.\r\n        ExportCSV Optional none TEXT Name of multi-line custom field you would like to export results to. It will export them in csv format.\r\n        ExportJSON Optional none TEXT Name of multi-line custom field you would like to export results to. It will export them in json format.\r\n        ShowNotFound Optional false CHECKBOX Show results even if it didn't find that specific tool.\r\n    #&gt;\r\n)\r\n\r\nbegin {\r\n    #DISCLAIMER: This script is provided as a best effort for detecting remote access software installed on an agent, but it is not guaranteed to be 100% accurate. \r\n    #Some remote access software may not be detected, or false positives may be reported. Use this script at your own risk and verify its results with other methods where possible.\r\n\r\n    # Check's the two Uninstall registry keys to see if the app is installed. Needs the name as it would appear in Control Panel.\r\n    function Find-UninstallKey {\r\n        [CmdletBinding()]\r\n        param (\r\n            [Parameter(ValueFromPipeline)]\r\n            [String]$DisplayName,\r\n            [Parameter()]\r\n            [Switch]$UninstallString\r\n        )\r\n        process {\r\n            $UninstallList = New-Object System.Collections.Generic.List[Object]\r\n\r\n            $Result = Get-ChildItem HKLM:SoftwareWow6432NodeMicrosoftWindowsCurrentVersionUninstall* | Get-ItemProperty | \r\n            Where-Object { $_.DisplayName -like \"*$DisplayName*\" }\r\n\r\n            if($Result){ $UninstallList.Add($Result) }\r\n\r\n            $Result = Get-ChildItem HKLM:SoftwareMicrosoftWindowsCurrentVersionUninstall* | Get-ItemProperty | \r\n            Where-Object { $_.DisplayName -like \"*$DisplayName*\" }\r\n\r\n            if($Result){ $UninstallList.Add($Result) }\r\n\r\n            # Programs don't always have an uninstall string listed here so to account for that I made this optional.\r\n            if ($UninstallString) {\r\n                # 64 Bit\r\n                $UninstallList | Select-Object -ExpandProperty UninstallString -ErrorAction Ignore\r\n            }\r\n            else {\r\n                $UninstallList\r\n            }\r\n        }\r\n    }\r\n\r\n    # This will see if the process is currently active. Some people may want to react sooner to these alerts if its currently running vs not.\r\n    function Find-Process {\r\n        [CmdletBinding()]\r\n        param(\r\n            [Parameter(ValueFromPipeline)]\r\n            [String]$Name\r\n        )\r\n        process {\r\n            Get-Process | Where-Object { $_.ProcessName -like \"*$Name*\" } | Select-Object -ExpandProperty Name\r\n        }\r\n    }\r\n\r\n    # This will search C:ProgramFiles and C:ProgramFiles(x86) for the executable these tools use to run.\r\n    function Find-Executable {\r\n        [CmdletBinding()]\r\n        param(\r\n            [Parameter(ValueFromPipeline)]\r\n            [String]$Path,\r\n            [Parameter()]\r\n            [Switch]$Special\r\n        )\r\n        process {\r\n            if(!$Special){\r\n                if (Test-Path \"$env:ProgramFiles$Path\") {\r\n                    \"$env:ProgramFiles$Path\"\r\n                }\r\n        \r\n                if (Test-Path \"${Env:ProgramFiles(x86)}$Path\") {\r\n                    \"${Env:ProgramFiles(x86)}$Path\"\r\n                }\r\n    \r\n                if (Test-Path \"$env:ProgramData$Path\") {\r\n                    \"$env:ProgramData$Path\"\r\n                }\r\n            }else{\r\n                if(Test-Path $Path){\r\n                    $Path\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    # Brought Get-CimInstance outside the function for better performance.\r\n\r\n    $ServiceList = Get-CimInstance win32_service\r\n    function Find-Service {\r\n        [CmdletBinding()]\r\n        param(\r\n            [Parameter(ValueFromPipeline)]\r\n            [String]$Name\r\n        )\r\n        process {\r\n            # Get-Service will display an error everytime it has an issue reading a service. Ignoring them as they're not relevant.\r\n            $ServiceList | Where-Object {$_.State -notlike \"Disabled\" -and $_.State -notlike \"Stopped\"} | \r\n            Where-Object {$_.PathName -Like \"*$Name.exe*\"}\r\n        }\r\n    }\r\n\r\n    function Export-CustomField {\r\n        [CmdletBinding()]\r\n        param(\r\n            [Parameter()]\r\n            [String]$Name,\r\n            [Parameter()]\r\n            [ValidateSet(\"csv\", \"json\")]\r\n            [String]$Format,\r\n            [Parameter()]\r\n            [PSCustomObject]$Object\r\n        )\r\n        if ($Format -eq \"csv\") {\r\n            $csv = $Object | ConvertTo-Csv -NoTypeInformation | Out-String\r\n            Ninja-Property-Set $Name $csv\r\n        }\r\n        else {\r\n            $json = $Object | ConvertTo-Json | Out-String\r\n            Ninja-Property-Set $Name $json\r\n        }\r\n    }\r\n\r\n    # This define's what tools we're looking for and how the script can find them. Some don't actually install anywhere (portable app) others do. \r\n    # Some change their installation path everytime so not particularly worth it to find it that way.\r\n    # Others store themselves in a super weird directory. Many don't list exactly where there .exe file is stored and suggest you exclude the whole folder from the av.\r\n    $RemoteToolList = @(\r\n        [PSCustomObject]@{Name = \"AeroAdmin\"; ProcessName = \"AeroAdmin\" }\r\n        [PSCustomObject]@{Name = \"Ammyy Admin\"; ProcessName = \"AA_v3\" }\r\n        [PSCustomObject]@{Name = \"AnyDesk\"; DisplayName = \"AnyDesk\"; ProcessName = \"AnyDesk\"; ExecutablePath = \"AnyDeskAnyDesk.exe\" }\r\n        [PSCustomObject]@{Name = \"BeyondTrust\"; DisplayName = \"Remote Support Jump Client\", \"Jumpoint\"; ProcessName = \"bomgar-jpt\" }\r\n        [PSCustomObject]@{Name = \"Chrome Remote Desktop\"; DisplayName = \"Chrome Remote Desktop Host\"; ProcessName = \"remoting_host\"; ExecutablePath = \"GoogleChrome Remote Desktop112.0.5615.26remoting_host.exe\" }\r\n        [PSCustomObject]@{Name = \"Connectwise Control\"; DisplayName = \"ScreenConnect Client\"; ProcessName = \"ScreenConnect.ClientService\" }\r\n        [PSCustomObject]@{Name = \"DWService\"; DisplayName = \"DWAgent\"; ProcessName = \"dwagent\",\"dwagsvc\"; ExecutablePath = \"DWAgentruntimedwagent.exe\" }\r\n        [PSCustomObject]@{Name = \"GoToMyPC\"; DisplayName = \"GoToMyPC\"; ProcessName = \"g2comm\", \"g2pre\", \"g2svc\", \"g2tray\"; ExecutablePath = \"GoToMyPCg2comm.exe\", \"GoToMyPCg2pre.exe\", \"GoToMyPCg2svc.exe\", \"GoToMyPCg2tray.exe\" }\r\n        [PSCustomObject]@{Name = \"LiteManager\"; DisplayName = \"LiteManager Pro - Server\"; ProcessName = \"ROMServer\", \"ROMFUSClient\"; ExecutablePath = \"LiteManager Pro - ServerROMFUSClient.exe\", \"LiteManager Pro - ServerROMServer.exe\" }\r\n        [PSCustomObject]@{Name = \"LogMeIn\"; DisplayName = \"LogMeIn\"; ProcessName = \"LogMeIn\"; ExecutablePath = \"LogMeInx64LogMeIn.exe\", \"LogMeInx64LogMeInSystray.exe\" }\r\n        [PSCustomObject]@{Name = \"ManageEngine\"; DisplayName = \"ManageEngine Remote Access Plus - Server\", \"ManageEngine UEMS - Agent\"; ProcessName = \"dcagenttrayicon\", \"UEMS\", \"dcagentservice\"; ExecutablePath = \"UEMS_Agentbindcagenttrayicon.exe\", \"UEMS_CentralServerbinUEMS.exe\", \"UEMS_Agentbindcagentservice.exe\" }\r\n        [PSCustomObject]@{Name = \"NoMachine\"; DisplayName = \"NoMachine\"; ProcessName = \"nxd\", \"nxnode.bin\", \"nxserver.bin\", \"nxservice64\"; ExecutablePath = \"NoMachinebinnxd.exe\", \"NoMachinebinnxnode.bin\", \"NoMachinebinnxserver.bin\", \"NoMachinebinnxservice64.exe\" }\r\n        [PSCustomObject]@{Name = \"Parsec\"; DisplayName = \"Parsec\"; ProcessName = \"parsecd\", \"pservice\"; ExecutablePath = \"Parsecparsecd.exe\", \"Parsecpservice.exe\" }\r\n        [PSCustomObject]@{Name = \"Remote Utilities\"; DisplayName = \"Remote Utilities - Host\"; ProcessName = \"rutserv\", \"rfusclient\"; ExecutablePath = \"Remote Utilities - Hostrfusclient.exe\" }\r\n        [PSCustomObject]@{Name = \"RemotePC\"; DisplayName = \"RemotePC\"; ProcessName = \"RemotePCHostUI\",\"RPCPerformanceService\"; ExecutablePath = \"RemotePC HostRemotePCHostUI.exe\", \"RemotePC HostRemotePCPerformanceRPCPerformanceService.exe\" }\r\n        [PSCustomObject]@{Name = \"Splashtop\"; DisplayName = \"Splashtop Streamer\"; ProcessName = \"SRAgent\", \"SRAppPB\", \"SRFeature\", \"SRManager\", \"SRService\"; ExecutablePath = \"SplashtopSplashtop RemoteServerSRService.exe\" }\r\n        [PSCustomObject]@{Name = \"Supremo\"; ProcessName = \"Supremo\", \"SupremoHelper\", \"SupremoService\"; ExecutablePath = \"SupremoSupremoService.exe\" }\r\n        [PSCustomObject]@{Name = \"TeamViewer\"; DisplayName = \"TeamViewer\"; ProcessName = \"TeamViewer\", \"TeamViewer_Service\", \"tv_w32\", \"tv_x64\"; ExecutablePath = \"TeamViewerTeamViewer.exe\", \"TeamViewerTeamViewer_Service.exe\", \"TeamViewertv_w32.exe\", \"TeamViewertv_x64.exe\" }\r\n        [PSCustomObject]@{Name = \"TightVNC\"; DisplayName = \"TightVNC\"; ProcessName = \"tvnserver\"; ExecutablePath = \"TightVNCtvnserver.exe\" }\r\n        [PSCustomObject]@{Name = \"UltraVNC\"; DisplayName = \"UltraVNC\"; ProcessName = \"winvnc\"; ExecutablePath = \"uvnc bvbaUltraVNCWinVNC.exe\" }\r\n        [PSCustomObject]@{Name = \"VNC Connect (RealVNC)\"; DisplayName = \"VNC Server\"; ProcessName = \"vncserver\"; ExecutablePath = \"RealVNCVNC Servervncserver.exe\" }\r\n        [PSCustomObject]@{Name = \"Zoho Assist\"; DisplayName = \"Zoho Assist Unattended Agent\"; ProcessName = \"ZohoURS\", \"ZohoURSService\"; ExecutablePath = \"ZohoMeetingUnAttendedZohoMeetingZohoURS.exe\", \"ZohoMeetingUnAttendedZohoMeetingZohoURSService.exe\" }\r\n        [PSCustomObject]@{Name = \"Atera\"; DisplayName = \"AteraAgent\"; ProcessName = \"AteraAgent\"; ExecutablePath = \"ATERA NetworksAteraAgentAteraAgent.exe\"}\r\n        [PSCustomObject]@{Name = \"Automate\"; DisplayName = \"Connectwise Automate\"; ProcessName = \"LTService\", \"LabTechService\"; SpecialExecutablePath = \"C:WindowsLTSvcLTSvc.exe\"}\r\n        [PSCustomObject]@{Name = \"Datto RMM\"; DisplayName = \"Datto RMM\"; ProcessName = \"AEMAgent\"; ExecutablePath = \"CentraStageAEMAgentAEMAgent.exe\", \"CentraStagegui.exe\"}\r\n        [PSCustomObject]@{Name = \"Kaseya\"; DisplayName = \"Kaseya Agent\"; ProcessName = \"AgentMon\", \"KaseyaRemoteControlHost\", \"Kasaya.AgentEndpoint\"; ExecutablePath = \"KaseyaAgentMonAgentMon.exe\"}\r\n        [PSCustomObject]@{Name = \"N-Able N-Central\"; DisplayName = \"Windows Agent\"; ProcessName = \"winagent\"; ExecutablePath = \"N-able TechnologiesWindows Agentwinagent.exe\"}\r\n        [PSCustomObject]@{Name = \"N-Able N-Sight\"; DisplayName = \"Advanced Monitoring Agent\"; ProcessName = \"winagent\"; ExecutablePath = \"Advanced Monitoring Agentwinagent.exe\", \"Advanced Monitoring Agent GPwinagent.exe\"}\r\n        [PSCustomObject]@{Name = \"Syncro\"; DisplayName = \"Syncro\",\"Kabuto\"; ProcessName = \"Syncro.App.Runner\", \"Kabuto.App.Runner\", \"Syncro.Service.Runner\", \"Kabuto.Service.Runner\", \"SyncroLive.Agent.Runner\", \"Kabuto.Agent.Runner\", \"SyncroLive.Agent.Service\", \"Syncro.Access.Service\", \"Syncro.Access.App\"; ExecutablePath = \"RepairTechSyncroSyncro.Service.Runner.exe\", \"RepairTechSyncroSyncro.App.Runner.exe\"}\r\n    )\r\n}\r\nprocess {\r\n\r\n    # Lets see what tools we don't want to alert on.\r\n    $ExcludedTools = New-Object System.Collections.Generic.List[String]\r\n\r\n    if ($ExcludeTools) {\r\n        $ExcludedTools.Add(($ExcludeTools.split(',')).Trim())\r\n    }\r\n\r\n    # Grabs the info we need from a textbox.\r\n    if ($env:ExcludeTools) {\r\n        $ExcludedTools.Add($env:ExcludeTools.split(','))\r\n    }\r\n\r\n    # For this kind of alert it might be worth it to create a whole custom field of ignorables.\r\n    if ($ExclusionsFromCustomField) {\r\n        $ExcludedTools.Add((Ninja-Property-Get $ExclusionsFromCustomField -split(',')).trim())\r\n    }\r\n\r\n    if ($env:ExclusionsFromCustomField) {\r\n        $ExcludedTools.Add((Ninja-Property-Get $env:ExclusionsFromCustomField -split(',')).trim())\r\n    }\r\n\r\n    if ($ExportCSV -or $Env:ExportCSV) {\r\n        $Format = \"csv\"\r\n\r\n        if ($ExportCSV) {\r\n            $ExportResults = $ExportCSV\r\n        }\r\n\r\n        if ($env:ExportCSV) {\r\n            $ExportResults = $env:ExportCSV\r\n        }\r\n    }elseif ($ExportJSON -or $env:ExportJSON) {\r\n        $Format = \"json\"\r\n\r\n        if ($ExportJSON) {\r\n            $ExportResults = $ExportJSON\r\n        }\r\n\r\n        if ($env:ExportJSON) {\r\n            $ExportResults = $env:ExportJSON\r\n        }\r\n    }\r\n\r\n    # This take's our list and begins searching by the 4 method's in the begin block. \r\n    $RemoteAccessTools = $RemoteToolList | ForEach-Object {\r\n\r\n        $UninstallKey = if ($_.DisplayName) {\r\n            $_.DisplayName | Find-UninstallKey\r\n        }\r\n        \r\n        $UninstallInfo = if ($_.DisplayName) {\r\n            $_.DisplayName | Find-UninstallKey -UninstallString\r\n        }\r\n        \r\n        $RunningStatus = if ($_.ProcessName) {\r\n            $_.ProcessName | Find-Process\r\n        }\r\n\r\n        $ServiceStatus = if($_.ProcessName) {\r\n            $_.ProcessName | Find-Service\r\n        }\r\n        \r\n        $InstallPath = if ($_.ExecutablePath) {\r\n            $_.ExecutablePath | Find-Executable\r\n        }elseif($_.SpecialExecutablePath){\r\n            $_.SpecialExecutablePath | Find-Executable -Special\r\n        }\r\n\r\n        if ($UninstallKey -or $RunningStatus -or $InstallPath -or $ServiceStatus) {\r\n            $Installed = \"Yes\"\r\n        }\r\n        else {\r\n            $Installed = \"No\"\r\n        }\r\n\r\n        [PSCustomObject]@{\r\n            Name              = $_.Name\r\n            Installed         = $Installed\r\n            CurrentlyRunning  = if ($RunningStatus) { \"Yes\" }else { \"No\" }\r\n            HasRunningService = if ($ServiceStatus) { \"Yes\" }else { \"No\" }\r\n            UninstallString   = $UninstallInfo\r\n            ExePath           = $InstallPath\r\n        } | Where-Object { $ExcludedTools -notcontains $_.Name }\r\n    }\r\n\r\n    $ActiveRemoteAccessTools = $RemoteAccessTools | Where-Object {$_.Installed -eq \"Yes\"}\r\n\r\n    # If we found anything in the three check's we're gonna indicate it's installed but we may also want to save our results to a custom field.\r\n    # We also may want to output more than \"We couldn't find any active remote access tools!\" in the event we find nothing.\r\n    if ($ShowNotFound -or $env:ShowNotFound) {\r\n\r\n        $RemoteAccessTools | Format-Table -Property Name, Installed, CurrentlyRunning, HasRunningService, UninstallString -AutoSize -Wrap | Out-String | Write-Host\r\n\r\n        if($ExportResults){\r\n            Export-CustomField -Name $ExportResults -Format $Format -Object ($RemoteAccessTools | Select-Object Name, Installed, CurrentlyRunning, HasRunningService)\r\n        }\r\n\r\n    }else{\r\n        if($ActiveRemoteAccessTools){\r\n\r\n            $ActiveRemoteAccessTools | Format-Table -Property Name, CurrentlyRunning, HasRunningService, UninstallString -AutoSize -Wrap | Out-String | Write-Host\r\n\r\n            if($ExportResults){\r\n                Export-CustomField -Name $ExportResults -Format $Format -Object ($ActiveRemoteAccessTools | Select-Object Name, CurrentlyRunning, HasRunningService)\r\n            }\r\n\r\n        }else{\r\n            Write-Host \"We couldn't find any active remote access tools!\"\r\n        }\r\n    }\r\n\r\n    if($ActiveRemoteAccessTools){\r\n        # We're going to set a failure status code in the event that we find something.\r\n        exit 1\r\n    }\r\n    else {\r\n        exit 0\r\n    }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n\n<div class=\"in-context-cta\"><p style=\"text-align: center;\">Accedi a oltre 700 script nel Dojo di NinjaOne<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.ninjaone.com\/it\/prova-gratuita\/\">Ottieni l&#8217;accesso<\/a><\/p>\n<\/div>\n<h2>Analisi dettagliata dello script per rilevare un software di accesso remoto<\/h2>\n<p>Rilevare un software di accesso remoto comporta alcune fasi indispensabili:<\/p>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"1\" data-aria-level=\"1\"><strong>Monitoraggio del traffico di rete<\/strong>: Lo script per rilevare un software di accesso remoto inizia monitorando il traffico di rete. Modelli insoliti o indirizzi IP sconosciuti possono essere degli indicatori.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"2\" data-aria-level=\"1\"><strong>Processi del sistema e attivit\u00e0<\/strong>: Il controllo regolare dei processi di sistema attivi pu\u00f2 aiutare a rilevare un software di accesso remoto non autorizzato. Qualsiasi processo non familiare richiede ulteriori indagini.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"3\" data-aria-level=\"1\"><strong>Verifica del software<\/strong>: Utilizzando strumenti di sistema integrati come &#8220;Task Manager&#8221; per Windows o &#8220;Monitoraggio attivit\u00e0&#8221; per macOS, \u00e8 possibile ottenere un elenco di tutte le applicazioni installate. La ricerca di software sconosciuto pu\u00f2 aiutare a rilevare un software di accesso remoto all&#8217;interno del sistema.<\/li>\n<\/ul>\n<h2>Casi d&#8217;uso potenziali<\/h2>\n<p>Immagina Alex, un professionista IT di un&#8217;azienda di medie dimensioni. Si accorge che la larghezza di banda di rete utilizzata aumenta durante le ore non lavorative. Dopo ulteriori indagini, individua un indirizzo IP sconosciuto che accede costantemente alla rete. Utilizzando gli strumenti di controllo del sistema, scopre un software di accesso remoto installato su diversi sistemi dell&#8217;ufficio che nessuno ricorda di aver installato. Identificando e rimuovendo questo software grazie allo script per rilevare un software di accesso remoto, Alex ha sventato una potenziale violazione dei dati.<\/p>\n<h2>Confronti<\/h2>\n<p>I metodi tradizionali per rilevare un software di accesso remoto includono verifiche manuali, controllo dei registri del firewall o controlli tramite un software antivirus. Anche se questi metodi possono essere efficaci, non sono infallibili. L&#8217;approccio dello script per rilevare un software di accesso remoto automatizza il processo di rilevamento, rendendolo completo ed efficiente in termini di tempo. Questo metodo proattivo pu\u00f2 spesso individuare RAT pi\u00f9 recenti e sofisticati che potrebbero eludere i metodi convenzionali.<\/p>\n<h2>Domande frequenti<\/h2>\n<ul>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"1\" data-aria-level=\"1\"><strong>Con quale frequenza \u00e8 necessario eseguire un controllo degli strumenti per l\u2019accesso remoto?<\/strong><br \/>\nRegolarmente, soprattutto se sei in un ambiente che installa e testa frequentemente nuovi software.<\/li>\n<li data-leveltext=\"\uf0b7\" data-font=\"Symbol\" data-listid=\"1\" data-list-defn-props=\"{&quot;335552541&quot;:1,&quot;335559684&quot;:-2,&quot;335559685&quot;:720,&quot;335559991&quot;:360,&quot;469769226&quot;:&quot;Symbol&quot;,&quot;469769242&quot;:[8226],&quot;469777803&quot;:&quot;left&quot;,&quot;469777804&quot;:&quot;\uf0b7&quot;,&quot;469777815&quot;:&quot;hybridMultilevel&quot;}\" data-aria-posinset=\"2\" data-aria-level=\"1\"><strong>Questo metodo di rilevamento pu\u00f2 identificare tutti i software di accesso remoto?<\/strong><br \/>\nPur essendo completo, nessun metodo \u00e8 infallibile. \u00c8 fondamentale combinare lo script per rilevare un software di accesso remoto con altri approcci per garantire una sicurezza solida.<\/li>\n<\/ul>\n<h2>Considerazioni finali<\/h2>\n<p>Non rilevare <a href=\"https:\/\/www.ninjaone.com\/it\/accesso-remoto\/\">un software di accesso remoto<\/a> pu\u00f2 portare a violazioni significative, al furto di dati o addirittura ad <a href=\"https:\/\/www.ninjaone.com\/it\/blog\/come-individuare-i-ransomware\/\">attacchi ransomware<\/a>. Con la migrazione online di un numero sempre maggiore di aziende, garantire la sicurezza di ogni endpoint diventa un compito fondamentale. Non prendere sul serio questo aspetto potrebbe avere ripercussioni finanziarie, operative e di reputazione.<\/p>\n","protected":false},"author":35,"featured_media":143984,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_relevanssi_hide_post":"","_relevanssi_hide_content":"","_relevanssi_pin_for_all":"","_relevanssi_pin_keywords":"","_relevanssi_unpin_keywords":"","_relevanssi_related_keywords":"","_relevanssi_related_include_ids":"","_relevanssi_related_exclude_ids":"","_relevanssi_related_no_append":"","_relevanssi_related_not_related":"","_relevanssi_related_posts":"","_relevanssi_noindex_reason":"","_lmt_disableupdate":"no","_lmt_disable":""},"operating_system":[],"use_cases":[4275],"class_list":["post-208155","script_hub","type-script_hub","status-publish","has-post-thumbnail","hentry","use_cases-configurazione-del-sistema"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/script_hub\/208155","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/script_hub"}],"about":[{"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/types\/script_hub"}],"author":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/users\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/comments?post=208155"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/media\/143984"}],"wp:attachment":[{"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/media?parent=208155"}],"wp:term":[{"taxonomy":"script_hub_category","embeddable":true,"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/operating_system?post=208155"},{"taxonomy":"use_cases","embeddable":true,"href":"https:\/\/www.ninjaone.com\/it\/wp-json\/wp\/v2\/use_cases?post=208155"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}