├── hosts.sample ├── roles ├── common │ ├── templates │ │ ├── bash_aliases.tpl │ │ ├── python_modules.tpl │ │ ├── direct_download_files.tpl │ │ ├── software_packages.tpl │ │ ├── git_repositories.tpl │ │ └── readme.tpl │ ├── meta │ │ └── main.yml │ ├── files │ │ ├── background.jpg │ │ ├── skel_xfce.tar.gz │ │ └── redteamops.rc │ ├── tasks │ │ └── main.yml │ └── defaults │ │ └── main.yml ├── setupssh │ ├── meta │ │ └── main.yml │ ├── handlers │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── docker │ ├── defaults │ │ └── main.yml │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── powershell │ ├── defaults │ │ └── main.yml │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── vscode │ ├── defaults │ │ └── main.yml │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── mono │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── merlin │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── covenant │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── final │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── passwords │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── tigervnc │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── bloodhound │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── burpsuite │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── dotnetcore │ ├── meta │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── impacket │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── metasploit │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── crackmapexec │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── domainhunter │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── johntheripper │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── proxychainsng │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml ├── silenttrinity │ ├── meta │ │ └── main.yml │ ├── defaults │ │ └── main.yml │ └── tasks │ │ └── main.yml └── compiled_dotnet_projects │ ├── meta │ └── main.yml │ ├── defaults │ └── main.yml │ └── tasks │ └── main.yml ├── images ├── help.png ├── pipenv.png ├── custom_terminal.png ├── light_theme.png ├── pipenv_shell.png ├── terminal_logs.png ├── threatbox.png ├── tool_category.png └── tool_tracking.png ├── .gitattributes ├── .gitignore ├── LICENSE ├── threatbox_playbook.yml ├── readme.md └── group_vars └── threatbox.yml.sample /hosts.sample: -------------------------------------------------------------------------------- 1 | [threatbox] 2 | 10.10.10.10 3 | 4 | -------------------------------------------------------------------------------- /roles/common/templates/bash_aliases.tpl: -------------------------------------------------------------------------------- 1 | source ~/.redteamops.rc -------------------------------------------------------------------------------- /roles/setupssh/meta/main.yml: -------------------------------------------------------------------------------- 1 | ## meta main.yml for role: setupssh 2 | -------------------------------------------------------------------------------- /roles/docker/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: docker 3 | 4 | -------------------------------------------------------------------------------- /roles/powershell/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: powershell 3 | -------------------------------------------------------------------------------- /roles/vscode/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: vscode 3 | 4 | -------------------------------------------------------------------------------- /roles/mono/meta/main.yml: -------------------------------------------------------------------------------- 1 | ## meta main.yml for role: mono 2 | --- 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/common/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: Common 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/docker/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: docker 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/merlin/meta/main.yml: -------------------------------------------------------------------------------- 1 | ## meta main.yml for role: merlin 2 | --- 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/vscode/meta/main.yml: -------------------------------------------------------------------------------- 1 | ## meta main.yml for role: vscode 2 | --- 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/covenant/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: Covenant 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/final/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: final 3 | 4 | dependencies: 5 | - setupssh -------------------------------------------------------------------------------- /roles/passwords/meta/main.yml: -------------------------------------------------------------------------------- 1 | ## meta main.yml for role: passwords 2 | --- 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/tigervnc/meta/main.yml: -------------------------------------------------------------------------------- 1 | ## meta main.yml for role: tigervnc 2 | --- 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/bloodhound/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: bloodhound 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/burpsuite/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: burpsuite 3 | dependencies: 4 | - setupssh 5 | -------------------------------------------------------------------------------- /roles/dotnetcore/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: dotnetcore 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/impacket/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: impacket 3 | 4 | dependencies: 5 | - setupssh -------------------------------------------------------------------------------- /roles/metasploit/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: metasploit 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/powershell/meta/main.yml: -------------------------------------------------------------------------------- 1 | ## meta main.yml for role: powershell 2 | --- 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/setupssh/handlers/main.yml: -------------------------------------------------------------------------------- 1 | - name: Restart sshd 2 | service: 3 | name: sshd 4 | state: restarted -------------------------------------------------------------------------------- /roles/crackmapexec/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: crackmapexec 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/domainhunter/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: domainhunter 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/johntheripper/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: johntheripper 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/proxychainsng/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: proxychains-ng 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/silenttrinity/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: silenttrinity 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/common/files/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/threatexpress/threatbox/HEAD/roles/common/files/background.jpg -------------------------------------------------------------------------------- /roles/compiled_dotnet_projects/meta/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## meta main.yml for role: compiled_dotnet_projects 3 | dependencies: 4 | - setupssh -------------------------------------------------------------------------------- /roles/common/templates/python_modules.tpl: -------------------------------------------------------------------------------- 1 | # Python Modules 2 | 3 | The following python modules were installed at the time of deployment. 4 | -------------------------------------------------------------------------------- /images/help.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:47d4936ed04978dda8742d010c612b68d758b8953dbd67b84d9426cfd0e95afc 3 | size 435147 4 | -------------------------------------------------------------------------------- /images/pipenv.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:a2a5ef63f9b9a85b77db7e7ab7b73599e0209d8f4c2d8bde2e07af4a0d0b762f 3 | size 1136263 4 | -------------------------------------------------------------------------------- /roles/common/templates/direct_download_files.tpl: -------------------------------------------------------------------------------- 1 | # Direct Download Files List 2 | 3 | The following files were downloaded at the time of deployment.\ 4 | 5 | -------------------------------------------------------------------------------- /images/custom_terminal.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:9d4b5e81cba97edfd07cea8fd69fab63ebb2f09e54e58edc1369f115a2e45626 3 | size 68596 4 | -------------------------------------------------------------------------------- /images/light_theme.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:1ff38be6a5d9ce87d8b3adcbb34e2525ea2163d5fcda0400775c012744be66d3 3 | size 62026 4 | -------------------------------------------------------------------------------- /images/pipenv_shell.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:4df1379da7a35a0fbe9144e82ce5f0bbcfead3538b346f593bfa98cddb4cec18 3 | size 72077 4 | -------------------------------------------------------------------------------- /images/terminal_logs.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:6076a2758c5580b9b2016f15a9475706a3c973d83adf30b7f5f61772727a8548 3 | size 368996 4 | -------------------------------------------------------------------------------- /images/threatbox.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:8eaab83ab3abbe4d36258a3a95745cf84c484d00b599b5b98c535efd8f2d5b2b 3 | size 1244900 4 | -------------------------------------------------------------------------------- /images/tool_category.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:cc89da91ecd0d8519c22a5d3a6114abacd784059e7582b38bb87b357af810aec 3 | size 291850 4 | -------------------------------------------------------------------------------- /images/tool_tracking.png: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:5017f00e0b348d740e0cdb157136179354025d58e7664b4433833f645262e7b8 3 | size 1376677 4 | -------------------------------------------------------------------------------- /roles/common/files/skel_xfce.tar.gz: -------------------------------------------------------------------------------- 1 | version https://git-lfs.github.com/spec/v1 2 | oid sha256:e94490ab5bfe42b836a76951a4a6f91d58e0a22b07afa0b98e6dbaa1c7e7c964 3 | size 3644 4 | -------------------------------------------------------------------------------- /roles/powershell/tasks/main.yml: -------------------------------------------------------------------------------- 1 | ## tasks main.yml for role: powershell 2 | --- 3 | ########################## 4 | ## Install Powershell 5 | - name: Install PowerShell 6 | snap: 7 | name: powershell 8 | classic: yes -------------------------------------------------------------------------------- /roles/common/templates/software_packages.tpl: -------------------------------------------------------------------------------- 1 | # Software Package List 2 | 3 | The following software package were installed at the time of deployment. 4 | Packages updated or installed after deployment are not listed 5 | 6 | -------------------------------------------------------------------------------- /roles/impacket/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: impacket 3 | 4 | tools_root: /tools 5 | 6 | git_repos: 7 | impacket: 8 | category: network 9 | url: https://github.com/SecureAuthCorp/impacket -------------------------------------------------------------------------------- /roles/crackmapexec/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: crackmapexec 3 | 4 | tools_root: /tools 5 | 6 | git_repos: 7 | silenttrinity: 8 | category: c2 9 | url: https://github.com/byt3bl33d3r/CrackMapExec -------------------------------------------------------------------------------- /roles/domainhunter/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: domainhunter 3 | 4 | tools_root: /tools 5 | 6 | git_repos: 7 | domainhunter: 8 | category: recon 9 | url: https://github.com/threatexpress/domainhunter -------------------------------------------------------------------------------- /roles/silenttrinity/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: silenttrinity 3 | 4 | tools_root: /tools 5 | 6 | git_repos: 7 | silenttrinity: 8 | category: c2 9 | url: https://github.com/byt3bl33d3r/SILENTTRINITY -------------------------------------------------------------------------------- /roles/proxychainsng/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: proxychains-ng 3 | 4 | tools_root: /tools 5 | 6 | git_repos: 7 | proxychains-ng: 8 | category: general 9 | url: https://github.com/rofl0r/proxychains-ng -------------------------------------------------------------------------------- /roles/johntheripper/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: johntheripper 3 | 4 | tools_root: /tools 5 | 6 | git_repos: 7 | johntheripper: 8 | category: password 9 | url: https://github.com/magnumripper/JohnTheRipper -------------------------------------------------------------------------------- /roles/passwords/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: passwords 3 | 4 | tools_root: /tools 5 | 6 | direct_download_files: 7 | rockyou: 8 | category: password 9 | url: http://downloads.skullsecurity.org/passwords/rockyou.txt.bz2 -------------------------------------------------------------------------------- /roles/merlin/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: merlin 3 | 4 | tools_root: /tools 5 | 6 | direct_download_files: 7 | merlin: 8 | category: c2 9 | url: https://github.com/Ne0nd0g/merlin/releases/download/v0.7.0/merlinServer-Linux-x64-v0.7.0.BETA.7z -------------------------------------------------------------------------------- /roles/bloodhound/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: bloodhound 3 | 4 | tools_root: /tools 5 | 6 | direct_download_files: 7 | bloodhound: 8 | category: enumeration 9 | url: https://github.com/BloodHoundAD/BloodHound/releases/download/3.0.1/BloodHound-linux-x64.zip -------------------------------------------------------------------------------- /roles/burpsuite/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: burpsuite 3 | 4 | tools_root: /tools 5 | 6 | direct_download_files: 7 | burpsuite: 8 | category: web 9 | url: https://portswigger.net/burp/releases/download?product=community&version=2020.1&type=Linux 10 | -------------------------------------------------------------------------------- /roles/common/templates/git_repositories.tpl: -------------------------------------------------------------------------------- 1 | # Git Repository List 2 | 3 | The following repositories were cloned at the time of deployment. 4 | 5 | Commit | Date | Repo URL 6 | -----------------------------------------|---------------------------|--------- 7 | -------------------------------------------------------------------------------- /roles/covenant/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: covenant 3 | 4 | tools_root: /tools 5 | 6 | git_repos: 7 | elite: 8 | category: c2 9 | url: https://github.com/cobbr/Elite 10 | covenant: 11 | category: c2 12 | url: https://github.com/cobbr/Covenant -------------------------------------------------------------------------------- /roles/metasploit/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: metasploit 3 | 4 | tools_root: /tools 5 | 6 | direct_download_files: 7 | metasploit: 8 | category: c2 9 | url: https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.mp4 filter=lfs diff=lfs merge=lfs -text 2 | *.pdf filter=lfs diff=lfs merge=lfs -text 3 | *.zip filter=lfs diff=lfs merge=lfs -text 4 | *.gz filter=lfs diff=lfs merge=lfs -text 5 | *.tar filter=lfs diff=lfs merge=lfs -text 6 | *.evtx filter=lfs diff=lfs merge=lfs -text 7 | *.bin filter=lfs diff=lfs merge=lfs -text 8 | *.exe filter=lfs diff=lfs merge=lfs -text 9 | *.dll filter=lfs diff=lfs merge=lfs -text 10 | *.msi filter=lfs diff=lfs merge=lfs -text 11 | *.png filter=lfs diff=lfs merge=lfs -text 12 | *.vmem filter=lfs diff=lfs merge=lfs -text 13 | *.pcap filter=lfs diff=lfs merge=lfs -text 14 | -------------------------------------------------------------------------------- /roles/tigervnc/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: tigervnc 3 | 4 | operator_username: "operator" 5 | 6 | tools_root: /tools # Tools directory 7 | logs_root: /data # Engagement and operator logs directory 8 | 9 | required_directories: [ 10 | "{{ tools_root }}", 11 | "{{ logs_root }}" 12 | ] 13 | 14 | # VNC Auth password 15 | # NOTE 16 | # must be atleast 6 characters) 17 | # the variable feeds this command to a oneliner password change and include the appropriate quotes 18 | # printf {{ vnc_password_cmd }} | vncpasswd 19 | vnc_password_cmd: '"operator\noperator\nn"' -------------------------------------------------------------------------------- /roles/mono/tasks/main.yml: -------------------------------------------------------------------------------- 1 | ## tasks main.yml for role: mono 2 | --- 3 | ########################## 4 | # Install Mono (Used to compile .net projects) 5 | - name: Keyring for Mono 6 | apt_key: 7 | keyserver: keyserver.ubuntu.com 8 | id: 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF 9 | state: present 10 | 11 | - name: Add Mono Repository 12 | apt_repository: 13 | repo: deb https://download.mono-project.com/repo/ubuntu stable-bionic main 14 | state: present 15 | 16 | - name: Install Mono packages 17 | apt: 18 | name: "{{ packages }}" 19 | state: present 20 | update_cache: yes 21 | vars: 22 | packages: 23 | - mono-runtime 24 | - mono-dbg 25 | - mono-devel 26 | - mono-complete 27 | - ca-certificates-mono -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ansible and this project 2 | 3 | ansible.log 4 | ansible.cfg 5 | test.yml 6 | hosts 7 | threatbox.yml 8 | 9 | # vscode 10 | 11 | .vscode/* 12 | !.vscode/settings.json 13 | !.vscode/tasks.json 14 | !.vscode/launch.json 15 | !.vscode/extensions.json 16 | 17 | # General 18 | .DS_Store 19 | .AppleDouble 20 | .LSOverride 21 | 22 | # Icon must end with two \r 23 | Icon 24 | 25 | 26 | # Thumbnails 27 | ._* 28 | 29 | # Files that might appear in the root of a volume 30 | .DocumentRevisions-V100 31 | .fseventsd 32 | .Spotlight-V100 33 | .TemporaryItems 34 | .Trashes 35 | .VolumeIcon.icns 36 | .com.apple.timemachine.donotpresent 37 | 38 | # Directories potentially created on remote AFP share 39 | .AppleDB 40 | .AppleDesktop 41 | Network Trash Folder 42 | Temporary Items 43 | .apdiskIcon 44 | 45 | Icon 46 | 47 | -------------------------------------------------------------------------------- /roles/vscode/tasks/main.yml: -------------------------------------------------------------------------------- 1 | ## tasks main.yml for role: vscode 2 | --- 3 | ########################## 4 | ## Install VS code 5 | - name: Ensure required system packages are installed for VSCode 6 | apt: name={{ item }} state=latest update_cache=yes 7 | loop: [ 'apt-transport-https', 'curl', 'software-properties-common'] 8 | 9 | 10 | - name: Add Microsoft GPG Key 11 | apt_key: 12 | url: https://packages.microsoft.com/keys/microsoft.asc 13 | state: present 14 | 15 | 16 | - name: Add VSCode Repository 17 | apt_repository: 18 | repo: deb https://packages.microsoft.com/repos/vscode stable main 19 | state: present 20 | 21 | 22 | - name: Update apt and install VSCode 23 | apt: update_cache=yes name=code state=latest 24 | 25 | 26 | - name: Make VSCode default editor 27 | shell: xdg-mime default code.desktop text/plain -------------------------------------------------------------------------------- /roles/dotnetcore/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: dotnetcore 3 | ## This role downloads and installs dotnetcore 4 | 5 | ########################### 6 | ## Install .net Core 7 | - name: Download .net Core 8 | get_url: 9 | url: https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb 10 | dest: /tmp/packages-microsoft-prod.deb 11 | mode: 0755 12 | register: netcore 13 | 14 | - name: Install .net Core 15 | when: netcore.changed 16 | command: dpkg -i packages-microsoft-prod.deb 17 | args: 18 | chdir: /tmp/ 19 | 20 | - name: Install dotnet-sdk-3.1 21 | apt: name=dotnet-sdk-3.1 state=latest update_cache=yes force_apt_get=yes 22 | register: dotnetsdk31 23 | 24 | - name: Install dotnet-sdk-2.2 (Needed for Covenant) 25 | apt: name=dotnet-sdk-2.2 state=latest update_cache=yes force_apt_get=yes 26 | register: dotnetsdk22 -------------------------------------------------------------------------------- /roles/docker/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: docker 3 | ## This role downloads ands install docker 4 | 5 | ########################## 6 | # Install Docker 7 | - name: Install required system packages for Docker 8 | apt: name={{ item }} state=latest update_cache=yes 9 | loop: [ 'apt-transport-https', 'ca-certificates', 'curl', 'software-properties-common', 'python3-pip', 'virtualenv', 'python3-setuptools'] 10 | 11 | - name: Add Docker GPG apt Key 12 | apt_key: 13 | url: https://download.docker.com/linux/ubuntu/gpg 14 | state: present 15 | 16 | - name: Add Docker Repository 17 | apt_repository: 18 | repo: deb https://download.docker.com/linux/ubuntu bionic stable 19 | state: present 20 | 21 | - name: Update apt and install docker-ce 22 | apt: update_cache=yes name=docker-ce state=latest 23 | 24 | - name: Install Docker Module for Python 25 | pip: 26 | name: docker 27 | -------------------------------------------------------------------------------- /roles/final/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: final 3 | ## This role perform final steps 4 | 5 | ########################### 6 | ### Final Steps 7 | - name: Chown {{ tools_root }} to {{ operator_username }} user 8 | file: 9 | path: "{{ tools_root }}" 10 | recurse: yes 11 | owner: "{{ operator_username }}" 12 | group: "{{ operator_username }}" 13 | 14 | - name: Chown /home/{{ operator_username }} to {{ operator_username }} user 15 | file: 16 | path: "/home/{{ operator_username }}" 17 | recurse: yes 18 | owner: "{{ operator_username }}" 19 | group: "{{ operator_username }}" 20 | 21 | - name: Chown {{ logs_root }} to {{ operator_username }} user 22 | file: 23 | path: "{{ logs_root }}" 24 | recurse: yes 25 | owner: "{{ operator_username }}" 26 | group: "{{ operator_username }}" 27 | 28 | - name: Unconditionally reboot the machine with all defaults 29 | reboot: 30 | -------------------------------------------------------------------------------- /roles/metasploit/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: metasploit 3 | 4 | ########################## 5 | ## metasploit 6 | 7 | - name: Set metasploit path variable 8 | set_fact: 9 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 10 | loop: "{{ lookup('dict', direct_download_files) }}" 11 | when: "'metasploit' in item.key" 12 | 13 | 14 | ### Check if tool_path exists 15 | - name: check for tool_path ({{ tool_path }}) 16 | stat: 17 | path: "{{ tool_path }}" 18 | register: tp 19 | 20 | 21 | - name: fail if tool_path ({{ tool_path }}) does not exist 22 | fail: msg="The directory does not exist" 23 | when: not tp.stat.exists 24 | 25 | 26 | - name: Install metasploit 27 | shell: "{{ tool_path }}/{{ item.value.url | basename }}" 28 | loop: "{{ lookup('dict', direct_download_files) }}" 29 | when: "'metasploit' in item.key" 30 | args: 31 | chdir: "{{ tool_path }}" 32 | -------------------------------------------------------------------------------- /roles/passwords/tasks/main.yml: -------------------------------------------------------------------------------- 1 | ## tasks main.yml for role: passwords 2 | --- 3 | ########################## 4 | ## Add password databases to this role 5 | 6 | - name: Set rockyou path variable 7 | set_fact: 8 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 9 | loop: "{{ lookup('dict', direct_download_files) }}" 10 | when: "'rockyou' in item.key" 11 | 12 | 13 | ### Check if tool_path exists 14 | - name: check for tool_path ({{ tool_path }}) 15 | stat: 16 | path: "{{ tool_path }}" 17 | register: tp 18 | 19 | 20 | - name: fail if tool_path ({{ tool_path }}) does not exist 21 | fail: msg="The directory does not exist" 22 | when: not tp.stat.exists 23 | 24 | 25 | - name: Uncompress rockyou 26 | shell: "/bin/bunzip2 -f -k {{ tool_path }}/{{ item.value.url | basename }}" 27 | loop: "{{ lookup('dict', direct_download_files) }}" 28 | when: "'rockyou' in item.key" 29 | args: 30 | chdir: "{{ tool_path }}" 31 | 32 | 33 | -------------------------------------------------------------------------------- /roles/johntheripper/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: johntheripper 3 | ## This role install JohnTheRipper 4 | 5 | ########################## 6 | ## Install JohnTheRipper 7 | 8 | - name: Set JohnTheRipper path variable 9 | set_fact: 10 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 11 | loop: "{{ lookup('dict', git_repos) }}" 12 | when: "'johntheripper' in item.key" 13 | 14 | 15 | ### Check if tool_path exists 16 | - name: check for tool_path ({{ tool_path }}) 17 | stat: 18 | path: "{{ tool_path }}" 19 | register: tp 20 | 21 | 22 | - name: fail if tool_path ({{ tool_path }}) does not exist 23 | fail: msg="The directory does not exist" 24 | when: not tp.stat.exists 25 | 26 | 27 | - name: Running ./configure for John 28 | shell: ./configure 29 | args: 30 | chdir: "{{ tool_path }}/src" 31 | 32 | 33 | - name: Running "make install" for John 34 | shell: 'make -sj4' 35 | args: 36 | chdir: "{{ tool_path }}/src" 37 | -------------------------------------------------------------------------------- /roles/impacket/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: impacket 3 | ## This role downloads and installs impacket 4 | ########################## 5 | ## Install Impacket 6 | 7 | ## Note: Download of the source is controlled in the threatbox.yml file. 8 | ## It's best to enable all downloads in that file. 9 | ## This help to maintain software package tracking. 10 | 11 | - name: Set impacket path variable 12 | set_fact: 13 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 14 | loop: "{{ lookup('dict', git_repos) }}" 15 | when: "'impacket' in item.key" 16 | 17 | 18 | ### Check if tool_path exists 19 | - name: check for tool_path ({{ tool_path }}) 20 | stat: 21 | path: "{{ tool_path }}" 22 | register: tp 23 | 24 | 25 | - name: fail if tool_path ({{ tool_path }}) does not exist 26 | fail: msg="The directory does not exist" 27 | when: not tp.stat.exists 28 | 29 | 30 | - name: install impacket 31 | raw: cd {{ tool_path }} && pip install . 32 | 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Threat Express 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /roles/burpsuite/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: Burpsuite 3 | ## This role installs Burpsuite Community 4 | 5 | ########################### 6 | ## Install Burpsuite 7 | 8 | ## Note: Download of the source is controlled in the threatbox.yml file. 9 | ## It's best to enable all downloads in that file. 10 | ## This help to maintain software package tracking. 11 | 12 | - name: Set burpsuite path variable 13 | set_fact: 14 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 15 | loop: "{{ lookup('dict', direct_download_files) }}" 16 | when: "'burpsuite' in item.key" 17 | 18 | ### Check if tool_path exists 19 | - name: check for tool_path ({{ tool_path }}) 20 | stat: 21 | path: "{{ tool_path }}" 22 | register: tp 23 | 24 | - name: fail if tool_path ({{ tool_path }}) does not exist 25 | fail: msg="The directory does not exist" 26 | when: not tp.stat.exists 27 | 28 | - name: Install burp suite community quietly 29 | shell: "{{ tool_path }}/burpsuite_community_linux_v2020_1.sh -q" 30 | loop: "{{ lookup('dict', direct_download_files) }}" 31 | when: "'burpsuite' in item.key" 32 | args: 33 | chdir: "{{ tool_path }}" 34 | 35 | -------------------------------------------------------------------------------- /roles/proxychainsng/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: proxychains-ng 3 | ## This role installs proxychains-ng 4 | 5 | ########################## 6 | ## Install proxychains-ng 7 | 8 | ## Note: Download of the source is controlled in the threatbox.yml file. 9 | ## It's best to enable all downloads in that file. 10 | ## This help to maintain software package tracking. 11 | 12 | - name: Set proxychains-ng path variable 13 | set_fact: 14 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 15 | loop: "{{ lookup('dict', git_repos) }}" 16 | when: "'proxychains-ng' in item.key" 17 | 18 | 19 | ### Check if tool_path exists 20 | - name: check for tool_path ({{ tool_path }}) 21 | stat: 22 | path: "{{ tool_path }}" 23 | register: tp 24 | 25 | 26 | - name: fail if tool_path ({{ tool_path }}) does not exist 27 | fail: msg="The directory does not exist" 28 | when: not tp.stat.exists 29 | 30 | 31 | - name: Running ./configure for proxychains-ng 32 | shell: ./configure --prefix=/usr --sysconfdir=/etc 33 | args: 34 | chdir: "{{ tool_path }}" 35 | 36 | 37 | - name: Running "make install" for proxychains-ng 38 | shell: "make && make install-config" 39 | args: 40 | chdir: "{{ tool_path }}" 41 | 42 | -------------------------------------------------------------------------------- /roles/compiled_dotnet_projects/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: compiled_dotnet_projects 3 | 4 | operator_username: operator 5 | tools_root: /tools 6 | 7 | git_repos: 8 | seatbelt: 9 | category: ghostpack 10 | url: https://github.com/GhostPack/Seatbelt 11 | sharpup: 12 | category: ghostpack 13 | url: https://github.com/GhostPack/SharpUp 14 | sharpdump: 15 | category: ghostpack 16 | url: https://github.com/GhostPack/SharpDump 17 | safetykatz: 18 | category: ghostpack 19 | url: https://github.com/GhostPack/SafetyKatz 20 | sharproast: 21 | category: ghostpack 22 | url: https://github.com/GhostPack/SharpRoast 23 | sharpwmi: 24 | category: ghostpack 25 | url: https://github.com/GhostPack/SharpWMI 26 | sharpdpapi: 27 | category: ghostpack 28 | url: https://github.com/GhostPack/SharpDPAPI 29 | internam-monologue: 30 | category: windows 31 | url: https://github.com/eladshamir/Internal-Monologue 32 | sharphound: 33 | category: enumeration 34 | url: https://github.com/BloodHoundAD/SharpHound 35 | sharpclipboard: 36 | category: windows 37 | url: https://github.com/slyd0g/SharpClipboard.git -------------------------------------------------------------------------------- /threatbox_playbook.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - hosts: all 3 | become: true 4 | gather_facts: no #setupssh handles this. Allows the SSH port to be changed 5 | roles: 6 | - { role: setupssh, tags: [setupssh]} 7 | - { role: common, tags: [common]} 8 | - { role: tigervnc, tags: [tigervnc]} 9 | - { role: docker, tags: [docker]} 10 | - { role: powershell, tags: [powershell]} 11 | - { role: vscode, tags: [vscode]} 12 | - { role: proxychainsng, tags: [proxychainsng]} 13 | - { role: johntheripper, tags: [johntheripper]} 14 | - { role: metasploit, tags: [metasploit]} 15 | - { role: metasploit, tags: [metasploit]} 16 | - { role: silenttrinity, tags: [silenttrinity]} 17 | - { role: crackmapexec, tags: [crackmapexec]} 18 | - { role: domainhunter, tags: [domainhunter]} 19 | - { role: burpsuite, tags: [burpsuite]} 20 | - { role: bloodhound, tags: [bloodhound]} 21 | - { role: merlin, tags: [merlin]} 22 | - { role: mono, tags: [mono]} 23 | - { role: compiled_dotnet_projects, tags: [compiled_dotnet_projects]} 24 | - { role: dotnetcore, tags: [dotnetcore]} 25 | - { role: covenant, tags: [covenant]} 26 | - { role: impacket, tags: [impacket]} 27 | - { role: passwords, tags: [passwords]} 28 | - { role: final, tags: [final]} 29 | 30 | -------------------------------------------------------------------------------- /roles/merlin/tasks/main.yml: -------------------------------------------------------------------------------- 1 | ## tasks main.yml for role: merlin 2 | --- 3 | ## Note: Download of the source is controlled in the threatbox.yml file. 4 | ## It's best to enable all downloads in that file. 5 | ## This help to maintain software package tracking. 6 | 7 | ########################## 8 | ## Merlin 9 | - name: Set merlin path variable 10 | set_fact: 11 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 12 | loop: "{{ lookup('dict', direct_download_files) }}" 13 | when: "'merlin' in item.key" 14 | 15 | 16 | ### Check if tool_path exists 17 | - name: check for tool_path ({{ tool_path }}) 18 | stat: 19 | path: "{{ tool_path }}" 20 | register: tp 21 | 22 | 23 | - name: fail if tool_path ({{ tool_path }}) does not exist 24 | fail: msg="The directory does not exist" 25 | when: not tp.stat.exists 26 | 27 | 28 | - name: Uncompress merlin 29 | shell: "7z -y -pmerlin x {{ tool_path }}/{{ item.value.url | basename }}" 30 | loop: "{{ lookup('dict', direct_download_files) }}" 31 | when: "'merlin' in item.key" 32 | args: 33 | chdir: "{{ tool_path }}" 34 | 35 | 36 | - name: Setup Merlin Self Signed Certificate 37 | shell: "openssl req -new -newkey rsa:4096 -days 365 -nodes -x509 -subj '/C=US/ST=California/L=Cupertino/O=HQ/CN=www.apple.com' -keyout {{ tool_path }}/data/x509/server.key -out {{ tool_path }}/data/x509/server.crt" 38 | loop: "{{ lookup('dict', direct_download_files) }}" 39 | when: "'merlin' in item.key" 40 | args: 41 | chdir: "{{ tool_path }}" 42 | 43 | -------------------------------------------------------------------------------- /roles/crackmapexec/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: crackmapexec 3 | 4 | ########################## 5 | ## CrackMapExec 6 | 7 | - name: Set CrackMapExec path variable 8 | set_fact: 9 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 10 | loop: "{{ lookup('dict', git_repos) }}" 11 | when: "'crackmapexec' in item.key" 12 | 13 | 14 | ### Check if tool_path exists 15 | - name: check for tool_path ({{ tool_path }}) 16 | stat: 17 | path: "{{ tool_path }}" 18 | register: tp 19 | 20 | 21 | - name: fail if tool_path ({{ tool_path }}) does not exist 22 | fail: msg="The directory does not exist" 23 | when: not tp.stat.exists 24 | 25 | 26 | - name: Install CrackMapExec - clean current pipenv 27 | shell: "pipenv --rm" 28 | args: 29 | chdir: "{{ tool_path }}" 30 | ignore_errors: yes 31 | 32 | 33 | - name: Install CrackMapExec - set pipenv to python2.7 34 | shell: "pipenv --python 2.7" 35 | args: 36 | chdir: "{{ tool_path }}" 37 | 38 | 39 | - name: Install CrackMapExec - Remove Pipfile files (requirements.txt is the source of truth here) 40 | file: 41 | path: "{{ item }}" 42 | state: absent 43 | loop: 44 | - "{{ tool_path }}/Pipfile" 45 | - "{{ tool_path }}/Pipfile.lock" 46 | 47 | 48 | - name: Install CrackMapExec - pipenv install 49 | shell: "pipenv install" 50 | args: 51 | chdir: "{{ tool_path }}" 52 | async: 900 53 | poll: 30 54 | 55 | 56 | - name: Install CrackMapExec - python setup.py 57 | shell: "pipenv run python setup.py install" 58 | args: 59 | chdir: "{{ tool_path }}" 60 | async: 900 61 | poll: 30 62 | -------------------------------------------------------------------------------- /roles/domainhunter/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: domainhunter 3 | 4 | ########################## 5 | ## domainhunter 6 | 7 | - name: Set domainhunter path variable 8 | set_fact: 9 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 10 | loop: "{{ lookup('dict', git_repos) }}" 11 | when: "'domainhunter' in item.key" 12 | 13 | 14 | ### Check if tool_path exists 15 | - name: check for tool_path ({{ tool_path }}) 16 | stat: 17 | path: "{{ tool_path }}" 18 | register: tp 19 | 20 | 21 | - name: fail if tool_path ({{ tool_path }}) does not exist 22 | fail: msg="The directory does not exist" 23 | when: not tp.stat.exists 24 | 25 | 26 | - name: domainhunter - install required packages 27 | apt: 28 | name: "{{ item }}" 29 | state: present 30 | update_cache: yes 31 | loop: 32 | - tesseract-ocr 33 | - python3-pil 34 | 35 | 36 | - name: Install domainhunter - clean current pipenv 37 | shell: "pipenv --rm" 38 | args: 39 | chdir: "{{ tool_path }}" 40 | ignore_errors: yes 41 | 42 | 43 | - name: Install domainhunter - set pipenv to python3.7 44 | shell: "pipenv --python 3.7" 45 | args: 46 | chdir: "{{ tool_path }}" 47 | 48 | 49 | - name: Install domainhunter - Remove Pipfile files (requirements.txt is the source of truth here) 50 | file: 51 | path: "{{ item }}" 52 | state: absent 53 | loop: 54 | - "{{ tool_path }}/Pipfile" 55 | - "{{ tool_path }}/Pipfile.lock" 56 | 57 | 58 | - name: Install domainhunter - pipenv install 59 | shell: "pipenv install" 60 | args: 61 | chdir: "{{ tool_path }}" 62 | async: 900 63 | poll: 30 64 | 65 | -------------------------------------------------------------------------------- /roles/covenant/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: Covenant 3 | ## This role installs Covenant 4 | 5 | ########################### 6 | ## Build Covenant C2 with .net core 7 | 8 | ## Note: Download of the source is controlled in the threatbox.yml file. 9 | ## It's best to enable all downloads in that file. 10 | ## This help to maintain software package tracking. 11 | 12 | ## Covenant 13 | - name: Set Covenant path variable 14 | set_fact: 15 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 16 | loop: "{{ lookup('dict', git_repos) }}" 17 | when: "'covenant' in item.key" 18 | 19 | 20 | - name: check for tool_path ({{ tool_path }}) 21 | stat: 22 | path: "{{ tool_path }}" 23 | register: tp 24 | 25 | 26 | - name: fail if tool_path ({{ tool_path }}) does not exist 27 | fail: msg="The directory does not exist" 28 | when: not tp.stat.exists 29 | 30 | 31 | - name: Install Covenant 32 | command: dotnet build 33 | args: 34 | chdir: "{{ tool_path }}" 35 | 36 | 37 | ## Elite 38 | - name: Set Covenant path variable 39 | set_fact: 40 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 41 | loop: "{{ lookup('dict', git_repos) }}" 42 | when: "'elite' in item.key" 43 | 44 | 45 | - name: check for tool_path ({{ tool_path }}) 46 | stat: 47 | path: "{{ tool_path }}" 48 | register: tp 49 | 50 | 51 | - name: fail if tool_path ({{ tool_path }}) does not exist 52 | fail: msg="The directory does not exist" 53 | when: not tp.stat.exists 54 | 55 | 56 | - name: Install Elite 57 | command: dotnet build 58 | args: 59 | chdir: "{{ tool_path }}" 60 | 61 | -------------------------------------------------------------------------------- /roles/silenttrinity/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: silenttrinity 3 | 4 | ########################## 5 | ## SilentTrinity 6 | 7 | - name: Set SilentTrinity path variable 8 | set_fact: 9 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 10 | loop: "{{ lookup('dict', git_repos) }}" 11 | when: "'silenttrinity' in item.key" 12 | 13 | 14 | ### Check if tool_path exists 15 | - name: check for tool_path ({{ tool_path }}) 16 | stat: 17 | path: "{{ tool_path }}" 18 | register: tp 19 | 20 | 21 | - name: fail if tool_path ({{ tool_path }}) does not exist 22 | fail: msg="The directory does not exist" 23 | when: not tp.stat.exists 24 | 25 | 26 | - name: Install SilentTrinity - clean current pipenv 27 | shell: "pipenv --rm" 28 | args: 29 | chdir: "{{ tool_path }}" 30 | ignore_errors: yes 31 | 32 | 33 | - name: Install SilentTrinity - set pipenv to python3.7 34 | shell: "pipenv --python 3.7" 35 | args: 36 | chdir: "{{ tool_path }}" 37 | 38 | 39 | - name: Install SilentTrinity - Remove Pipfile files (requirements.txt is the source of truth here) 40 | file: 41 | path: "{{ item }}" 42 | state: absent 43 | loop: 44 | - "{{ tool_path }}/Pipfile" 45 | - "{{ tool_path }}/Pipfile.lock" 46 | 47 | 48 | - name: Install SilentTrinity - pipenv install 49 | shell: "pipenv install" 50 | args: 51 | chdir: "{{ tool_path }}" 52 | async: 900 53 | poll: 30 54 | 55 | 56 | - name: Install SilentTrinity - pipenv install impacket 57 | shell: "pipenv install -e git+https://github.com/SecureAuthCorp/impacket#egg=impacket" 58 | args: 59 | chdir: "{{ tool_path }}" 60 | async: 900 61 | poll: 30 62 | 63 | -------------------------------------------------------------------------------- /roles/common/templates/readme.tpl: -------------------------------------------------------------------------------- 1 | # THREATBOX 2 | 3 | ## Description 4 | 5 | THREATBOX is an example of a standard attack platform. The concept and use of a standard attack platform is outlined in the book Red Team Development and Operations https://redteam.guide 6 | 7 | ## Quick Reference 8 | 9 | Item | Value | Description 10 | --------------|-------------------------------------------|------------ 11 | Operator user | {{ operator_username }} | Default non-root user, has sudo rights 12 | Tools | {{ tools_root }} | Tools and git repository root directory 13 | Events | {{ logs_root }} | Event data root directory 14 | Readme | ~/Desktop/readme/ | Directory containing instance information. Includes installed software versions 15 | .Net Binaries | {{ tools_root }}/compiled_dotnet_projects | Some dotnet projects are compiled dynamically when the THREATBOX is built 16 | Passwords | {{ tools_root }}/rockyou | Rockyou password list 17 | pipenv | pipenv shell | Most python projects are installed using pipenv. Use `pipenv shell` in the project directory to access. See https://realpython.com/pipenv-guide/ for pipenv usage guidance. 18 | BurpSuite | BurpSuiteCommunity | Command starts BurpSuiteCommunity 19 | 20 | --------------------- 21 | ## THREATBOX Commands 22 | 23 | The following are commands that may help an operator. 24 | 25 | **Platform Functions** 26 | 27 | * `threatbox_help` - Display help 28 | * `my_ip` - Display the current local IP address 29 | * `external_ip` - Reachout to ifconfig.me to get external IP address 30 | * `netstati` - Get process using network communications 31 | * `ql` - Log passed parameters to ~/logs/quick_logs.txt 32 | * `powershell` - runs Microsoft PowerShell prompt 33 | * `get_timestamp` - Get current UTC timestamp 34 | * `webserver` - Quick webserver on port 8080 using twisted 35 | 36 | **Event Functions** 37 | 38 | Pass the event name as a parameter to any of the following functions. 39 | * `create_event ` 40 | * `backup_event ` 41 | * `archive_event ` 42 | * `remove_event ` 43 | 44 | **Console Display Theme** 45 | 46 | Console themes provide additions prompt information. 47 | Quick way to change the display of your console. 48 | Can be great for screenshots 49 | 50 | * `theme_default` - Default terminal prompt (DEFAULT) 51 | * `theme_neutral` - Dark text on light background, no color 52 | * `theme_dark` - Light text and terminal colors for dark background 53 | * `theme_light` - Dark text and terminal colors for light background -------------------------------------------------------------------------------- /roles/bloodhound/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: bloodhound 3 | ## This role installs bloodhound 4 | 5 | ########################## 6 | ## Install bloodhound 7 | 8 | ## Note: Download of the source is controlled in the threatbox.yml file. 9 | ## It's best to enable all downloads in that file. 10 | ## This help to maintain software package tracking. 11 | 12 | - name: Set bloodhound path variable 13 | set_fact: 14 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 15 | loop: "{{ lookup('dict', direct_download_files) }}" 16 | when: "'bloodhound' in item.key" 17 | 18 | 19 | ### Check if tool_path exists 20 | - name: check for tool_path ({{ tool_path }}) 21 | stat: 22 | path: "{{ tool_path }}" 23 | register: tp 24 | 25 | 26 | - name: fail if tool_path ({{ tool_path }}) does not exist 27 | fail: msg="The directory does not exist" 28 | when: not tp.stat.exists 29 | 30 | 31 | - name: bloodhound - install required packages 32 | apt: 33 | name: "{{ item }}" 34 | state: present 35 | update_cache: yes 36 | loop: 37 | - nodejs 38 | - npm 39 | 40 | 41 | - name: bloodhound - Add neo4j repo key 42 | apt_key: 43 | url: https://debian.neo4j.org/neotechnology.gpg.key 44 | state: present 45 | 46 | - name: bloodhound - Add neo4j repo 47 | apt_repository: 48 | repo: deb http://debian.neo4j.org/repo stable/ 49 | state: present 50 | 51 | - name: bloodhound - install neo4j package 52 | apt: 53 | name: "{{ item }}" 54 | state: present 55 | update_cache: yes 56 | loop: 57 | - neo4j 58 | 59 | 60 | - name: bloodhound - neo4j setup1 61 | shell: echo "dbms.active_database=graph.db" >> /etc/neo4j/neo4j.conf 62 | 63 | 64 | - name: bloodhound - neo4j setup2 65 | shell: echo "dbms.connector.http.address=0.0.0.0:7474" >> /etc/neo4j/neo4j.conf 66 | 67 | 68 | - name: bloodhound - neo4j setup3 69 | shell: echo "dbms.connector.bolt.address=0.0.0.0:7687" >> /etc/neo4j/neo4j.conf 70 | 71 | 72 | - name: bloodhound - neo4j setup4 73 | shell: echo "dbms.allow_format_migration=true" >> /etc/neo4j/neo4j.conf 74 | 75 | 76 | - name: Uncompress bloodhound release 77 | unarchive: 78 | src: "{{ tool_path }}/{{ item.value.url | basename }}" 79 | dest: "{{ tool_path }}" 80 | group: "{{ operator_username }}" 81 | owner: "{{ operator_username }}" 82 | remote_src: yes 83 | loop: "{{ lookup('dict', direct_download_files) }}" 84 | when: "'bloodhound' in item.key" 85 | 86 | 87 | # - name: bloodhoud - npm install -g electron-packager 88 | # shell: npm install -g electron-packager 89 | # args: 90 | # chdir: "{{ tool_path }}" 91 | # 92 | 93 | # - name: bloodhoud - npm install 94 | # shell: npm install 95 | # args: 96 | # chdir: "{{ tool_path }}" 97 | # async: 3600 98 | # poll: 20 99 | # 100 | 101 | # - name: bloodhoud - npm run linuxbuild 102 | # shell: npm run linuxbuild 103 | # args: 104 | # chdir: "{{ tool_path }}" 105 | # async: 3600 106 | # poll: 20 107 | # 108 | 109 | - name: bloodhound - neo4j start 110 | service: 111 | name: neo4j 112 | state: started 113 | -------------------------------------------------------------------------------- /roles/tigervnc/tasks/main.yml: -------------------------------------------------------------------------------- 1 | ## tasks main.yml for role: tigervnc 2 | --- 3 | ########################## 4 | ## Tiger VNC 5 | - name: Configure TigerVNC service 6 | copy: 7 | dest: /etc/systemd/system/vncserver@.service 8 | owner: root 9 | group: root 10 | content: | 11 | [Unit] 12 | Description=Start TigerVNC server for "{{ operator_username }}" user at startup 13 | After=syslog.target network.target 14 | 15 | [Service] 16 | Type=forking 17 | User={{ operator_username }} 18 | Group={{ operator_username }} 19 | WorkingDirectory=/home/{{ operator_username }} 20 | 21 | ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1 22 | ExecStart=/usr/bin/vncserver :%i -localhost no -geometry 1280x760 -SecurityType VncAuth 23 | ExecStop=/usr/bin/vncserver -kill :%i 24 | Restart=always 25 | RestartSec=5s 26 | 27 | [Install] 28 | WantedBy=multi-user.target 29 | # backup: yes 30 | 31 | 32 | - name: Set VNC password with vncpasswd 33 | raw: printf {{ vnc_password_cmd }} | vncpasswd 34 | become: yes 35 | become_user: "{{ operator_username }}" 36 | 37 | 38 | - name: Create Xresources file 39 | copy: 40 | content: "" 41 | dest: "/home/{{ operator_username }}/.Xresources" 42 | owner: "{{ operator_username }}" 43 | group: "{{ operator_username }}" 44 | force: no 45 | 46 | 47 | - name: Configure {{ operator_username }} vnc xstartup 48 | copy: 49 | dest: "/home/{{ operator_username }}/.vnc/xstartup" 50 | content: | 51 | #!/bin/bash 52 | 53 | xrdb $HOME/.Xresources 54 | vncconfig -nowin & 55 | startxfce4 & 56 | #backup: yes 57 | 58 | 59 | - name: Make xstartup executable 60 | file: 61 | path: "/home/{{ operator_username }}/.vnc/xstartup" 62 | owner: "{{ operator_username }}" 63 | group: "{{ operator_username }}" 64 | mode: 0755 65 | 66 | 67 | - name: Set owner to user for all files in home directory 68 | file: 69 | dest: "/home/{{ operator_username }}" 70 | owner: "{{ operator_username }}" 71 | group: "{{ operator_username }}" 72 | recurse: yes 73 | 74 | 75 | - name: Chown VNC password file to {{ operator_username }} user 76 | file: 77 | path: "/home/{{ operator_username }}/.vnc/passwd" 78 | owner: "{{ operator_username }}" 79 | group: "{{ operator_username }}" 80 | 81 | 82 | - name: Enable VNC service on startup 83 | systemd: 84 | enabled: yes 85 | daemon_reload: yes 86 | name: vncserver@1 87 | 88 | - name: Start vnc service, if not started 89 | service: 90 | name: vncserver@1 91 | state: started 92 | 93 | 94 | - name: Chown VNC password file to {{ operator_username }} user 95 | file: 96 | path: "/home/{{ operator_username }}/" 97 | state: directory 98 | recurse: yes 99 | owner: "{{ operator_username }}" 100 | group: "{{ operator_username }}" 101 | 102 | 103 | - name: Chown VNC password file to {{ operator_username }} user 104 | file: 105 | path: "/run/user/" 106 | state: directory 107 | recurse: yes 108 | owner: "{{ operator_username }}" 109 | group: "{{ operator_username }}" 110 | -------------------------------------------------------------------------------- /roles/setupssh/tasks/main.yml: -------------------------------------------------------------------------------- 1 | ## tasks main.yml for role: setupssh 2 | --- 3 | # This role dynamically changes the target's ssh port. 4 | # It start's with the assumption SSH is on 22. Updates the config. And executes ansible on the new port. 5 | # The change is permanent. If the playbook is executed again, a test is performed to determine the correct SSH port. 6 | # Reference : https://dmsimard.com/2016/03/15/changing-the-ssh-port-with-ansible/ 7 | 8 | - debug: 9 | msg: Starting SSH config # not required. The customized message that is printed. If omitted, prints a generic message. 10 | 11 | # ansible_port can change throughout this role, keep a copy around 12 | - name: Set configured port ({{ ansible_port }}) fact 13 | set_fact: 14 | configured_port: "{{ ansible_port }}" 15 | 16 | 17 | # From localhost, check if we're able to reach {{ inventory_hostname }} on 18 | # port 22 19 | - name: Check if we're using the default SSH port 20 | wait_for: 21 | port: "22" 22 | state: "started" 23 | host: "{{ inventory_hostname }}" 24 | connect_timeout: "5" 25 | timeout: "10" 26 | delegate_to: "localhost" 27 | ignore_errors: "yes" 28 | register: default_ssh 29 | become: no 30 | 31 | # If reachable, continue the following tasks with this port 32 | - name: Set inventory ansible_port to default port 22 33 | set_fact: 34 | ansible_port: "22" 35 | when: default_ssh is defined and 36 | default_ssh.state is defined and 37 | default_ssh.state == "started" 38 | register: ssh_port_set 39 | 40 | # If unreachable on port 22, check if we're able to reach 41 | # {{ inventory_hostname }} on {{ ansible_port }} provided by the inventory 42 | # from localhost 43 | - name: Check if we're using the inventory-provided SSH port ({{ ansible_port }}) 44 | wait_for: 45 | port: "{{ ansible_port }}" 46 | state: "started" 47 | host: "{{ inventory_hostname }}" 48 | connect_timeout: "5" 49 | timeout: "10" 50 | become: no 51 | delegate_to: "localhost" 52 | ignore_errors: "yes" 53 | register: configured_ssh 54 | when: default_ssh is defined and 55 | default_ssh.state is defined and 56 | default_ssh.state == "started" 57 | 58 | # If {{ ansible_port }} is reachable, we don't need to do anything special 59 | - name: SSH port ({{ ansible_port }}) is configured properly 60 | debug: 61 | msg: "SSH port is configured properly" 62 | when: configured_ssh is defined and 63 | configured_ssh.state is defined and 64 | configured_ssh.state == "started" 65 | register: ssh_port_set 66 | 67 | # If the SSH port is neither the default or the configured, give up. 68 | - name: Fail if SSH port was not auto-detected (unknown) 69 | fail: 70 | msg: "The SSH port is neither 22 or {{ ansible_port }}." 71 | when: ssh_port_set is undefined 72 | 73 | # Sanity check, make sure Ansible is able to connect to the host 74 | - name: Confirm host connection works 75 | ping: 76 | 77 | - name: Setup alternate SSH port ({{ configured_port }}) 78 | lineinfile: 79 | dest: "/etc/ssh/sshd_config" 80 | regexp: "^Port" 81 | line: "Port {{ configured_port }}" 82 | notify: "Restart sshd" 83 | become: yes 84 | 85 | # We notified "Restart sshd" if we modified the sshd config. 86 | # By calling flush_handlers, we make sure the handler is run *right now* 87 | - name: Ensure SSH is reloaded if need be 88 | meta: flush_handlers 89 | 90 | # We're done, make sure ansible_port is set properly so that any tasks 91 | # after this use the right ansible_port. 92 | - name: Ensure we use the configured SSH port ({{ configured_port }}) for the remainder of the role 93 | set_fact: 94 | ansible_port: "{{ configured_port }}" 95 | cacheable: yes 96 | 97 | # Gather facts should be set to false when running this role since it will 98 | # fail if the Ansible SSH port is not set correctly. 99 | # We run setup to gather facts here once the SSH port is set up. 100 | - name: Run deferred setup to gather facts 101 | setup: 102 | 103 | #### End of SSH Config 104 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # Threatbox - Standard Attack Platform 2 | 3 | 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 to be the next natural evolution to the configuration of standard attack platforms. 4 | 5 | This project uses ansible playbooks and roles to perform post deployment configuration on a linux target (Tested on Ubuntu 18.04). 6 | 7 | The project is designed to be used as a starter process in creating, managing, and using a standard attack platform for red teaming or penetration testing. 8 | 9 | Detail on the concept of a Standard Attack Platform can be found it the book Red Team Development and Operations - A practical guide, written by Joe Vest and James Tubberville. ![Red Team Guide](http:redteam.guide) 10 | 11 | ![ThreatBox](images/threatbox.png) 12 | ------------------------------------ 13 | ## Features 14 | 15 | - Standard tools defined as ansible roles 16 | - Customizations designed to make security testing easier 17 | - Variable list to add or remove git repositories, OS packages, or python modules. (threatbox.yml) 18 | - Version tracking of the deployed instance version and the deploy tool version. This is helpful it meeting compliance rules and can help minimize fear by actively tracking all tools. 19 | - Threatbox version created at deployment and displayed in desktop wallpaper 20 | - Deployed software tracked in ~/Desktop/readme 21 | - SSH port auto-switching. The deployment starts on port 22, but reconfigures the target system to the desired SSH port using the `ansible_port` variable in `threatbox.yml` 22 | - Download and compile several .net toolkits (i.e. SeatBelt.exe from Ghostpack https://github.com/GhostPack/Seatbelt) 23 | - Most python projects installed using pipenv. Use `pipenv shell` in the project directory to access. See https://realpython.com/pipenv-guide/ for pipenv usage guidance 24 | ------------------------------------ 25 | ## Project Files 26 | 27 | The following list highlights key components of this project. 28 | 29 | File/Directory | Description | Usage 30 | ------------------------------------|---------------------------------------------------|------ 31 | host | Ansible hosts file | Update with IP addresses of target ansible systems 32 | group_vars/threatbox.yml | common variables | variable used for the project. update as needed. 33 | threatbox_playbox.yml | Primary ansible playbook | Update as need to add additional roles or features 34 | roles/common | Common OS platform configuration | Setup common OS settings (i.e set version in background or build) 35 | roles/. | other specific roles to configure or deploy tools | add or modify roles in roles/ 36 | 37 | ------------------------------------ 38 | ## Quickstart 39 | 40 | ### Provision 41 | 42 | Provision one or more targets. 43 | 44 | *Note: This project was tested on Ubuntu 18.04 deployed in Digitalocean* 45 | 46 | ### Configuration 47 | 48 | 1) Copy `hosts.sample` to `hosts` 49 | 2) Edit `hosts` with the IP(s) of your target systems 50 | 3) Copy `group_vars\threatbox.yml.sample` to `group_vars\threatbox.yml` 51 | 4) Edit `group_vars\threatbox.yml` with the updated variables you would like to use 52 | - Don't forget to update SSH key with a key that has access to the remote target 53 | 54 | ### Ansible commands 55 | 56 | ``` 57 | # OSX issue https://github.com/ansible/ansible/issues/32499 58 | if [[ "$(uname)" == "Darwin" ]] 59 | then 60 | export OBJC_DISABLE_INITIALIZE_FORK_SAFETY=yes; 61 | fi 62 | 63 | # Ansible Logging 64 | rm ./ansible.log 65 | export ANSIBLE_LOG_PATH="ansible.log" 66 | 67 | # Ansible Debugging 68 | export ANSIBLE_DEBUG=False 69 | 70 | # Execute playbook 71 | ansible-playbook -e ansible_python_interpreter=/usr/bin/python3 -i hosts threatbox_playbook.yml 72 | ``` 73 | 74 | *Note: Consider using Mitogen for Ansible to gain a significant performance boost. https://mitogen.networkgenomics.com/ansible_detailed.html* 75 | 76 | ### Tested with this ansible.cfg 77 | 78 | ``` 79 | [defaults] 80 | host_key_checking = False 81 | pipelining = True 82 | forks = 100 83 | timeout = 600 84 | stdout_callback = yaml 85 | bin_ansible_callbacks = True 86 | callback_whitelist = profile_roles, profile_tasks, timer 87 | 88 | #mitogen 89 | strategy_plugins = ~/Documents/mitogen-0.2.9/ansible_mitogen/plugins/strategy 90 | strategy = mitogen_linear 91 | ``` 92 | 93 | ------------------------------------ 94 | ## Remotely Access the system 95 | 96 | ### Console access with SSH 97 | 98 | Note: SSH may be set to a non-standard port during setup. This value is set in the `group_vars/threatbox.yml` files 99 | 100 | ``` 101 | threatboxip=10.10.10.10 102 | sshport=52222 103 | ssh -p $sshport -i ~/.ssh/threatbox_id_rsa root@$threatboxip 104 | ``` 105 | 106 | ### GUI Access with VNC over SSH 107 | 108 | Note: VNC is setup but not allowed over the network. You must use an SSH tunnel to access. 109 | 110 | ``` 111 | threatboxip=10.10.10.10 112 | sshport=52222 113 | ssh -p $sshport -i ~/.ssh/threatbox_id_rsa -L 5901:localhost:5901 root@$threatboxip 114 | ``` 115 | 116 | --- 117 | ## Notes on the project 118 | 119 | This project uses ansbile roles. These roles may not exactly follow the ansible style. They were designed to be used as part of this project and use a single 'variable' file to control the project. The roles can easily be used in other project with minor tweaks. 120 | 121 | --- 122 | ## Features 123 | 124 | ThreatBox Custom Commands ![ThreatBox Help](images/help.png) 125 | 126 | Tool Categories ![Tool Categories](images/tool_category.png) 127 | 128 | Tracking of all installed tools ![Tool Tracking](images/tool_tracking.png) 129 | 130 | Automatic terminal logging ![Teminal Loggind](images/terminal_logs.png) 131 | 132 | Custom terminal options provide more context ![](images/custom_terminal.png) 133 | 134 | Light version of the terminal ![](images/light_terminal.png) 135 | 136 | Pipenv keep Python projects independent ![pipenv shell](images/pipenv_shell.png) 137 | 138 | Example of SilentTrinity running in pipenv environment ![silenttrinity](images/pipenv.png) 139 | -------------------------------------------------------------------------------- /roles/common/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: common 3 | ## This is the common role for this project. It setups the environment and preps the target for the other roles. 4 | 5 | ########################## 6 | ## OS Settings 7 | 8 | - name: Create /etc/skel/.config if non-existent 9 | file: 10 | path: "/etc/skel/.config" 11 | state: directory 12 | 13 | - name: update xfce /etc/skel files 14 | unarchive: 15 | src: skel_xfce.tar.gz 16 | dest: /etc/skel/.config 17 | 18 | - name: Create {{ operator_username }} user 19 | user: 20 | name: "{{ operator_username }}" 21 | password: "{{ operator_password }}" 22 | groups: sudo 23 | state: present 24 | shell: /bin/bash # Defaults to /bin/bash 25 | system: no # Defaults to no 26 | createhome: yes # Defaults to yes 27 | home: /home/{{ operator_username }} # Defaults to /home/ 28 | 29 | - name: Create file to allow passwordless sudo for {{ operator_username }} 30 | blockinfile: 31 | create: yes 32 | path: /etc/sudoers.d/{{ operator_username }} 33 | block: "{{ operator_username }} ALL=(ALL) NOPASSWD:ALL" 34 | 35 | - name: Create necessary directories if non-existent 36 | file: 37 | path: "{{ item }}" 38 | state: directory 39 | owner: "{{ operator_username }}" 40 | group: "{{ operator_username }}" 41 | mode: 0750 42 | loop: "{{ required_directories }}" 43 | 44 | - name: Prepare apt for package installs 45 | apt: 46 | force_apt_get: yes 47 | update_cache: yes 48 | upgrade: dist 49 | autoremove: yes 50 | autoclean: yes 51 | 52 | - name: Install aptitude using apt 53 | apt: name=aptitude state=latest update_cache=yes force_apt_get=yes 54 | 55 | - name: Install packages 56 | apt: 57 | name: "{{ software_packages }}" 58 | state: present 59 | update_cache: yes 60 | 61 | ## Python 62 | - name: Install pip3.7 pip 63 | shell: python3.7 -m pip install pip --upgrade 64 | 65 | - name: Set python3.6 as default 66 | shell : | 67 | update-alternatives --install /usr/bin/python python /usr/bin/python3.7 1 && 68 | update-alternatives --install /usr/bin/python python /usr/bin/python3.6 2 && 69 | update-alternatives --install /usr/bin/python python /usr/bin/python2.7 3 && 70 | update-alternatives --set python /usr/bin/python3.6 71 | 72 | - name: Install python2.7 modules 73 | pip: 74 | state: latest 75 | executable: pip2 76 | name: "{{ python_modules }}" 77 | 78 | - name: Install python3.6 modules 79 | pip: 80 | state: latest 81 | executable: pip3.6 82 | name: "{{ python_modules }}" 83 | 84 | - name: Install python3.7 modules 85 | pip: 86 | state: latest 87 | executable: pip3.7 88 | name: "{{ python_modules }}" 89 | 90 | ########################## 91 | ## Firewall 92 | - name: Allow SSH in UFW 93 | ufw: rule=allow port=22 proto=tcp 94 | 95 | - name: Allow SSH alternate port in UFW 96 | ufw: rule=allow port={{ ansible_port }} proto=tcp 97 | 98 | - name: Allow MOSH ports in UFW 99 | ufw: rule=allow port=60000:61000 proto=udp 100 | 101 | - name: Set firewall default policy 102 | ufw: state=enabled policy=reject 103 | 104 | ########################## 105 | ## Background 106 | - name: Update background base image 107 | copy: 108 | src: background.jpg 109 | dest: /usr/share/backgrounds/xfce/background.jpg 110 | owner: root 111 | mode: "0644" 112 | 113 | - name: Get THREATBOX repo git commit 114 | shell: git rev-parse HEAD 115 | delegate_to: localhost 116 | become: no 117 | register: threatbox_version 118 | 119 | - name: Add THREATBOX version to background image 120 | shell: convert /usr/share/backgrounds/xfce/background.jpg -fill yellow -gravity North -pointsize 20 -annotate +95+500 'Version:{{ threatbox_version.stdout }}' -fill yellow -gravity North -pointsize 20 -annotate -55+530 'https://redteam.guide' /usr/share/backgrounds/xfce/xfce-blue.jpg 121 | 122 | - name: Add THREATBOX redteam.guide link to background image 123 | shell: convert /usr/share/backgrounds/xfce/background.jpg -fill yellow -gravity North -pointsize 20 -annotate +95+500 'Version:{{ threatbox_version.stdout }}' -fill yellow -gravity North -pointsize 20 -annotate -55+530 'https://redteam.guide' /usr/share/backgrounds/xfce/xfce-teal.jpg 124 | 125 | ########################## 126 | ## Repositories 127 | 128 | - name: Clone git repositories 129 | git: 130 | repo: "{{ item.value.url }}" 131 | dest: "{{ tools_root }}/{{ item.value.category}}/{{ item.key }}" 132 | version: "{{ item.value.version }}" 133 | recursive: yes 134 | update: no # Do not pull if the repo exists. Note: This will not update current repo 135 | depth: 1 136 | with_dict: 137 | "{{ git_repos }}" 138 | async: 240 139 | poll: 20 140 | 141 | ######################### 142 | # Direct file downloads 143 | 144 | - name: Create directories for direct download files 145 | file: 146 | path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}" 147 | state: directory 148 | owner: "{{ operator_username }}" 149 | group: "{{ operator_username }}" 150 | mode: 0750 151 | with_dict: "{{ direct_download_files }}" 152 | 153 | - name: Download direct download files 154 | get_url: 155 | url: "{{ item.value.url }}" 156 | dest: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}" 157 | owner: "{{ operator_username }}" 158 | group: "{{ operator_username }}" 159 | validate_certs: false 160 | #force: yes 161 | mode: 0755 162 | with_dict: "{{ direct_download_files }}" 163 | async: 3600 164 | poll: 20 165 | 166 | - name: Set download file url as variable for reference later. 167 | set_fact: 168 | "{{ item.key }}": "{{ item.value.url }}" 169 | with_dict: "{{ direct_download_files }}" 170 | 171 | ########################## 172 | ## THREATBOX documentation 173 | - name: Add THREATBOX documentation readme.md 174 | template: 175 | src: readme.tpl 176 | dest: "/home/{{ operator_username }}/Desktop/readme/readme.md" 177 | owner: "{{ operator_username }}" 178 | mode: "0644" 179 | 180 | - name: Add THREATBOX documentation git_repositories.md 181 | template: 182 | src: git_repositories.tpl 183 | dest: "/home/{{ operator_username }}/Desktop/readme/git_repositories.md" 184 | owner: "{{ operator_username }}" 185 | mode: "0644" 186 | 187 | - name: Add THREATBOX documentation direct_download_files.md 188 | template: 189 | src: direct_download_files.tpl 190 | dest: "/home/{{ operator_username }}/Desktop/readme/direct_download_files.md" 191 | owner: "{{ operator_username }}" 192 | mode: "0644" 193 | 194 | - name: Add THREATBOX documentation list to direct_download_files.md 195 | shell: echo {{ item.key }} | tr -d '\n' && echo " | " | tr -d '\n' && echo {{ item.value.url }} >> /home/{{ operator_username }}/Desktop/readme/direct_download_files.md 196 | with_dict: "{{ direct_download_files }}" 197 | 198 | - name: Add THREATBOX documentation git repo software list 199 | shell: cd {{ tools_root }}/{{ item.value.category }}/{{ item.key }} && a=`git rev-parse HEAD | tr -d '\n' && echo " | " | tr -d '\n' && git show -s --format=%ci HEAD | tr -d '\n' && echo " | " | tr -d '\n'&& git config --get remote.origin.url` && echo $a >> /home/{{ operator_username }}/Desktop/readme/git_repositories.md 200 | with_dict: "{{ git_repos }}" 201 | 202 | - name: Add THREATBOX documentation software_packages.md 203 | template: 204 | src: software_packages.tpl 205 | dest: "/home/{{ operator_username }}/Desktop/readme/software_packages.md" 206 | owner: "{{ operator_username }}" 207 | mode: "0644" 208 | 209 | - name: Add THREATBOX documentation software package list 210 | args: 211 | chdir: "{{ tools_root }}" 212 | shell: apt list --installed >> /home/{{ operator_username }}/Desktop/readme/software_packages.md 213 | 214 | - name: Add THREATBOX documentation python_modules.md 215 | template: 216 | src: python_modules.tpl 217 | dest: "/home/{{ operator_username }}/Desktop/readme/python_modules.md" 218 | owner: "{{ operator_username }}" 219 | mode: "0644" 220 | 221 | - name: Add THREATBOX documentation python modules 222 | shell: pip freeze >> /home/{{ operator_username }}/Desktop/readme/python_modules.md 223 | 224 | ########################## 225 | ## THREATBOX bashrc settings 226 | - name: Add .bash_aliases reference to {{ operator_username }} 227 | template: 228 | src: bash_aliases.tpl 229 | dest: "/home/{{ operator_username }}/.bash_aliases" 230 | mode: "0644" 231 | 232 | - name: Add .bash_aliases reference to root 233 | template: 234 | src: bash_aliases.tpl 235 | dest: "/root/.bash_aliases" 236 | mode: "0644" 237 | 238 | - name: Add redteamops.rc to {{ operator_username }} 239 | copy: 240 | src: redteamops.rc 241 | dest: "/home/{{ operator_username }}/.redteamops.rc" 242 | owner: "{{ operator_username }}" 243 | mode: "0644" 244 | 245 | - name: Add redteamops.rc to root 246 | copy: 247 | src: redteamops.rc 248 | dest: "/root/.redteamops.rc" 249 | owner: root 250 | mode: "0644" 251 | 252 | 253 | -------------------------------------------------------------------------------- /roles/common/files/redteamops.rc: -------------------------------------------------------------------------------- 1 | ################################## 2 | # THREATBOX custom terminal settings, functions, and other operator tips 3 | 4 | # Test data directories 5 | [ ! -d $HOME/logs ] && mkdir $HOME/logs 6 | [ ! -d $HOME/logs/screenshots ] && mkdir -p $HOME/logs/screenshots 7 | [ ! -d $HOME/logs/terminals ] && mkdir -p $HOME/logs/terminals 8 | 9 | # enable color support of ls and also add handy aliases 10 | if [ -x /usr/bin/dircolors ]; then 11 | test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" 12 | alias ls='ls --color=auto' 13 | alias dir='dir --color=auto' 14 | alias grep='grep --color=auto' 15 | fi 16 | 17 | # Aliases 18 | alias ll='ls -alF' 19 | alias la='ls -A' 20 | alias l='ls -CF' 21 | alias treedir="ls -Ra | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'" 22 | alias webserver='twistd -no web --path .' 23 | 24 | function mkcd() { 25 | mkdir -p "$@" 26 | cd "$@" 27 | } 28 | 29 | 30 | function get_timestamp { 31 | # Get UTC timestamp 32 | echo $(date '+%Y-%m-%d %H:%M:%S %Z') 33 | } 34 | 35 | function my_ip { 36 | # Get current local IP addresses 37 | /sbin/ip -4 addr show | grep 'inet ' | grep 'eth0' | awk '{ print $2 }' | tr '\n' ' ' 38 | } 39 | 40 | function ql { 41 | # Save a log to ~/logs/quick_logs.txt 42 | echo $(get_timestamp) - $(USER) [$(my_ip)] - $@ | tee -a ~/logs/quick_logs.txt 43 | } 44 | 45 | 46 | # # Encrypted Tools 47 | # function mount_tools() { 48 | # TOOLSDIR="/tools" 49 | # if [ -f "$HOME/.toolspw" ]; then 50 | # mountphrase=$(cat ${HOME}/.toolspw) 51 | # else 52 | # echo -n "Mount passphrase: " 53 | # read -s mountphrase 54 | # fi 55 | # printf "%s" "${mountphrase}" | ecryptfs-add-passphrase > /tmp/tmp.txt 56 | # sig=`tail -1 /tmp/tmp.txt | awk '{print $6}' | sed 's/\[//g' | sed 's/\]//g'` 57 | # rm -f /tmp/tmp.txt 58 | # mount -t ecryptfs -o key=passphrase:passphrase_passwd=${mountphrase},no_sig_cache=yes,verbose=no,ecryptfs_fnek_sig=${sig},ecryptfs_sig=${sig},ecryptfs_cipher=aes,ecryptfs_key_bytes=16,ecryptfs_passthrough=no,ecryptfs_enable_filename_crypto=yes $TOOLSDIR $TOOLSDIR 59 | # unset mountphrase 60 | # if [ ! -f "${TOOLSDIR}/.success" ]; then 61 | # echo "Bad password." 62 | # umount /tools 63 | # fi 64 | # } 65 | 66 | # alias unmount_tools="umount /tools" 67 | 68 | CURDATE=`date '+%Y%m%d_%H%M%S.%N_%Z'` 69 | 70 | # Get External IP address 71 | alias external_ip="curl ifconfig.me" 72 | 73 | # Get process using network communications 74 | alias netstati="lsof -P -i -n" 75 | 76 | # Make history more readable. 77 | HISTTIMEFORMAT="%F %T " 78 | 79 | ############################ 80 | # Colors 81 | BLACK=$(tput setaf 0) 82 | RED=$(tput setaf 1) 83 | GREEN=$(tput setaf 2) 84 | YELLOW=$(tput setaf 3) 85 | BLUE=$(tput setaf 4) 86 | MAGENTA=$(tput setaf 5) 87 | CYAN=$(tput setaf 6) 88 | WHITE=$(tput setaf 7) 89 | BRIGHT=$(tput bold) 90 | NORMAL=$(tput sgr0) 91 | BLINK=$(tput blink) 92 | REVERSE=$(tput smso) 93 | UNDERLINE=$(tput smul) 94 | 95 | # Color Themes 96 | #DEFAULT='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' 97 | DEFAULT="[\[\D{%Y-%m-%d %T%z} ${debian_chroot:+($debian_chroot)}\u@\h:\w\]]\$ " 98 | PS1=$DEFAULT 99 | 100 | # Top curve color - Checkbox color ( green or red ) - Reset color - timestamp color - user/host color - IP color - downbar color - curdir color - reset color - text color 101 | DARK="\n\[$WHITE\]╭ [\$(if [[ \$? == 0 ]]; then echo \"\[$GREEN\]✓\"; else echo \"\[$RED\]✕\"; fi) \[$WHITE\]\[$YELLOW\]\D{%Y-%m-%d %T%z} \[$WHITE\]\u@\h \[${CYAN}\]$(my_ip)\[$WHITE\]]\n├ [\[$GREEN\]\w\[$WHITE\]]\n\[$WHITE\]╰ " 102 | LIGHT="\n\[$BLACK\]╭ [\$(if [[ \$? == 0 ]]; then echo \"\[$GREEN\]✓\"; else echo \"\[$RED\]✕\"; fi) \[$BLACK\]\[$BLUE\]\D{%Y-%m-%d %T%z} \[$BLACK\]\u@\h \[${CYAN}\]$(my_ip)\[$BLACK\]]\n├ [\[$GREEN\]\w\[$WHITE\]]\n\[$BLACK\]╰ " 103 | NEUTRAL="\n\[$BLACK\]╭ [\$(if [[ \$? == 0 ]]; then echo \"\[$BLACK\]✓\"; else echo \"\[$BLACK\]✕\"; fi) \[$BLACK\]\[$BLACK\]\D{%Y-%m-%d %T%z} \[$BLACK\]\u@\h \[${BLACK}\]$(my_ip)\[$BLACK\]]\n├ [\[$BLACK\]\w\[$BLACK\]]\n\[$BLACK\]╰ " 104 | 105 | THEME=$DEFAULT 106 | PS1=$THEME 107 | 108 | # Set theme for default prompt 109 | function theme_default() { 110 | if [ "$EUID" -ne 0 ]; then 111 | p="$ " 112 | PS1=$DEFAULT$p 113 | setterm --inversescreen off 114 | else 115 | p="# " 116 | PS1=$DEFAULT$p 117 | setterm --inversescreen off 118 | fi 119 | 120 | } 121 | 122 | # Set theme for neutral prompt 123 | function theme_neutral() { 124 | if [ "$EUID" -ne 0 ]; then 125 | p="$ " 126 | PS1=$NEUTRAL$p 127 | setterm --inversescreen on 128 | else 129 | p="# " 130 | PS1=$NEUTRAL$p 131 | setterm --inversescreen on 132 | fi 133 | 134 | } 135 | 136 | # Set theme for light background 137 | function theme_light() { 138 | if [ "$EUID" -ne 0 ]; then 139 | p="$ " 140 | PS1=$LIGHT$p 141 | setterm --inversescreen on 142 | else 143 | p="# " 144 | PS1=$LIGHT$p 145 | setterm --inversescreen on 146 | fi 147 | 148 | } 149 | 150 | # Set theme for dark background 151 | function theme_dark() { 152 | if [ "$EUID" -ne 0 ]; then 153 | p="$ " 154 | PS1=$DARK$p 155 | setterm --inversescreen off 156 | else 157 | p="# " 158 | PS1=$DARK$p 159 | setterm --inversescreen off 160 | 161 | fi 162 | 163 | } 164 | 165 | # Attack Platform Help 166 | function threatbox_help() { 167 | 168 | echo " 169 | ********************* 170 | Attack Platform Guide 171 | ********************* 172 | HOSTNAME: $(hostname) 173 | IP $(my_ip) 174 | 175 | Platform Terminal Functions 176 | --------------------------- 177 | Platform Functions 178 | * threatbox_help - Display this help 179 | * my_ip - Display the current IP address 180 | * external_ip - Reachout to ifconfig.me to get external IP address 181 | * netstati - Get process using network communications 182 | * ql - Log passed parameters to ~/logs/quick_logs.txt 183 | * powershell - runs Microsoft PowerShell prompt 184 | * get_timestamp - Get current UTC timestamp 185 | * webserver - Quick webserver on port 8080 using twisted 186 | 187 | Event Functions 188 | Pass the event name as a parameter to any of the following functions. 189 | * create_event 190 | * backup_event 191 | * archive_event 192 | * remove_event 193 | 194 | Console Display Theme 195 | 196 | Console themes provide additions prompt information. (Great for screenshots) 197 | 198 | * theme_default - Default terminal prompt (DEFAULT) 199 | * theme_neutral - Dark text on light background, no color 200 | * theme_dark - Light text and terminal colors for dark background 201 | * theme_light - Dark text and terminal colors for light background 202 | " 203 | } 204 | 205 | 206 | 207 | ######################################### 208 | # Event Management 209 | export EVENT_DIR="/data" 210 | export EVENT_BACKUP="/data/backups" 211 | 212 | # Ensure directories are available 213 | [ ! -d $EVENT_DIR ] && mkdir -p $EVENT_DIR 214 | [ ! -d $EVENT_BACKUP ] && mkdir -p $EVENT_BACKUP 215 | 216 | function sanitize_name() { 217 | event_name=$(echo "${@//[^a-zA-Z0-9_-]/}" | sed 's/\ /_/g') 218 | echo $event_name 219 | } 220 | 221 | convert_name() { 222 | if [ $# -eq 0 ] 223 | then 224 | echo "No arguments supplied" 225 | fi 226 | 227 | if [ -z "$1" ] 228 | then 229 | echo "No argument supplied" 230 | fi 231 | sanitize_name $@ 232 | } 233 | 234 | function create_event() { 235 | echo "Creating event $@" 236 | event="$(convert_name $@)" 237 | if [ -d ${EVENT_DIR}/$event ]; then 238 | echo "Event directory already present. Aborting" 239 | return 240 | fi 241 | cp -a /etc/event_skeleton ${EVENT_DIR}/$event 242 | } 243 | 244 | function backup_event() { 245 | echo "Backing up event $@" 246 | event="$(convert_name $@)" 247 | if [ ! -d ${EVENT_DIR}/$event ]; then 248 | echo "Event not found" 249 | return 250 | fi 251 | [ ! -d $EVENT_BACKUP ] && mkdir -p $EVENT_BACKUP 252 | curdate=$(date '+%Y%m%d_%H%M%S%Z') 253 | tar cjpf ${EVENT_BACKUP}/${curdate}_${event}_backup.tbz -C ${EVENT_DIR} $event 254 | echo "Event backed up to ${EVENT_BACKUP}/${curdate}_${event}_backup.tbz" 255 | } 256 | 257 | function remove_event() { 258 | echo "Removing event $@" 259 | event="$(convert_name $@)" 260 | if [ ! -d "${EVENT_DIR}/$event" ]; then 261 | echo "Event not found" 262 | return 263 | fi 264 | rm -fr ${EVENT_DIR}/$event 265 | echo "Event removed" 266 | } 267 | 268 | function archive_event() { 269 | echo "Archiving event $@" 270 | event="$(convert_name $@)" 271 | if [ ! -d "${EVENT_DIR}/$event" ]; then 272 | echo "Event not found" 273 | return 274 | fi 275 | TARGET_FILE="${EVENT_DIR}/${curdate}_${event}_archive.tbz" 276 | tar cjpf $TARGET_FILE -C ${EVENT_DIR} $event 277 | remove_event $event 278 | echo "Event archived to ${TARGET_FILE}." 279 | } 280 | 281 | ## Terminal logging 282 | array=("gnome-terminal-" "gnome-terminal" "tmux" "termin" "x-term" "xfce4-terminal" "terminator") 283 | search_string=`basename $(ps -f -p $PPID -o comm=)` 284 | match=$(echo "${array[@]:0}" | grep -o $search_string) 285 | 286 | if [[ $TERM == "xterm"* ]] && [[ ! -z $match ]]; then 287 | logname="${HOME}/logs/terminals/${CURDATE}.terminal.log" 288 | printf "This is a logged terminal session....\n" 289 | script -f ${logname}.raw 290 | cat ${logname}.raw | perl -pe 's/\e([^\[\]]|\[.*?[a-zA-Z]|\].*?\a)//g' | col -b > ${logname} 291 | exit 292 | fi -------------------------------------------------------------------------------- /group_vars/threatbox.yml.sample: -------------------------------------------------------------------------------- 1 | # file: group_vars/threatbox.yml 2 | ######################## 3 | # Ansible Variables 4 | ansible_user: root 5 | ansible_ssh_private_key_file: ~/.ssh/threatbox_id_rsa 6 | # NOTE: This project will start on Port 22 and update the SSH configuration to this port 7 | ansible_port: "52222" 8 | 9 | 10 | ######################## 11 | # Platform variables 12 | 13 | # Ubuntu version 14 | ubuntu_version: "bionic" 15 | 16 | # Default user 17 | 18 | operator_username: "operator" 19 | #https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module 20 | # Clear password: 'operatorPassword123!@#' 21 | operator_password: '$6$o3Td5VWG4Ouf.TzZ$FKp3XkAMT0T4ntaGXKFSo414pzyJHFGrAekd6NVRqY3lvT6PB.X9m7D119xv.vwmKrBL38pjRIlpOveP.3H.V.' 22 | 23 | # Tools directory 24 | tools_root: /tools 25 | 26 | # Engagement and operator logs directory 27 | logs_root: /data 28 | 29 | # VNC Auth password 30 | # NOTE 31 | # must be atleast 6 characters) 32 | # the variable feeds this command to a oneliner password change and include the appropriate quotes 33 | # printf {{ vnc_password_cmd }} | vncpasswd 34 | vnc_password_cmd: '"operator\noperator\nn"' 35 | 36 | ######################## 37 | # Required directories 38 | required_directories: [ 39 | "{{ tools_root }}", 40 | "{{ logs_root }}", 41 | "/etc/event_skeleton", 42 | "/etc/event_skeleton/0-admin", 43 | "/etc/event_skeleton/1-osint", 44 | "/etc/event_skeleton/2-recon", 45 | "/etc/event_skeleton/3-targets", 46 | "/etc/event_skeleton/4-screenshots", 47 | "/etc/event_skeleton/5-payloads", 48 | "/etc/event_skeleton/6-logs", 49 | "/home/{{ operator_username }}/.vnc", 50 | "/home/{{ operator_username }}/Desktop/readme", 51 | ] 52 | 53 | ######################## 54 | # Software Packages to install via apt 55 | software_packages: [ 56 | apt-transport-https, 57 | ca-certificates, 58 | software-properties-common, 59 | build-essential, 60 | curl, 61 | dpkg, 62 | firefox, 63 | gnupg, 64 | git, 65 | imagemagick-6.q16, 66 | openjdk-8-jre, 67 | john, 68 | jq, 69 | libgmp-dev, 70 | libbz2-dev, 71 | libffi-dev, 72 | libpcap-dev, 73 | libpcap0.8, 74 | libssl-dev, 75 | nmap, 76 | nuget, 77 | mosh, 78 | p7zip-full, 79 | pkg-config, 80 | python-crypto, 81 | python-dev, 82 | python-libpcap, 83 | python-lzma, 84 | python-pip, 85 | python3, 86 | python3.7, 87 | python3.7-dev, 88 | python3-pip, 89 | python3-apt, 90 | python-crypto, 91 | python-pyasn1, 92 | python-twisted-core, 93 | virtualenv, 94 | python3-setuptools, 95 | smbclient, 96 | tcpdump, 97 | tightvncserver, 98 | tmux, 99 | unrar, 100 | wget, 101 | wireshark, 102 | xfce4, 103 | xfce4-goodies, 104 | xfce4-terminal, 105 | unzip, 106 | openjdk-8-jdk, 107 | openjdk-8-jre, 108 | binwalk, 109 | tigervnc-standalone-server, 110 | tigervnc-xorg-extension, 111 | tshark, 112 | ufw, 113 | freerdp2-x11, 114 | yasm 115 | ] 116 | 117 | ######################## 118 | # Git repository list 119 | # NOTE: Versions are controlled by the version specified. HEAD equals latest version 120 | # NOTE: uses key:{value} 121 | # key: first level 122 | # value.X : 2nd level item 123 | # value.Y : 2nd level item 124 | # key (General label. Used for things such as creating a base directory) 125 | # category: (Category label, Use to store in a category directory) 126 | # url: (Download URL, URL to file to download) 127 | # version: (Version of the repo to pull) 128 | 129 | git_repos: 130 | impacket: 131 | category: network 132 | url: https://github.com/SecureAuthCorp/impacket 133 | version: HEAD 134 | inveigh: 135 | category: network 136 | url: https://github.com/Kevin-Robertson/Inveigh 137 | version: HEAD 138 | responder: 139 | category: network 140 | url: https://github.com/lgandx/Responder 141 | version: HEAD 142 | johntheripper: 143 | category: password 144 | url: https://github.com/magnumripper/JohnTheRipper 145 | version: HEAD 146 | domainpasswordspray: 147 | category: password 148 | url: https://github.com/dafthack/DomainPasswordSpray 149 | version: HEAD 150 | tinyshell: 151 | category: web 152 | url: https://github.com/threatexpress/tinyshell 153 | version: HEAD 154 | invoke-thehash: 155 | category: windows 156 | url: https://github.com/Kevin-Robertson/Invoke-TheHash 157 | version: HEAD 158 | seatbelt: 159 | category: ghostpack 160 | url: https://github.com/GhostPack/Seatbelt 161 | version: HEAD 162 | sharpup: 163 | category: ghostpack 164 | url: https://github.com/GhostPack/SharpUp 165 | version: HEAD 166 | sharpdump: 167 | category: ghostpack 168 | url: https://github.com/GhostPack/SharpDump 169 | version: HEAD 170 | safetykatz: 171 | category: ghostpack 172 | url: https://github.com/GhostPack/SafetyKatz 173 | version: HEAD 174 | sharpwmi: 175 | category: ghostpack 176 | url: https://github.com/GhostPack/SharpWMI 177 | version: HEAD 178 | sharpdpapi: 179 | category: ghostpack 180 | url: https://github.com/GhostPack/SharpDPAPI 181 | version: HEAD 182 | internal-monologue: 183 | category: windows 184 | url: https://github.com/eladshamir/Internal-Monologue 185 | version: HEAD 186 | powersploit: 187 | category: windows 188 | url: https://github.com/PowerShellMafia/PowerSploit 189 | version: dev 190 | elite: 191 | category: c2 192 | url: https://github.com/cobbr/Elite 193 | version: HEAD 194 | covenant: 195 | category: c2 196 | url: https://github.com/cobbr/Covenant 197 | version: HEAD 198 | red-teaming-toolkit: 199 | category: resource 200 | url: https://github.com/infosecn1nja/Red-Teaming-Toolkit 201 | version: HEAD 202 | awesome-red-teaming: 203 | category: resource 204 | url: https://github.com/yeyintminthuhtut/Awesome-Red-Teaming 205 | version: HEAD 206 | domainhunter: 207 | category: recon 208 | url: https://github.com/threatexpress/domainhunter 209 | version: HEAD 210 | c2modrewrite: 211 | category: c2 212 | url: https://github.com/threatexpress/cs2modrewrite 213 | version: HEAD 214 | red-team-scripts: 215 | category: resource 216 | url: https://github.com/threatexpress/red-team-scripts 217 | version: HEAD 218 | malleable-c2: 219 | category: c2 220 | url: https://github.com/threatexpress/malleable-c2 221 | version: HEAD 222 | pasties: 223 | category: resource 224 | url: https://github.com/threatexpress/pasties 225 | version: HEAD 226 | edc: 227 | category: reporting 228 | url: https://github.com/threatexpress/edc 229 | version: HEAD 230 | eyewitness: 231 | category: web 232 | url: https://github.com/FortyNorthSecurity/EyeWitness.git 233 | version: HEAD 234 | sqlmap: 235 | category: web 236 | url: https://github.com/sqlmapproject/sqlmap.git 237 | version: HEAD 238 | sharpclipboard: 239 | category: windows 240 | url: https://github.com/slyd0g/SharpClipboard.git 241 | version: HEAD 242 | powerupsql: 243 | category: privesc 244 | url: https://github.com/NetSPI/PowerUpSQL.git 245 | version: HEAD 246 | silenttrinity: 247 | category: c2 248 | url: https://github.com/byt3bl33d3r/SILENTTRINITY 249 | version: HEAD 250 | proxychains-ng: 251 | category: general 252 | url: https://github.com/rofl0r/proxychains-ng 253 | version: HEAD 254 | crackmapexec: 255 | category: c2 256 | url: https://github.com/byt3bl33d3r/crackmapexec 257 | version: HEAD 258 | sprayingtoolkit: 259 | category: privesc 260 | url: https://github.com/byt3bl33d3r/SprayingToolkit 261 | version: HEAD 262 | 263 | ######################## 264 | # Files to be directly downloaded 265 | # NOTE: Versions are controlled by the URL source 266 | # NOTE: uses key:{value} 267 | # key: first level 268 | # value.X : 2nd level item 269 | # value.Y : 2nd level item 270 | # key (General label. Used for things such as creating a base directory) 271 | # category: (Category label, Use to store in a category directory) 272 | # url: (Download URL, URL to file to download) 273 | 274 | direct_download_files: 275 | rockyou: 276 | category: password 277 | url: http://downloads.skullsecurity.org/passwords/rockyou.txt.bz2 278 | merlin: 279 | category: c2 280 | url: https://github.com/Ne0nd0g/merlin/releases/download/v0.7.0/merlinServer-Linux-x64-v0.7.0.BETA.7z 281 | sysinternals: 282 | category: windows 283 | url: https://download.sysinternals.com/files/SysinternalsSuite.zip 284 | metasploit: 285 | category: c2 286 | url: https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb 287 | burpsuite: 288 | category: web 289 | url: https://portswigger.net/burp/releases/download?product=community&version=2020.1&type=Linux 290 | bloodhound: 291 | category: enumeration 292 | url: https://github.com/BloodHoundAD/BloodHound/releases/download/3.0.1/BloodHound-linux-x64.zip 293 | sharphoundEXE: 294 | category: enumeration 295 | url: https://github.com/BloodHoundAD/BloodHound/blob/master/Ingestors/SharpHound.exe 296 | sharphoundPS1: 297 | category: enumeration 298 | url: https://github.com/BloodHoundAD/BloodHound/blob/master/Ingestors/SharpHound.ps1 299 | 300 | ######################## 301 | # Python Modules to install 302 | python_modules: [ 303 | pip, 304 | boto3, 305 | docopt, 306 | xmltodict, 307 | requests, 308 | argparse, 309 | certifi, 310 | chardet, 311 | idna, 312 | urllib3, 313 | pipenv, 314 | ] 315 | -------------------------------------------------------------------------------- /roles/common/defaults/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## defaults main.yml for role: common 3 | ######################## 4 | # Ansible Variables 5 | ansible_user: root 6 | ansible_ssh_private_key_file: ~/.ssh/threatbox_id_rsa 7 | # NOTE: This project will start on Port 22 and update the SSH configuration to this port 8 | ansible_port: "52222" 9 | 10 | 11 | ######################## 12 | # Platform variables 13 | 14 | # Ubuntu version 15 | ubuntu_version: "bionic" 16 | 17 | # Default user 18 | 19 | operator_username: "operator" 20 | #https://docs.ansible.com/ansible/latest/reference_appendices/faq.html#how-do-i-generate-crypted-passwords-for-the-user-module 21 | # Clear password: 'operatorPassword123!@#' 22 | operator_password: '$6$o3Td5VWG4Ouf.TzZ$FKp3XkAMT0T4ntaGXKFSo414pzyJHFGrAekd6NVRqY3lvT6PB.X9m7D119xv.vwmKrBL38pjRIlpOveP.3H.V.' 23 | 24 | # Tools directory 25 | tools_root: /tools 26 | 27 | # Engagement and operator logs directory 28 | logs_root: /data 29 | 30 | # VNC Auth password 31 | # NOTE 32 | # must be atleast 6 characters) 33 | # the variable feeds this command to a oneliner password change and include the appropriate quotes 34 | # printf {{ vnc_password_cmd }} | vncpasswd 35 | vnc_password_cmd: '"operator\noperator\nn"' 36 | 37 | ######################## 38 | # Required directories 39 | required_directories: [ 40 | "{{ tools_root }}", 41 | "{{ logs_root }}", 42 | "/etc/event_skeleton", 43 | "/etc/event_skeleton/0-admin", 44 | "/etc/event_skeleton/1-osint", 45 | "/etc/event_skeleton/2-recon", 46 | "/etc/event_skeleton/3-targets", 47 | "/etc/event_skeleton/4-screenshots", 48 | "/etc/event_skeleton/5-payloads", 49 | "/etc/event_skeleton/6-logs", 50 | "/home/{{ operator_username }}/.vnc", 51 | "/home/{{ operator_username }}/Desktop/readme", 52 | ] 53 | 54 | ######################## 55 | # Software Packages to install via apt 56 | software_packages: [ 57 | apt-transport-https, 58 | ca-certificates, 59 | software-properties-common, 60 | build-essential, 61 | curl, 62 | dpkg, 63 | firefox, 64 | gnupg, 65 | git, 66 | imagemagick-6.q16, 67 | openjdk-8-jre, 68 | john, 69 | jq, 70 | libgmp-dev, 71 | libbz2-dev, 72 | libffi-dev, 73 | libpcap-dev, 74 | libpcap0.8, 75 | libssl-dev, 76 | nmap, 77 | nuget, 78 | mosh, 79 | p7zip-full, 80 | pkg-config, 81 | python-crypto, 82 | python-dev, 83 | python-libpcap, 84 | python-lzma, 85 | python-pip, 86 | python3, 87 | python3.7, 88 | python3.7-dev, 89 | python3-pip, 90 | python3-apt, 91 | python-crypto, 92 | python-pyasn1, 93 | python-twisted-core, 94 | virtualenv, 95 | python3-setuptools, 96 | smbclient, 97 | tcpdump, 98 | tightvncserver, 99 | tmux, 100 | unrar, 101 | wget, 102 | wireshark, 103 | xfce4, 104 | xfce4-goodies, 105 | xfce4-terminal, 106 | unzip, 107 | openjdk-8-jdk, 108 | openjdk-8-jre, 109 | binwalk, 110 | tigervnc-standalone-server, 111 | tigervnc-xorg-extension, 112 | tshark, 113 | ufw, 114 | freerdp2-x11, 115 | yasm 116 | ] 117 | 118 | ######################## 119 | # Git repository list 120 | # NOTE: Versions are controlled by the version specified. HEAD equals latest version 121 | # NOTE: uses key:{value} 122 | # key: first level 123 | # value.X : 2nd level item 124 | # value.Y : 2nd level item 125 | # key (General label. Used for things such as creating a base directory) 126 | # category: (Category label, Use to store in a category directory) 127 | # url: (Download URL, URL to file to download) 128 | # version: (Version of the repo to pull) 129 | 130 | git_repos: 131 | impacket: 132 | category: network 133 | url: https://github.com/SecureAuthCorp/impacket 134 | version: HEAD 135 | inveigh: 136 | category: network 137 | url: https://github.com/Kevin-Robertson/Inveigh 138 | version: HEAD 139 | responder: 140 | category: network 141 | url: https://github.com/lgandx/Responder 142 | version: HEAD 143 | johntheripper: 144 | category: password 145 | url: https://github.com/magnumripper/JohnTheRipper 146 | version: HEAD 147 | domainpasswordspray: 148 | category: password 149 | url: https://github.com/dafthack/DomainPasswordSpray 150 | version: HEAD 151 | tinyshell: 152 | category: web 153 | url: https://github.com/threatexpress/tinyshell 154 | version: HEAD 155 | invoke-thehash: 156 | category: windows 157 | url: https://github.com/Kevin-Robertson/Invoke-TheHash 158 | version: HEAD 159 | seatbelt: 160 | category: ghostpack 161 | url: https://github.com/GhostPack/Seatbelt 162 | version: HEAD 163 | sharpup: 164 | category: ghostpack 165 | url: https://github.com/GhostPack/SharpUp 166 | version: HEAD 167 | sharpdump: 168 | category: ghostpack 169 | url: https://github.com/GhostPack/SharpDump 170 | version: HEAD 171 | safetykatz: 172 | category: ghostpack 173 | url: https://github.com/GhostPack/SafetyKatz 174 | version: HEAD 175 | sharpwmi: 176 | category: ghostpack 177 | url: https://github.com/GhostPack/SharpWMI 178 | version: HEAD 179 | sharpdpapi: 180 | category: ghostpack 181 | url: https://github.com/GhostPack/SharpDPAPI 182 | version: HEAD 183 | internal-monologue: 184 | category: windows 185 | url: https://github.com/eladshamir/Internal-Monologue 186 | version: HEAD 187 | powersploit: 188 | category: windows 189 | url: https://github.com/PowerShellMafia/PowerSploit 190 | version: dev 191 | elite: 192 | category: c2 193 | url: https://github.com/cobbr/Elite 194 | version: HEAD 195 | covenant: 196 | category: c2 197 | url: https://github.com/cobbr/Covenant 198 | version: HEAD 199 | red-teaming-toolkit: 200 | category: resource 201 | url: https://github.com/infosecn1nja/Red-Teaming-Toolkit 202 | version: HEAD 203 | awesome-red-teaming: 204 | category: resource 205 | url: https://github.com/yeyintminthuhtut/Awesome-Red-Teaming 206 | version: HEAD 207 | domainhunter: 208 | category: recon 209 | url: https://github.com/threatexpress/domainhunter 210 | version: HEAD 211 | c2modrewrite: 212 | category: c2 213 | url: https://github.com/threatexpress/cs2modrewrite 214 | version: HEAD 215 | red-team-scripts: 216 | category: resource 217 | url: https://github.com/threatexpress/red-team-scripts 218 | version: HEAD 219 | malleable-c2: 220 | category: c2 221 | url: https://github.com/threatexpress/malleable-c2 222 | version: HEAD 223 | pasties: 224 | category: resource 225 | url: https://github.com/threatexpress/pasties 226 | version: HEAD 227 | edc: 228 | category: reporting 229 | url: https://github.com/threatexpress/edc 230 | version: HEAD 231 | eyewitness: 232 | category: web 233 | url: https://github.com/FortyNorthSecurity/EyeWitness.git 234 | version: HEAD 235 | sqlmap: 236 | category: web 237 | url: https://github.com/sqlmapproject/sqlmap.git 238 | version: HEAD 239 | sharpclipboard: 240 | category: windows 241 | url: https://github.com/slyd0g/SharpClipboard.git 242 | version: HEAD 243 | powerupsql: 244 | category: privesc 245 | url: https://github.com/NetSPI/PowerUpSQL.git 246 | version: HEAD 247 | silenttrinity: 248 | category: c2 249 | url: https://github.com/byt3bl33d3r/SILENTTRINITY 250 | version: HEAD 251 | proxychains-ng: 252 | category: general 253 | url: https://github.com/rofl0r/proxychains-ng 254 | version: HEAD 255 | crackmapexec: 256 | category: c2 257 | url: https://github.com/byt3bl33d3r/crackmapexec 258 | version: HEAD 259 | sprayingtoolkit: 260 | category: privesc 261 | url: https://github.com/byt3bl33d3r/SprayingToolkit 262 | version: HEAD 263 | 264 | ######################## 265 | # Files to be directly downloaded 266 | # NOTE: Versions are controlled by the URL source 267 | # NOTE: uses key:{value} 268 | # key: first level 269 | # value.X : 2nd level item 270 | # value.Y : 2nd level item 271 | # key (General label. Used for things such as creating a base directory) 272 | # category: (Category label, Use to store in a category directory) 273 | # url: (Download URL, URL to file to download) 274 | 275 | direct_download_files: 276 | rockyou: 277 | category: password 278 | url: http://downloads.skullsecurity.org/passwords/rockyou.txt.bz2 279 | merlin: 280 | category: c2 281 | url: https://github.com/Ne0nd0g/merlin/releases/download/v0.7.0/merlinServer-Linux-x64-v0.7.0.BETA.7z 282 | sysinternals: 283 | category: windows 284 | url: https://download.sysinternals.com/files/SysinternalsSuite.zip 285 | metasploit: 286 | category: c2 287 | url: https://raw.githubusercontent.com/rapid7/metasploit-omnibus/master/config/templates/metasploit-framework-wrappers/msfupdate.erb 288 | burpsuite: 289 | category: web 290 | url: https://portswigger.net/burp/releases/download?product=community&version=2020.1&type=Linux 291 | bloodhound: 292 | category: enumeration 293 | url: https://github.com/BloodHoundAD/BloodHound/releases/download/3.0.1/BloodHound-linux-x64.zip 294 | sharphoundEXE: 295 | category: enumeration 296 | url: https://github.com/BloodHoundAD/BloodHound/blob/master/Ingestors/SharpHound.exe 297 | sharphoundPS1: 298 | category: enumeration 299 | url: https://github.com/BloodHoundAD/BloodHound/blob/master/Ingestors/SharpHound.ps1 300 | 301 | ######################## 302 | # Python Modules to install 303 | python_modules: [ 304 | pip, 305 | boto3, 306 | docopt, 307 | xmltodict, 308 | requests, 309 | argparse, 310 | certifi, 311 | chardet, 312 | idna, 313 | urllib3, 314 | pipenv, 315 | ] 316 | -------------------------------------------------------------------------------- /roles/compiled_dotnet_projects/tasks/main.yml: -------------------------------------------------------------------------------- 1 | --- 2 | ## tasks main.yml for role: compiled_dotnet_projects 3 | ## This role compiles several Windows .net tools using dotnetcore 4 | 5 | ## Note: Download of the source is controlled in the threatbox.yml file. 6 | ## It's best to enable all downloads in that file. 7 | ## This help to maintain software package tracking. 8 | 9 | - name: Create necessary directories if non-existent 10 | file: 11 | path: "{{ tools_root }}/windows/compiled_dotnet_projects" 12 | state: directory 13 | owner: "{{ operator_username }}" 14 | group: "{{ operator_username }}" 15 | mode: 0750 16 | 17 | 18 | ########### 19 | ## Seatbelt 20 | - name: Set seatbelt path variable 21 | set_fact: 22 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 23 | loop: "{{ lookup('dict', git_repos) }}" 24 | when: "'seatbelt' in item.key" 25 | 26 | 27 | - name: check for tool_path ({{ tool_path }}) 28 | stat: 29 | path: "{{ tool_path }}" 30 | register: tp 31 | 32 | 33 | - name: fail if tool_path ({{ tool_path }}) does not exist 34 | fail: msg="The directory does not exist" 35 | when: not tp.stat.exists 36 | 37 | 38 | - name: Check if Seatbelt_4.5.exe exists 39 | stat: 40 | path: "{{ tools_root }}/windows/compiled_dotnet_projects/Seatbelt_4.5.exe" 41 | register: seatbelt 42 | 43 | 44 | - name: Compile Seatbelt .net 4.5 if not exist 45 | command: /usr/bin/msbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" /p:DebugSymbols=false /p:DebugType=None /p:CopyOutputSymbolsToPublishDirectory=false "{{ tool_path }}Seatbelt/Seatbelt.csproj" 46 | when: seatbelt.stat.exists == False 47 | args: 48 | chdir: "{{ tool_path }}" 49 | 50 | 51 | - name: Move Seatbelt.exe to compiled_dotnet_projects 52 | command: "mv {{ tool_path }}Seatbelt/bin/Release/Seatbelt.exe {{ tools_root }}/windows/compiled_dotnet_projects/Seatbelt_4.5.exe" 53 | when: seatbelt.stat.exists == False 54 | args: 55 | chdir: "{{ tool_path }}" 56 | 57 | 58 | ########### 59 | ## SharpUp 60 | - name: Set sharpup path variable 61 | set_fact: 62 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 63 | loop: "{{ lookup('dict', git_repos) }}" 64 | when: "'sharpup' in item.key" 65 | 66 | 67 | - name: check for tool_path ({{ tool_path }}) 68 | stat: 69 | path: "{{ tool_path }}" 70 | register: tp 71 | 72 | 73 | - name: fail if tool_path ({{ tool_path }}) does not exist 74 | fail: msg="The directory does not exist" 75 | when: not tp.stat.exists 76 | 77 | 78 | - name: Check if SharpUp_4.5.exe exists 79 | stat: 80 | path: "{{ tools_root }}/windows/compiled_dotnet_projects/SharpUp_4.5.exe" 81 | register: sharpup 82 | 83 | 84 | - name: Compile SharpUp .net 4.5 if not exist 85 | command: /usr/bin/msbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" /p:DebugSymbols=false /p:DebugType=None /p:CopyOutputSymbolsToPublishDirectory=false "{{ tool_path }}/SharpUp/SharpUp.csproj" 86 | when: sharpup.stat.exists == False 87 | args: 88 | chdir: "{{ tool_path }}/" 89 | 90 | 91 | - name: Move SharpUp.exe to compiled_dotnet_projects 92 | command: "mv {{ tool_path }}/SharpUp/bin/Release/SharpUp.exe {{ tools_root }}/windows/compiled_dotnet_projects/SharpUp_4.5.exe" 93 | when: sharpup.stat.exists == False 94 | args: 95 | chdir: "{{ tool_path }}/" 96 | 97 | 98 | ########### 99 | ## SharpDump 100 | - name: Set sharpdump path variable 101 | set_fact: 102 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 103 | loop: "{{ lookup('dict', git_repos) }}" 104 | when: "'sharpdump' in item.key" 105 | 106 | 107 | - name: check for tool_path ({{ tool_path }}) 108 | stat: 109 | path: "{{ tool_path }}" 110 | register: tp 111 | 112 | 113 | - name: fail if tool_path ({{ tool_path }}) does not exist 114 | fail: msg="The directory does not exist" 115 | when: not tp.stat.exists 116 | 117 | 118 | - name: Check if SharpDump_4.5.exe exists 119 | stat: 120 | path: "{{ tools_root }}/windows/compiled_dotnet_projects/SharpDump_4.5.exe" 121 | register: sharpdump 122 | 123 | 124 | - name: Compile SharpDump .net 4.5 if not exist 125 | command: /usr/bin/msbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" /p:DebugSymbols=false /p:DebugType=None /p:CopyOutputSymbolsToPublishDirectory=false "{{ tool_path }}/SharpDump/SharpDump.csproj" 126 | when: sharpdump.stat.exists == False 127 | args: 128 | chdir: "{{ tool_path }}/" 129 | 130 | 131 | - name: Move SharpDump.exe to compiled_dotnet_projects 132 | command: "mv {{ tool_path }}/SharpDump/bin/Release/SharpDump.exe {{ tools_root }}/windows/compiled_dotnet_projects/SharpDump_4.5.exe" 133 | when: sharpdump.stat.exists == False 134 | args: 135 | chdir: "{{ tool_path }}/" 136 | 137 | 138 | ########### 139 | ## SafetyKatz 140 | - name: Set safetykatz path variable 141 | set_fact: 142 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 143 | loop: "{{ lookup('dict', git_repos) }}" 144 | when: "'safetykatz' in item.key" 145 | 146 | 147 | - name: check for tool_path ({{ tool_path }}) 148 | stat: 149 | path: "{{ tool_path }}" 150 | register: tp 151 | 152 | 153 | - name: fail if tool_path ({{ tool_path }}) does not exist 154 | fail: msg="The directory does not exist" 155 | when: not tp.stat.exists 156 | 157 | 158 | - name: Check if SafetyKatz_4.5.exe exists 159 | stat: 160 | path: "{{ tools_root }}/windows/compiled_dotnet_projects/SafetyKatz_4.5.exe" 161 | register: safetykatz 162 | 163 | 164 | - name: Compile SafetyKatz .net 4.5 if not exist 165 | command: /usr/bin/msbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" /p:DebugSymbols=false /p:DebugType=None /p:CopyOutputSymbolsToPublishDirectory=false "{{ tool_path }}/SafetyKatz/SafetyKatz.csproj" 166 | when: safetykatz.stat.exists == False 167 | args: 168 | chdir: "{{ tool_path }}/" 169 | 170 | 171 | - name: Move SafetyKatz.exe to compiled_dotnet_projects 172 | command: "mv {{ tool_path }}/SafetyKatz/bin/Release/SafetyKatz.exe {{ tools_root }}/windows/compiled_dotnet_projects/SafetyKatz_4.5.exe" 173 | when: safetykatz.stat.exists == False 174 | args: 175 | chdir: "{{ tool_path }}/" 176 | 177 | 178 | ########### 179 | ## SharpDPAPI 180 | - name: Set sharpdpapi path variable 181 | set_fact: 182 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 183 | loop: "{{ lookup('dict', git_repos) }}" 184 | when: "'sharpdpapi' in item.key" 185 | 186 | 187 | - name: check for tool_path ({{ tool_path }}) 188 | stat: 189 | path: "{{ tool_path }}" 190 | register: tp 191 | 192 | 193 | - name: fail if tool_path ({{ tool_path }}) does not exist 194 | fail: msg="The directory does not exist" 195 | when: not tp.stat.exists 196 | 197 | 198 | - name: Check if SharpDPAPI_4.5.exe exists 199 | stat: 200 | path: "{{ tools_root }}/windows/compiled_dotnet_projects/SharpDPAPI_4.5.exe" 201 | register: sharpdpapi 202 | 203 | 204 | - name: Compile SharpDPAPI .net 4.5 if not exist 205 | command: /usr/bin/msbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" /p:DebugSymbols=false /p:DebugType=None /p:CopyOutputSymbolsToPublishDirectory=false "{{ tool_path }}/SharpDPAPI/SharpDPAPI.csproj" 206 | when: sharpdpapi.stat.exists == False 207 | args: 208 | chdir: "{{ tool_path }}/" 209 | 210 | 211 | - name: Move SharpDPAPI.exe to compiled_dotnet_projects 212 | command: "mv {{ tool_path }}/SharpDPAPI/bin/Release/SharpDPAPI.exe {{ tools_root }}/windows/compiled_dotnet_projects/SharpDPAPI_4.5.exe" 213 | when: sharpdpapi.stat.exists == False 214 | args: 215 | chdir: "{{ tool_path }}/" 216 | 217 | 218 | ########### 219 | ## SharpChrome 220 | - name: Set sharpchrome path variable 221 | set_fact: 222 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 223 | loop: "{{ lookup('dict', git_repos) }}" 224 | when: "'sharpchrome' in item.key" 225 | 226 | 227 | - name: check for tool_path ({{ tool_path }}) 228 | stat: 229 | path: "{{ tool_path }}" 230 | register: tp 231 | 232 | 233 | - name: fail if tool_path ({{ tool_path }}) does not exist 234 | fail: msg="The directory does not exist" 235 | when: not tp.stat.exists 236 | 237 | 238 | - name: Check if SharpChrome_4.5.exe exists 239 | stat: 240 | path: "{{ tools_root }}/windows/compiled_dotnet_projects/SharpChrome_4.5.exe" 241 | register: sharpchrome 242 | 243 | 244 | - name: Compile SharpChrome .net 4.5 if not exist 245 | command: /usr/bin/msbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" /p:DebugSymbols=false /p:DebugType=None /p:CopyOutputSymbolsToPublishDirectory=false "{{ tool_path }}/SharpChrome/SharpChrome.csproj" 246 | when: sharpchrome.stat.exists == False 247 | args: 248 | chdir: "{{ tool_path }}/" 249 | 250 | 251 | - name: Move SharpChrome.exe to compiled_dotnet_projects 252 | command: "mv {{ tool_path }}/SharpChrome/bin/Release/SharpChrome.exe {{ tools_root }}/windows/compiled_dotnet_projects/SharpChrome_4.5.exe" 253 | when: sharpchrome.stat.exists == False 254 | args: 255 | chdir: "{{ tool_path }}/" 256 | 257 | 258 | ########### 259 | ## InternalMonologue 260 | - name: Set internalmonologue path variable 261 | set_fact: 262 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 263 | loop: "{{ lookup('dict', git_repos) }}" 264 | when: "'internal-monologue' in item.key" 265 | 266 | 267 | - name: check for tool_path ({{ tool_path }}) 268 | stat: 269 | path: "{{ tool_path }}" 270 | register: tp 271 | 272 | 273 | - name: fail if tool_path ({{ tool_path }}) does not exist 274 | fail: msg="The directory does not exist" 275 | when: not tp.stat.exists 276 | 277 | 278 | - name: Check if InternalMonologue_4.5.exe exists 279 | stat: 280 | path: "{{ tools_root }}/windows/compiled_dotnet_projects/InternalMonologue_4.5.exe" 281 | register: internalmonologue 282 | 283 | 284 | - name: Compile InternalMonologue .net 4.5 if not exist 285 | command: /usr/bin/msbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" /p:DebugSymbols=false /p:DebugType=None /p:CopyOutputSymbolsToPublishDirectory=false "{{ tool_path }}/InternalMonologueExe/InternalMonologueExe.csproj" 286 | when: internalmonologue.stat.exists == False 287 | args: 288 | chdir: "{{ tool_path }}/" 289 | 290 | 291 | - name: Move InternalMonologue.exe to compiled_dotnet_projects 292 | command: "mv {{ tool_path }}/InternalMonologueExe/bin/Release/InternalMonologue.exe {{ tools_root }}/windows/compiled_dotnet_projects/InternalMonologue_4.5.exe" 293 | when: internalmonologue.stat.exists == False 294 | args: 295 | chdir: "{{ tool_path }}/" 296 | 297 | 298 | ########### 299 | ## SharpWMI 300 | - name: Set sharpwmi path variable 301 | set_fact: 302 | tool_path: "{{ tools_root }}/{{ item.value.category }}/{{ item.key }}/" 303 | loop: "{{ lookup('dict', git_repos) }}" 304 | when: "'sharpwmi' in item.key" 305 | 306 | 307 | - name: check for tool_path ({{ tool_path }}) 308 | stat: 309 | path: "{{ tool_path }}" 310 | register: tp 311 | 312 | 313 | - name: fail if tool_path ({{ tool_path }}) does not exist 314 | fail: msg="The directory does not exist" 315 | when: not tp.stat.exists 316 | 317 | 318 | - name: Check if SharpWMI_4.5.exe exists 319 | stat: 320 | path: "{{ tools_root }}/windows/compiled_dotnet_projects/SharpWMI_4.5.exe" 321 | register: sharpwmi 322 | 323 | 324 | - name: Compile SharpWMI .net 4.5 if not exist 325 | command: /usr/bin/msbuild /p:Configuration=Release /p:TargetFrameworkVersion="v4.5" /p:DebugSymbols=false /p:DebugType=None /p:CopyOutputSymbolsToPublishDirectory=false "{{ tool_path }}/SharpWMI/SharpWMI.csproj" 326 | when: sharpwmi.stat.exists == False 327 | args: 328 | chdir: "{{ tool_path }}/" 329 | 330 | 331 | - name: Move SharpWMI.exe to compiled_dotnet_projects 332 | command: "mv {{ tool_path }}/SharpWMI/bin/Release/SharpWMI.exe {{ tools_root }}/windows/compiled_dotnet_projects/SharpWMI_4.5.exe" 333 | when: sharpwmi.stat.exists == False 334 | args: 335 | chdir: "{{ tool_path }}/" 336 | 337 | 338 | 339 | 340 | 341 | 342 | --------------------------------------------------------------------------------