- What is the purpose of the provided PowerShell script?
powershell
function Test-Password {
if ($args[0] -eq 'mike12345') {
return 1
}
else {
return 0
}
}
$cracked=0
$i=0
Do {
$test='mike' + $i
$cracked = Test-Password $test
$i++
}
While($cracked -eq 0)
Write-Host "Cracked password:" $test
A
Perform a ping sweep of IP addresses in a specific range.
B
Simulate a simplified form of password cracking.
C
Perform a reverse DNS lookup for IP addresses in a specific range.
D
Iterate through a range of values.
Answer and explanation
Correct Answer: B — Simulate a simplified form of password cracking.
The provided PowerShell script simulates a simplified form of password cracking.
