Update T1059.004.yaml (#2894)

* Update T1059.004.yaml

Added a new atomic test
name: emacs spawning an interactive system shell

* Update T1059.004.yaml

Added new test supports bothe Linuc n Mac

added brew install prereq as well to support mac

Test name: emacs spawning an interactive system shell
This commit is contained in:
NeuralGlitch
2024-08-06 13:31:57 +05:30
committed by GitHub
parent 30a2f6f601
commit 932fd8321e
+18
View File
@@ -278,3 +278,21 @@ atomic_tests:
cleanup_command:
name: sh
elevation_required: false
- name: emacs spawning an interactive system shell
description: |
emacs can be used to break out from restricted environments by spawning an interactive system shell. Ref: https://gtfobins.github.io/gtfobins/emacs/
supported_platforms:
- linux
- macos
dependency_executor_name: bash
dependencies:
- description: |
Check if emacs is installed on the machine.
prereq_command: |
if [ -x "$(command -v emacs)" ]; then echo "emacs is installed"; else echo "emacs is NOT installed"; exit 1; fi
get_prereq_command: |
which apt && apt update && apt install -y emacs || which pkg && pkg update && pkg install -y emacs || which brew && brew update && brew install --quiet emacs
executor:
command: sudo emacs -Q -nw --eval '(term "/bin/sh &")'
name: sh
elevation_required: true