Question 1
Open practiceWhat 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
A: Perform a ping sweep of IP addresses in a specific range.
B
B: Simulate a simplified form of password cracking.
C
C: Perform a reverse DNS lookup for IP addresses in a specific range.
D
D: Iterate through a range of values.
Comptia Pentest Plus Certification Exam Pt0 002MediumScripting For Penetration TestingComptia Pentest Certification Exam Pt0 002
Answer and explanation
Correct Answer: B — B: Simulate a simplified form of password cracking.
The provided PowerShell script simulates a simplified form of password cracking.
