-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction1_data_source_remote_desktop.ps1
More file actions
51 lines (44 loc) · 2.77 KB
/
action1_data_source_remote_desktop.ps1
File metadata and controls
51 lines (44 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
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
$return = @()
$ignore = @('action1_agent.exe','system idle process','system','registry')
try{$data = Invoke-WebRequest -UseBasicParsing -Uri https://raw.githubusercontent.com/Action1Corp/Remote-Agent-Catalog/main/rmm.csv}
Catch{
$return = New-Object psobject -Property ([ordered]@{Message="Error downloading list: $($_). Scan aborted.";
Product="";
ProcessName="";
Version="";
PID="";
MD5Hash="";
A1_Key="default"})
}
if (-not ($data -eq $null)){
$products = (($data).Content | `
ConvertFrom-Csv) | `
select Software, Executables | `
Where-Object {$_.Executables -ne ''}
$processes = Get-WmiObject Win32_Process | Where-Object {-not ($ignore -contains $_.Name)}
Foreach ($process in $processes){
Foreach($product in $products){
$bins = $product.Executables -Split ','
foreach($bin in $bins){
if($process.Name -like $bin){
$return += New-Object psobject -Property ([ordered]@{Message="Found possible remote control application.";
Product=$product.Software;
ProcessName=$process.Name;
Version=(Get-Process -Id $process.ProcessId -FileVersionInfo).FileVersion;
PID=$process.ProcessId;
MD5Hash=(Get-FileHash -Path (Get-Process -Id $process.ProcessId -FileVersionInfo).FileName -Algorithm MD5).Hash;
A1_Key=$process.Name})
}
}
}
}
}
if($return.Length -eq 0){$return = New-Object psobject -Property ([ordered]@{Message="No remote control applications found.";
Product="";
ProcessName="";
Version="";
PID="";
MD5Hash="";
A1_Key="default"})
}
$return