Skip to content

Instantly share code, notes, and snippets.

@jsecurity101
Created June 13, 2024 13:18
Show Gist options
  • Save jsecurity101/0886573078494fc45089b853017b517d to your computer and use it in GitHub Desktop.
Save jsecurity101/0886573078494fc45089b853017b517d to your computer and use it in GitHub Desktop.
$LoadedDrivers = Get-CimInstance -ClassName Win32_SystemDriver
$LoadedDrivers | % {
if(($_.PathName.StartsWith("\??\") -eq $true) -and ($_.PathName -ne $null))
{
$RelativePath = $_.PathName.Remove(0,4)
}
else
{
$RelativePath = $_.PathName
}
$Hash = (Get-FileHash -Path $RelativePath -Algorithm SHA256).Hash.ToLower()
$CurrentLoaded = [PSCustomObject] @{Path = $RelativePath; Hash = $Hash}
}
$RequestContent = ((Invoke-WebRequest -Uri 'https://www.loldrivers.io/api/drivers.json' -UseBasicParsing).Content).toLower() | ConvertFrom-Json
$samples = $RequestContent | % {$_.knownvulnerablesamples}
foreach($a in $samples.sha256){
foreach($b in $CurrentLoaded)
{
if($a -eq $b.Hash)
{
$b
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment