From 7b90e89acd007fbd63248083b4885ef016bd11f5 Mon Sep 17 00:00:00 2001 From: Brian Thacker Date: Tue, 15 Sep 2020 09:53:11 -0500 Subject: [PATCH] Update T1053.003.yaml (#1221) Add code to make cleanup commands. Co-authored-by: Carrie Roberts --- atomics/T1053.003/T1053.003.yaml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/atomics/T1053.003/T1053.003.yaml b/atomics/T1053.003/T1053.003.yaml index e7ffd08bbc..3ff12d0be5 100644 --- a/atomics/T1053.003/T1053.003.yaml +++ b/atomics/T1053.003/T1053.003.yaml @@ -25,7 +25,10 @@ atomic_tests: executor: name: bash command: | + crontab -l > /tmp/notevil echo "* * * * * #{command}" > #{tmp_cron} && crontab #{tmp_cron} + cleanup_command: | + crontab /tmp/notevil - name: Cron - Add script to cron folder auto_generated_guid: b7d42afa-9086-4c8a-b7b0-8ea3faa6ebb0 @@ -50,4 +53,6 @@ atomic_tests: elevation_required: true name: bash command: | - echo "#{command}" > /etc/cron.daily/#{cron_script_name} \ No newline at end of file + echo "#{command}" > /etc/cron.daily/#{cron_script_name} + cleanup_command: | + rm /etc/cron.daily/#{cron_script_name}