cleanup tests (#673)
* cleanup tests * fix path issue and add elevation requirements * fix format * remove redundant tests
This commit is contained in:
committed by
Carrie Roberts
parent
a49e529a34
commit
c5b2c92ad3
+27
-86
@@ -11,84 +11,55 @@ atomic_tests:
|
||||
- macos
|
||||
executor:
|
||||
name: sh
|
||||
elevation_required: false
|
||||
command: |
|
||||
mkdir .hidden-directory
|
||||
echo "this file is hidden" > .hidden-directory/.hidden-file
|
||||
mkdir /var/tmp/.hidden-directory
|
||||
echo "T1158" > /var/tmp/.hidden-directory/.hidden-file
|
||||
cleanup_command: |
|
||||
rm -rf /var/tmp/.hidden-directory/
|
||||
|
||||
- name: Mac Hidden file
|
||||
description: |
|
||||
Hide a file on MacOS
|
||||
|
||||
supported_platforms:
|
||||
- macos
|
||||
|
||||
executor:
|
||||
name: sh
|
||||
elevation_required: false
|
||||
command: |
|
||||
sudo xattr -lr * / 2>&1 /dev/null | grep -C 2 "00 00 00 00 00 00 00 00 40 00 FF FF FF FF 00 00"
|
||||
|
||||
- name: Hidden file
|
||||
description: |
|
||||
mv file to a .file
|
||||
|
||||
supported_platforms:
|
||||
- macos
|
||||
- linux
|
||||
|
||||
input_arguments:
|
||||
filename:
|
||||
description: path of file to hide
|
||||
type: path
|
||||
default: /tmp/evil
|
||||
output_filename:
|
||||
description: output path of file
|
||||
type: path
|
||||
default: /tmp/evil
|
||||
executor:
|
||||
name: sh
|
||||
command: |
|
||||
mv #{filename} .#{output_filename}
|
||||
xattr -lr * / 2>&1 /dev/null | grep -C 2 "00 00 00 00 00 00 00 00 40 00 FF FF FF FF 00 00"
|
||||
|
||||
- name: Create Windows System File with Attrib
|
||||
description: |
|
||||
Creates a file and marks it as a system file using the attrib.exe utility.
|
||||
|
||||
supported_platforms:
|
||||
- windows
|
||||
|
||||
input_arguments:
|
||||
filename:
|
||||
description: path of file to mark as system
|
||||
type: path
|
||||
default: C:\Temp\sensitive_file.txt
|
||||
executor:
|
||||
name: command_prompt
|
||||
elevation_required: false
|
||||
elevation_required: true
|
||||
command: |
|
||||
attrib.exe +s #{filename}
|
||||
echo T1158 > %TEMP%\T1158.txt
|
||||
attrib.exe +s %TEMP%\T1158.txt
|
||||
cleanup_command: |
|
||||
del /A:S %TEMP%\T1158.txt
|
||||
|
||||
- name: Create Windows Hidden File with Attrib
|
||||
description: |
|
||||
Creates a file and marks it as hidden using the attrib.exe utility.
|
||||
|
||||
supported_platforms:
|
||||
- windows
|
||||
|
||||
input_arguments:
|
||||
filename:
|
||||
description: path of file to mark as hidden
|
||||
type: path
|
||||
default: C:\Temp\sensitive_file.txt
|
||||
executor:
|
||||
name: command_prompt
|
||||
elevation_required: false
|
||||
command: |
|
||||
attrib.exe +h #{filename}
|
||||
echo T1158_hidden > %TEMP%\T1158_hidden.txt
|
||||
attrib.exe +h %TEMP%\T1158_hidden.txt
|
||||
cleanup_command: |
|
||||
del /A:H %TEMP%\T1158_hidden.txt
|
||||
|
||||
- name: Hidden files
|
||||
description: |
|
||||
Requires Apple Dev Tools
|
||||
|
||||
supported_platforms:
|
||||
- macos
|
||||
input_arguments:
|
||||
@@ -98,68 +69,36 @@ atomic_tests:
|
||||
default: /tmp/evil
|
||||
executor:
|
||||
name: sh
|
||||
elevation_required: false
|
||||
command: |
|
||||
setfile -a V #{filename}
|
||||
|
||||
- name: Hide a Directory
|
||||
description: |
|
||||
Hide a directory on MacOS
|
||||
|
||||
supported_platforms:
|
||||
- macos
|
||||
input_arguments:
|
||||
filename:
|
||||
description: path of file to hide
|
||||
type: path
|
||||
default: /tmp/evil
|
||||
executor:
|
||||
name: sh
|
||||
elevation_required: false
|
||||
command: |
|
||||
chflags hidden #{filename}
|
||||
touch /var/tmp/T1158_mac.txt
|
||||
chflags hidden /var/tmp/T1158_mac.txt
|
||||
cleanup_command: |
|
||||
rm /var/tmp/T1158_mac.txt
|
||||
|
||||
- name: Show all hidden files
|
||||
description: |
|
||||
Show all hidden files on MacOS
|
||||
|
||||
supported_platforms:
|
||||
- macos
|
||||
|
||||
executor:
|
||||
name: sh
|
||||
elevation_required: false
|
||||
command: |
|
||||
defaults write com.apple.finder AppleShowAllFiles YES
|
||||
|
||||
- name: Create Visible Directories
|
||||
description: |
|
||||
Create visible directories on MacOS and Linux
|
||||
|
||||
supported_platforms:
|
||||
- macos
|
||||
- linux
|
||||
|
||||
executor:
|
||||
name: sh
|
||||
command: |
|
||||
mkdir visible-directory
|
||||
echo "this file is visible" > visible-directory/visible-file
|
||||
ls
|
||||
ls visible-directory
|
||||
|
||||
- name: Create hidden directories and files
|
||||
description: |
|
||||
Create hidden directories and files on Nix platforms
|
||||
|
||||
supported_platforms:
|
||||
- macos
|
||||
- linux
|
||||
|
||||
executor:
|
||||
name: sh
|
||||
command: |
|
||||
mkdir .hidden-directory
|
||||
echo "this file is hidden" > .hidden-directory/.hidden-file
|
||||
ls -la
|
||||
ls -la .hidden-directory
|
||||
cleanup_command: |
|
||||
defaults write com.apple.finder AppleShowAllFiles NO
|
||||
|
||||
- name: Create ADS command prompt
|
||||
description: |
|
||||
@@ -207,3 +146,5 @@ atomic_tests:
|
||||
set-content -path #{file_name} -stream #{ads_filename} -value "test2"
|
||||
set-content -path . -stream #{ads_filename} -value "test3"
|
||||
ls -Recurse | %{ gi $_.Fullname -stream *} | where stream -ne ':$Data' | Select-Object pschildname
|
||||
cleanup_command: |
|
||||
Remove-Item -Path #{file_name}
|
||||
|
||||
Reference in New Issue
Block a user