Skip to content

CWright2022/ansible_linux_persistence

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CDT HW2: Ansible Persistence

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

Features:

  • Idempotence - can run again and again without issue
  • Hidden script using special filename

Pre-use Instructions:

  1. 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!

  1. Run the script!

ansible-playbook playbook.yaml -i inventory.yaml

  1. Extra customization

The username and password of the redteam user can be changed simply by editing .script.sh.

About

Basic Ansible playbook for redteaming persistence on linux via systemd services and timers.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages