-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Get-FSRM.ps1
34 lines (28 loc) · 1.13 KB
/
Get-FSRM.ps1
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
<#
.Synopsis
Get List of Ransomware filetypes from Public API
.DESCRIPTION
Function to public API https://fsrm.experiant.ca/ to call data
for use in FileSystem Resource Manager (FSRM) groups.
.EXAMPLE
Get-FSRM (No Parementers required)
#>
function Get-FSRM
{
Process {
$webClient = New-Object System.Net.WebClient
#Download JSON from API
$jsonStr = $webClient.DownloadString("https://fsrm.experiant.ca/api/v1/combined")
#Convert JSON to Custom Object
$Raw = ConvertFrom-Json $jsonStr #Contains api
#Add each file extension to an array for output
$monitoredextensions = @(ConvertFrom-Json($jsonStr) | ForEach-Object { $_.filters })
#Create custom object containing info from API
$properties = @{DateExtracted = ((Get-Date).ToShortDateString())
GroupCount = $raw.api.file_group_count
LastUpdated = $raw.lastUpdated.date
Extensions = $monitoredextensions}
$obj = New-Object -TypeName psobject -Property $properties
Write-Output $obj
}
}