diff --git a/atomics/Indexes/index.yaml b/atomics/Indexes/index.yaml index 29d3d670..bf6415c5 100644 --- a/atomics/Indexes/index.yaml +++ b/atomics/Indexes/index.yaml @@ -38013,14 +38013,14 @@ privilege-escalation: command_to_add: description: Command to add to the .bash_profile file type: String - default: echo "Hello from Atomic Red Team T1546.004" + default: echo "Hello from Atomic Red Team T1546.004" > /tmp/T1546.004 executor: command: 'echo ''#{command_to_add}'' >> ~/.bash_profile ' - cleanup_command: 'sed -i ''/#{command_to_add}/d'' ~/.bash_profile - - ' + cleanup_command: | + head -n '-2' ~/.bash_profile > /tmp/T1546.004 + mv /tmp/T1546.004 ~/.bash_profile name: sh - name: Add command to .bashrc auto_generated_guid: 0a898315-4cfa-4007-bafe-33a4646d115f @@ -38034,14 +38034,14 @@ privilege-escalation: command_to_add: description: Command to add to the .bashrc file type: String - default: echo "Hello from Atomic Red Team T1546.004" + default: echo "Hello from Atomic Red Team T1546.004" > /tmp/T1546.004 executor: command: 'echo ''#{command_to_add}'' >> ~/.bashrc ' - cleanup_command: 'sed -i ''/#{command_to_add}/d'' ~/.bashrc - - ' + cleanup_command: | + head -n '-2' ~/.bashrc > /tmp/T1546.004 + mv /tmp/T1546.004 ~/.bashrc name: sh T1134.005: technique: @@ -60937,14 +60937,14 @@ persistence: command_to_add: description: Command to add to the .bash_profile file type: String - default: echo "Hello from Atomic Red Team T1546.004" + default: echo "Hello from Atomic Red Team T1546.004" > /tmp/T1546.004 executor: command: 'echo ''#{command_to_add}'' >> ~/.bash_profile ' - cleanup_command: 'sed -i ''/#{command_to_add}/d'' ~/.bash_profile - - ' + cleanup_command: | + head -n '-2' ~/.bash_profile > /tmp/T1546.004 + mv /tmp/T1546.004 ~/.bash_profile name: sh - name: Add command to .bashrc auto_generated_guid: 0a898315-4cfa-4007-bafe-33a4646d115f @@ -60958,14 +60958,14 @@ persistence: command_to_add: description: Command to add to the .bashrc file type: String - default: echo "Hello from Atomic Red Team T1546.004" + default: echo "Hello from Atomic Red Team T1546.004" > /tmp/T1546.004 executor: command: 'echo ''#{command_to_add}'' >> ~/.bashrc ' - cleanup_command: 'sed -i ''/#{command_to_add}/d'' ~/.bashrc - - ' + cleanup_command: | + head -n '-2' ~/.bashrc > /tmp/T1546.004 + mv /tmp/T1546.004 ~/.bashrc name: sh T1547.002: technique: diff --git a/atomics/T1546.004/T1546.004.md b/atomics/T1546.004/T1546.004.md index 5b21e8b8..ff4c1f9e 100644 --- a/atomics/T1546.004/T1546.004.md +++ b/atomics/T1546.004/T1546.004.md @@ -30,7 +30,7 @@ Adds a command to the .bash_profile file of the current user #### Inputs: | Name | Description | Type | Default Value | |------|-------------|------|---------------| -| command_to_add | Command to add to the .bash_profile file | String | echo "Hello from Atomic Red Team T1546.004"| +| command_to_add | Command to add to the .bash_profile file | String | echo "Hello from Atomic Red Team T1546.004" > /tmp/T1546.004| #### Attack Commands: Run with `sh`! @@ -42,7 +42,8 @@ echo '#{command_to_add}' >> ~/.bash_profile #### Cleanup Commands: ```sh -sed -i '/#{command_to_add}/d' ~/.bash_profile +head -n '-2' ~/.bash_profile > /tmp/T1546.004 +mv /tmp/T1546.004 ~/.bash_profile ``` @@ -67,7 +68,7 @@ Adds a command to the .bashrc file of the current user #### Inputs: | Name | Description | Type | Default Value | |------|-------------|------|---------------| -| command_to_add | Command to add to the .bashrc file | String | echo "Hello from Atomic Red Team T1546.004"| +| command_to_add | Command to add to the .bashrc file | String | echo "Hello from Atomic Red Team T1546.004" > /tmp/T1546.004| #### Attack Commands: Run with `sh`! @@ -79,7 +80,8 @@ echo '#{command_to_add}' >> ~/.bashrc #### Cleanup Commands: ```sh -sed -i '/#{command_to_add}/d' ~/.bashrc +head -n '-2' ~/.bashrc > /tmp/T1546.004 +mv /tmp/T1546.004 ~/.bashrc ```