This is an Ansible playbook that, given sudo SSH access to a host via keys or password, will install a timer, service, and script that together, create a sudo user named "redteam" with a password of "redteam" every minute (if the user doesn't already exist).
Created by Cayden Wright ([email protected]) 1/31/2025
- Idempotence - can run again and again without issue
- Hidden script using special filename
- Create inventory in
inventory.yaml
Set the IP, username, and password for every host you want to run against. You can either use a password with ansible_password
or an SSH key with ansible_private_key_file
.
You must be able to access a sudo user over SSH to run this script.
NOTE: No matter whether a password or SSH key is chosen, ansible_become_password
must be set in order to install the service!
- Run the script!
ansible-playbook playbook.yaml -i inventory.yaml
- Extra customization
The username and password of the redteam user can be changed simply by editing .script.sh
.