threatexpress / threatbox

ThreatBox is a standard and controlled Linux based attack platform. I've used a version of this for years. It started as a collection of scripts, lived as a rolling virtual machine, existed as code to build a Linux ISO, and has now been converted to a set of ansible playbooks. Why Ansible? Why not? This seemed a natural evolution.
72 stars 13 forks source link

Fatal error while running Ansible playbook #2

Open chosenonehacks opened 4 years ago

chosenonehacks commented 4 years ago

Hi, I am not proficient with Ansible. I was trying to follow your guide and DigitalOcean guide how to prepare control host.

While running paybook with ansible I am getting fatal error:

TASK [common : update xfce /etc/skel files] ****************************************************************************
fatal: [XXX.XX.XX.XXX]: FAILED! => {"changed": false, "msg": "Failed to find handler for \"/root/.ansible/tmp/ansible-tmp-1585832679.98-69685067466233/source\". Make sure the required command to extract the file is installed. Command \"/usr/bin/unzip\" could not handle archive. Command \"/bin/tar\" could not handle archive."}

I double-checked unzip and tar are in propper locations on ubuntu. Everything is a default Digital Ocean ubuntu 18.04

user@host:~$ whereis unzip
unzip: /usr/bin/unzip /usr/share/man/man1/unzip.1.gz
user@host:~$ whereis tar
tar: /usr/lib/tar /bin/tar /usr/share/man/man1/tar.1.gz
chosenonehacks commented 4 years ago

I managed to do some workaround. The issue was with one archive.

For some unknown to me reason, this archive is damaged, I couldn't extract it on ubuntu's from Digital Ocean, and I was able to extract it with 7zip on my Windows host.

root@manager:/opt/threatbox/roles/common/files# tar -xvf skel_xfce.tar.gz
tar: This does not look like a tar archive

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

So I just uploaded tar version (skel_xfce.tar) to my ansible host and changed config in file threatbox/roles/common/tasks/main.yml to work on tar version of this archive. And that worked for me allowing to finish ansible-playbook.

vestjoe commented 4 years ago

I'm a bit late on this, but I'll dig into this. Thanks for the feedback.