@@ -873,10 +873,10 @@ Describe 'Find-ProcessDLLHijack' {
873
873
}
874
874
875
875
876
- Describe ' Find-PathHijack ' {
876
+ Describe ' Find-PathDLLHijack ' {
877
877
878
878
if (-not $ (Test-IsAdmin )) {
879
- Throw " 'Find-PathHijack ' Pester test needs local administrator privileges."
879
+ Throw " 'Find-PathDLLHijack ' Pester test needs local administrator privileges."
880
880
}
881
881
882
882
It ' Should find a hijackable %PATH% folder.' {
@@ -887,22 +887,22 @@ Describe 'Find-PathHijack' {
887
887
$OldPath = $Env: PATH
888
888
$Env: PATH += ' ;C:\PowerUpTest\'
889
889
890
- $Output = Find-PathHijack | Where-Object {$_.Path -like " *PowerUpTest*" } | Select-Object - First 1
890
+ $Output = Find-PathDLLHijack | Where-Object {$_.Path -like " *PowerUpTest*" } | Select-Object - First 1
891
891
892
892
$Env: PATH = $OldPath
893
893
894
894
$Output.Path | Should Be ' C:\PowerUpTest\'
895
895
896
896
if ($Output.PSObject.Properties.Name -notcontains ' Path' ) {
897
- Throw " Find-PathHijack result doesn't contain 'Path' field."
897
+ Throw " Find-PathDLLHijack result doesn't contain 'Path' field."
898
898
}
899
899
900
900
if ($Output.PSObject.Properties.Name -notcontains ' Permissions' ) {
901
- Throw " Find-PathHijack result doesn't contain 'Permissions' field."
901
+ Throw " Find-PathDLLHijack result doesn't contain 'Permissions' field."
902
902
}
903
903
904
904
if ($Output.PSObject.Properties.Name -notcontains ' IdentityReference' ) {
905
- Throw " Find-PathHijack result doesn't contain 'IdentityReference' field."
905
+ Throw " Find-PathDLLHijack result doesn't contain 'IdentityReference' field."
906
906
}
907
907
}
908
908
catch {
@@ -952,14 +952,14 @@ Describe 'Get-RegistryAutoLogon' {
952
952
}
953
953
954
954
955
- Describe ' Get-RegistryAutoRun ' {
955
+ Describe ' Get-ModifiableRegistryAutoRun ' {
956
956
957
957
if (-not $ (Test-IsAdmin )) {
958
- Throw " 'Get-RegistryAutoRun ' Pester test needs local administrator privileges."
958
+ Throw " 'Get-ModifiableRegistryAutoRun ' Pester test needs local administrator privileges."
959
959
}
960
960
961
961
It ' Should not throw.' {
962
- {Get-RegistryAutoRun } | Should Not Throw
962
+ {Get-ModifiableRegistryAutoRun } | Should Not Throw
963
963
}
964
964
965
965
It ' Should find a vulnerable autorun.' {
@@ -968,28 +968,28 @@ Describe 'Get-RegistryAutoRun' {
968
968
$Null | Out-File - FilePath $FilePath - Force
969
969
$Null = Set-ItemProperty - Path ' HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run' - Name PowerUp - Value " vuln.exe -i '$FilePath '"
970
970
971
- $Output = Get-RegistryAutoRun | Where-Object {$_.Path -like " *$FilePath *" } | Select-Object - First 1
971
+ $Output = Get-ModifiableRegistryAutoRun | Where-Object {$_.Path -like " *$FilePath *" } | Select-Object - First 1
972
972
973
973
$Output.ModifiableFile.Path | Should Be $FilePath
974
974
975
975
if ($Output.PSObject.Properties.Name -notcontains ' Key' ) {
976
- Throw " Get-RegistryAutoRun result doesn't contain 'Key' field."
976
+ Throw " Get-ModifiableRegistryAutoRun result doesn't contain 'Key' field."
977
977
}
978
978
if ($Output.PSObject.Properties.Name -notcontains ' Path' ) {
979
- Throw " Get-RegistryAutoRun result doesn't contain 'Path' field."
979
+ Throw " Get-ModifiableRegistryAutoRun result doesn't contain 'Path' field."
980
980
}
981
981
if ($Output.PSObject.Properties.Name -notcontains ' ModifiableFile' ) {
982
- Throw " Get-RegistryAutoRun result doesn't contain 'ModifiableFile' field."
982
+ Throw " Get-ModifiableRegistryAutoRun result doesn't contain 'ModifiableFile' field."
983
983
}
984
984
985
985
if ($Output.ModifiableFile.PSObject.Properties.Name -notcontains ' Path' ) {
986
- Throw " Get-RegistryAutoRun ModifiableFile result doesn't contain 'Path' field."
986
+ Throw " Get-ModifiableRegistryAutoRun ModifiableFile result doesn't contain 'Path' field."
987
987
}
988
988
if ($Output.ModifiableFile.PSObject.Properties.Name -notcontains ' Permissions' ) {
989
- Throw " Get-RegistryAutoRun ModifiableFile result doesn't contain 'Permissions' field."
989
+ Throw " Get-ModifiableRegistryAutoRun ModifiableFile result doesn't contain 'Permissions' field."
990
990
}
991
991
if ($Output.ModifiableFile.PSObject.Properties.Name -notcontains ' IdentityReference' ) {
992
- Throw " Get-RegistryAutoRun ModifiableFile result doesn't contain 'IdentityReference' field."
992
+ Throw " Get-ModifiableRegistryAutoRun ModifiableFile result doesn't contain 'IdentityReference' field."
993
993
}
994
994
995
995
$Null = Remove-ItemProperty - Path ' HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run' - Name PowerUp
0 commit comments