Exploit database

GH-d449cb9779a336fe3388d06522cd844c

arnaudluti/ps-cve-2021-21551

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2021-21551

21 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files3
arnaudluti/ps-cve-2021-21551Revision b38c837b21b8

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

CVE-2021-21551_localfix.ps1

Suggested starting filePowerShell · 2,491 bytes
 <#
    .SYNOPSIS
        Mitigation CVE-2021-21551
    .DESCRIPTION
        Faille privesc sur un driver poussé par l'installateur de DELLSupportAssist ou l'utilitaire de MAJ Bios
        Détecte et supprime celui-ci localement sur les postes
    .NOTES 
        Author: Arnaud Rigole
        Version: 1.0
        Date: 05/2021
#>

# Static
$mailArgs = @{
    smtpServer = 'yoursmtpserverip'
    From = '[email protected]'
    To = 'youradminsemailaddresses'    
}

$SysDrvPath = "$Env:SystemRoot\Temp\dbutil_2_3.sys"
If (Test-Path $SysDrvPath) {
    Write-Host -Fore Yellow "[!] Driver found in $SysDrvPath on computer $Env:ComputerName, trying to delete..."
    Try {
        Remove-Item $SysDrvPath -Force -ErrorAction stop
        Write-Host -Fore Green "[-] Driver $SysDrvPath on computer $Env:ComputerName deleted."
        Send-MailMessage @mailArgs -Body "[-] Driver $SysDrvPath on computer $Env:ComputerName deleted." -Subject '[INFO] Mitigation CVE-2021-21551'
    } Catch {
        Write-host -Fore Red "[!] Could not delete driver on computer $Env:ComputerName, location: $SysDrvPath"
        Send-MailMessage @mailArgs -Body "[!] Could not delete driver on computer $Env:ComputerName, location: $SysDrvPath. Please clean manually." -Subject '[ACTION REQ.] Mitigation CVE-2021-21551'
    }
} Else {
    Write-Host -Fore Green "[i] OK: Sysdir clean."
}

# Test if driver is present in users appdatas
Foreach ($usr in (Get-ChildItem "$Env:SystemDrive\Users\")) {
    $UsrDrvPath = "$Env:SystemDrive\Users\$usr\AppData\Local\Temp\dbutil_2_3.sys"
    If (Test-Path $UsrDrvPath) {
        Write-Host -Fore Yellow "[!] Driver found in $UsrDrvPath on $Env:ComputerName, trying to delete..."
        Try {
            Remove-Item $UsrDrvPath -Force -ErrorAction stop
            Write-Host -Fore Green "[-] ... Driver $UsrDrvPath on computer $Env:ComputerName deleted."
            Send-MailMessage @mailArgs -Body "[-] ... Driver $UsrDrvPath on computer $Env:ComputerName deleted." -Subject '[INFO] Mitigation CVE-2021-21551'
        } Catch {
            Write-Host -Fore Red "[!] Could not delete driver on computer $Env:ComputerName, location: $UsrDrvPath"
            Send-MailMessage @mailArgs -Body "[!] Could not delete driver on computer $Env:ComputerName, location: $UsrDrvPath" -Subject '[ACTION REQ.] Mitigation CVE-2021-21551'
        }
    } Else {
        Write-Host -Fore Green "[i] OK: User dirs clean."
    }
}