-
-
Save p0w3rsh3ll/4b12e3db7aca7b230724c714329b7bcc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -Module AutoRuns | |
[CmdletBinding()] | |
Param( | |
[switch]$ShowLolDriverInfo | |
) | |
Begin { | |
$HT = @{ | |
Method = 'Get' | |
UseBasicParsing = [switch]::Present | |
Uri = 'https://www.loldrivers.io/api/drivers.json' | |
Verbose = $false | |
ErrorAction = 'Stop' | |
} | |
try { | |
$JsonData = Invoke-RestMethod @HT | |
} catch { | |
Write-Warning -Message "Failed to get data about drivers because $($_.Exception.Message)" | |
} | |
} | |
Process {} | |
End { | |
if ($JsonData) { | |
$AutorunsServices = Get-PSAutorun -ServicesAndDrivers -ShowFileHash | |
$AutorunsServices.SHA256 | Sort-Object -Unique | | |
ForEach-Object { | |
if ($_ -in ($JsonData.KnownVulnerableSamples.SHA256 | Sort-Object -Unique)) { | |
$sha2 = $_ | |
if ($ShowLolDriverInfo) { | |
$JsonData | Where-Object { $sha2 -in $_.KnownVulnerableSamples.SHA256 } | |
} else { | |
$AutorunsServices | Where-Object { $_.SHA256 -eq $sha2 } | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment