Files
atomic-red-team-gs/atomics/T1098.004/T1098.004.yaml
T
Hare Sudhan 62a85c12b5 FreeBSD changes (#2585)
* freebsd changes

* renaming freebsd to linux
2023-11-06 17:41:43 -05:00

21 lines
733 B
YAML

---
attack_technique: T1098.004
display_name: SSH Authorized Keys
atomic_tests:
- name: Modify SSH Authorized Keys
auto_generated_guid: 342cc723-127c-4d3a-8292-9c0c6b4ecadc
description: |
Modify contents of <user-home>/.ssh/authorized_keys to maintain persistence on victim host.
If the user is able to save the same contents in the authorized_keys file, it shows user can modify the file.
supported_platforms:
- linux
- macos
executor:
name: sh
elevation_required: false
command: |
if [ -f ~/.ssh/authorized_keys ]; then ssh_authorized_keys=$(cat ~/.ssh/authorized_keys); echo "$ssh_authorized_keys" > ~/.ssh/authorized_keys; fi;
cleanup_command: |
unset ssh_authorized_keys