Persist tmux socket outside /tmp on attack boxes
systemd-tmpfiles cleans /tmp on a schedule, wiping the tmux socket and breaking existing sessions. Set TMUX_TMPDIR to ~/.local/share/tmux so the socket survives cleanup on both full and quick recon boxes.
This commit is contained in:
@@ -1,17 +1,15 @@
|
|||||||
---
|
---
|
||||||
# Attack Box Configuration Tasks
|
# Attack Box Configuration Tasks
|
||||||
# Based on TrashPanda directory structure - creates /root/operator
|
# Creates /root/<deployment_id> workspace structure
|
||||||
|
|
||||||
- name: Set user variables for headless deployment
|
- name: Set user variables for headless deployment
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
target_user: "root"
|
target_user: "root"
|
||||||
user_home: "/root"
|
user_home: "/root"
|
||||||
# Use deployment ID for directory name if enhanced OPSEC is enabled
|
# Always use deployment_id for directory name (no hardcoded operator aliases)
|
||||||
work_dir: "{{ '/root/' + deployment_id if enhanced_opsec | default(false) else '/root/operator' }}"
|
work_dir: "{{ work_dir | default('/root/' + deployment_id) }}"
|
||||||
tool_name: "{{ 'toolkit' if enhanced_opsec | default(false) else 'trashpanda' }}"
|
tool_name: "{{ tool_name | default('toolkit' if enhanced_opsec | default(false) else 'trashpanda') }}"
|
||||||
project_name: "{{ deployment_id if enhanced_opsec | default(false) else 'operator' }}"
|
project_name: "{{ project_name | default(deployment_id) }}"
|
||||||
# Legacy compatibility
|
|
||||||
operator_dir: "{{ '/root/' + deployment_id if enhanced_opsec | default(false) else '/root/operator' }}"
|
|
||||||
|
|
||||||
- name: Display attack box configuration start
|
- name: Display attack box configuration start
|
||||||
debug:
|
debug:
|
||||||
@@ -49,51 +47,50 @@
|
|||||||
mode: '0755'
|
mode: '0755'
|
||||||
loop:
|
loop:
|
||||||
# Main TrashPanda directories (exactly like trashpanda.py)
|
# Main TrashPanda directories (exactly like trashpanda.py)
|
||||||
- "{{ operator_dir }}"
|
- "{{ work_dir }}"
|
||||||
- "{{ operator_dir }}/tools"
|
- "{{ work_dir }}/tools"
|
||||||
- "{{ operator_dir }}/scans"
|
- "{{ work_dir }}/scans"
|
||||||
- "{{ operator_dir }}/logs"
|
- "{{ work_dir }}/logs"
|
||||||
- "{{ operator_dir }}/loot"
|
- "{{ work_dir }}/loot"
|
||||||
- "{{ operator_dir }}/payloads"
|
- "{{ work_dir }}/payloads"
|
||||||
- "{{ operator_dir }}/targets"
|
- "{{ work_dir }}/targets"
|
||||||
- "{{ operator_dir }}/screenshots"
|
- "{{ work_dir }}/screenshots"
|
||||||
- "{{ operator_dir }}/reports"
|
- "{{ work_dir }}/reports"
|
||||||
- "{{ operator_dir }}/notes"
|
- "{{ work_dir }}/notes"
|
||||||
- "{{ operator_dir }}/exploits"
|
- "{{ work_dir }}/exploits"
|
||||||
- "{{ operator_dir }}/wordlists"
|
- "{{ work_dir }}/wordlists"
|
||||||
- "{{ operator_dir }}/pcaps"
|
- "{{ work_dir }}/pcaps"
|
||||||
# Scan subdirectories (exactly like trashpanda.py)
|
# Scan subdirectories (exactly like trashpanda.py)
|
||||||
- "{{ operator_dir }}/scans/nmap"
|
- "{{ work_dir }}/scans/nmap"
|
||||||
- "{{ operator_dir }}/scans/dns"
|
- "{{ work_dir }}/scans/dns"
|
||||||
- "{{ operator_dir }}/scans/snmp"
|
- "{{ work_dir }}/scans/snmp"
|
||||||
- "{{ operator_dir }}/scans/smb"
|
- "{{ work_dir }}/scans/smb"
|
||||||
- "{{ operator_dir }}/scans/web"
|
- "{{ work_dir }}/scans/web"
|
||||||
- "{{ operator_dir }}/scans/ssl"
|
- "{{ work_dir }}/scans/ssl"
|
||||||
- "{{ operator_dir }}/scans/vulns"
|
- "{{ work_dir }}/scans/vulns"
|
||||||
- "{{ operator_dir }}/scans/ldap"
|
- "{{ work_dir }}/scans/ldap"
|
||||||
- "{{ operator_dir }}/scans/ftp"
|
- "{{ work_dir }}/scans/ftp"
|
||||||
- "{{ operator_dir }}/scans/ssh"
|
- "{{ work_dir }}/scans/ssh"
|
||||||
- "{{ operator_dir }}/scans/databases"
|
- "{{ work_dir }}/scans/databases"
|
||||||
- "{{ operator_dir }}/scans/custom"
|
- "{{ work_dir }}/scans/custom"
|
||||||
- "{{ operator_dir }}/scans/reachability"
|
- "{{ work_dir }}/scans/reachability"
|
||||||
# Loot subdirectories (exactly like trashpanda.py)
|
# Loot subdirectories (exactly like trashpanda.py)
|
||||||
- "{{ operator_dir }}/loot/credentials"
|
- "{{ work_dir }}/loot/credentials"
|
||||||
- "{{ operator_dir }}/loot/hashes"
|
- "{{ work_dir }}/loot/hashes"
|
||||||
- "{{ operator_dir }}/loot/keys"
|
- "{{ work_dir }}/loot/keys"
|
||||||
- "{{ operator_dir }}/loot/configs"
|
- "{{ work_dir }}/loot/configs"
|
||||||
- "{{ operator_dir }}/loot/databases"
|
- "{{ work_dir }}/loot/databases"
|
||||||
- "{{ operator_dir }}/loot/files"
|
- "{{ work_dir }}/loot/files"
|
||||||
# Tools subdirectories for organization
|
# Tools subdirectories for organization
|
||||||
- "{{ operator_dir }}/tools/scripts"
|
- "{{ work_dir }}/tools/scripts"
|
||||||
- "{{ operator_dir }}/tools/windows"
|
- "{{ work_dir }}/tools/windows"
|
||||||
- "{{ operator_dir }}/tools/linux"
|
- "{{ work_dir }}/tools/linux"
|
||||||
- "{{ operator_dir }}/tools/web"
|
- "{{ work_dir }}/tools/web"
|
||||||
- "{{ operator_dir }}/tools/wireless"
|
- "{{ work_dir }}/tools/wireless"
|
||||||
- "{{ operator_dir }}/tools/privesc"
|
- "{{ work_dir }}/tools/privesc"
|
||||||
|
|
||||||
# Attack Box Configuration
|
# Attack Box Configuration
|
||||||
# Based on /home/n0mad1k/Tools/attk-box-setup for headless deployment
|
# Uses TrashPanda directory structure under /root/<deployment_id>
|
||||||
# Uses TrashPanda directory structure under /root/operator
|
|
||||||
|
|
||||||
- name: Update package cache only (avoid grub-pc issues)
|
- name: Update package cache only (avoid grub-pc issues)
|
||||||
apt:
|
apt:
|
||||||
@@ -318,7 +315,7 @@
|
|||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Execute Go tools installation script
|
- name: Execute Go tools installation script
|
||||||
ansible.builtin.shell: OPERATOR_DIR="{{ operator_dir }}" /tmp/install_go_tools.sh
|
ansible.builtin.shell: WORK_DIR="{{ work_dir }}" /tmp/install_go_tools.sh
|
||||||
register: go_install_result
|
register: go_install_result
|
||||||
when: go_version_check.rc == 0
|
when: go_version_check.rc == 0
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
@@ -335,24 +332,33 @@
|
|||||||
path: /root/.bashrc
|
path: /root/.bashrc
|
||||||
block: |
|
block: |
|
||||||
# Attack Box Tool Paths
|
# Attack Box Tool Paths
|
||||||
export GOPATH="{{ operator_dir }}/tools/go"
|
export WORK_DIR="{{ work_dir }}"
|
||||||
|
export GOPATH="{{ work_dir }}/tools/go"
|
||||||
export PATH="$PATH:/root/.local/bin" # pipx tools
|
export PATH="$PATH:/root/.local/bin" # pipx tools
|
||||||
export PATH="$PATH:/usr/local/go/bin" # Go binary
|
export PATH="$PATH:/usr/local/go/bin" # Go binary
|
||||||
export PATH="$PATH:$GOPATH/bin" # Go tools
|
export PATH="$PATH:$GOPATH/bin" # Go tools
|
||||||
export PATH="$PATH:{{ operator_dir }}/tools" # Custom tools
|
export PATH="$PATH:{{ work_dir }}/tools" # Custom tools
|
||||||
export PATH="$PATH:/opt/metasploit-framework/bin" # Metasploit
|
export PATH="$PATH:/opt/metasploit-framework/bin" # Metasploit
|
||||||
|
|
||||||
# Useful aliases for attack box
|
# Useful aliases for attack box
|
||||||
alias operator="cd {{ operator_dir }}"
|
alias workspace="cd {{ work_dir }}"
|
||||||
alias tools="cd {{ operator_dir }}/tools"
|
alias tools="cd {{ work_dir }}/tools"
|
||||||
alias scans="cd {{ operator_dir }}/scans"
|
alias scans="cd {{ work_dir }}/scans"
|
||||||
alias loot="cd {{ operator_dir }}/loot"
|
alias loot="cd {{ work_dir }}/loot"
|
||||||
alias trashpanda="python3 {{ operator_dir }}/tools/trashpanda.py"
|
alias trashpanda="python3 {{ work_dir }}/tools/{{ tool_name }}.py"
|
||||||
alias ll="ls -la"
|
alias ll="ls -la"
|
||||||
alias la="ls -la"
|
alias la="ls -la"
|
||||||
|
# Persistent tmux socket (prevents /tmp cleanup from killing sessions)
|
||||||
|
export TMUX_TMPDIR="/root/.local/share/tmux"
|
||||||
marker: "# {mark} ATTACK BOX CONFIGURATION"
|
marker: "# {mark} ATTACK BOX CONFIGURATION"
|
||||||
create: yes
|
create: yes
|
||||||
|
|
||||||
|
- name: Create persistent tmux socket directory
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /root/.local/share/tmux
|
||||||
|
state: directory
|
||||||
|
mode: '0700'
|
||||||
|
|
||||||
- name: Source bashrc to apply PATH changes
|
- name: Source bashrc to apply PATH changes
|
||||||
ansible.builtin.shell: source /root/.bashrc
|
ansible.builtin.shell: source /root/.bashrc
|
||||||
args:
|
args:
|
||||||
@@ -365,7 +371,7 @@
|
|||||||
mode: '0755'
|
mode: '0755'
|
||||||
|
|
||||||
- name: Execute Git repositories cloning script
|
- name: Execute Git repositories cloning script
|
||||||
ansible.builtin.shell: OPERATOR_DIR="{{ operator_dir }}" /tmp/install_git_repos.sh
|
ansible.builtin.shell: WORK_DIR="{{ work_dir }}" /tmp/install_git_repos.sh
|
||||||
register: git_clone_result
|
register: git_clone_result
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
@@ -385,10 +391,10 @@
|
|||||||
args:
|
args:
|
||||||
creates: /opt/metasploit-framework/bin/msfconsole
|
creates: /opt/metasploit-framework/bin/msfconsole
|
||||||
|
|
||||||
- name: Copy TrashPanda tool to operator directory
|
- name: Copy TrashPanda tool to workspace directory
|
||||||
copy:
|
copy:
|
||||||
src: "../files/{{ tool_name }}.py"
|
src: "../files/{{ tool_name }}.py"
|
||||||
dest: "{{ operator_dir }}/tools/{{ tool_name }}.py"
|
dest: "{{ work_dir }}/tools/{{ tool_name }}.py"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
owner: "{{ target_user }}"
|
owner: "{{ target_user }}"
|
||||||
group: "{{ target_user }}"
|
group: "{{ target_user }}"
|
||||||
@@ -397,7 +403,7 @@
|
|||||||
- name: Copy OPSEC monitoring scripts
|
- name: Copy OPSEC monitoring scripts
|
||||||
copy:
|
copy:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: "{{ operator_dir }}/tools/scripts/"
|
dest: "{{ work_dir }}/tools/scripts/"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
owner: "{{ target_user }}"
|
owner: "{{ target_user }}"
|
||||||
group: "{{ target_user }}"
|
group: "{{ target_user }}"
|
||||||
@@ -409,7 +415,7 @@
|
|||||||
- name: Copy OPSEC-aware shell aliases
|
- name: Copy OPSEC-aware shell aliases
|
||||||
copy:
|
copy:
|
||||||
src: "../files/clean-shell-aliases"
|
src: "../files/clean-shell-aliases"
|
||||||
dest: "{{ operator_dir }}/tools/scripts/shell-aliases"
|
dest: "{{ work_dir }}/tools/scripts/shell-aliases"
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
owner: "{{ target_user }}"
|
owner: "{{ target_user }}"
|
||||||
group: "{{ target_user }}"
|
group: "{{ target_user }}"
|
||||||
@@ -418,7 +424,7 @@
|
|||||||
- name: Copy automation scripts to tools directory
|
- name: Copy automation scripts to tools directory
|
||||||
copy:
|
copy:
|
||||||
src: "{{ item }}"
|
src: "{{ item }}"
|
||||||
dest: "{{ operator_dir }}/tools/scripts/"
|
dest: "{{ work_dir }}/tools/scripts/"
|
||||||
mode: '0755'
|
mode: '0755'
|
||||||
owner: "{{ target_user }}"
|
owner: "{{ target_user }}"
|
||||||
group: "{{ target_user }}"
|
group: "{{ target_user }}"
|
||||||
@@ -435,22 +441,22 @@
|
|||||||
# IP Address: {{ ansible_default_ipv4.address | default('N/A') }}
|
# IP Address: {{ ansible_default_ipv4.address | default('N/A') }}
|
||||||
#
|
#
|
||||||
# Directory Structure:
|
# Directory Structure:
|
||||||
# {{ operator_dir }}/tools/ - Downloaded/compiled tools and scripts
|
# {{ work_dir }}/tools/ - Downloaded/compiled tools and scripts
|
||||||
# {{ operator_dir }}/scans/ - All scan results organized by type
|
# {{ work_dir }}/scans/ - All scan results organized by type
|
||||||
# {{ operator_dir }}/logs/ - Execution logs and debug output
|
# {{ work_dir }}/logs/ - Execution logs and debug output
|
||||||
# {{ operator_dir }}/loot/ - Extracted credentials, hashes, and sensitive data
|
# {{ work_dir }}/loot/ - Extracted credentials, hashes, and sensitive data
|
||||||
# {{ operator_dir }}/payloads/ - Custom payloads and exploit code
|
# {{ work_dir }}/payloads/ - Custom payloads and exploit code
|
||||||
# {{ operator_dir }}/targets/ - Target lists and reconnaissance data
|
# {{ work_dir }}/targets/ - Target lists and reconnaissance data
|
||||||
# {{ operator_dir }}/screenshots/ - Visual evidence and GUI captures
|
# {{ work_dir }}/screenshots/ - Visual evidence and GUI captures
|
||||||
# {{ operator_dir }}/reports/ - Draft reports and documentation
|
# {{ work_dir }}/reports/ - Draft reports and documentation
|
||||||
# {{ operator_dir }}/notes/ - Manual notes and observations
|
# {{ work_dir }}/notes/ - Manual notes and observations
|
||||||
# {{ operator_dir }}/exploits/ - Working exploits and proof-of-concepts
|
# {{ work_dir }}/exploits/ - Working exploits and proof-of-concepts
|
||||||
# {{ operator_dir }}/wordlists/ - Custom and downloaded wordlists
|
# {{ work_dir }}/wordlists/ - Custom and downloaded wordlists
|
||||||
# {{ operator_dir }}/pcaps/ - Network captures and traffic analysis
|
# {{ work_dir }}/pcaps/ - Network captures and traffic analysis
|
||||||
#
|
#
|
||||||
# Log started: {{ ansible_date_time.iso8601 }}
|
# Log started: {{ ansible_date_time.iso8601 }}
|
||||||
|
|
||||||
dest: "{{ operator_dir }}/logs/engagement.log"
|
dest: "{{ work_dir }}/logs/engagement.log"
|
||||||
owner: "{{ target_user }}"
|
owner: "{{ target_user }}"
|
||||||
group: "{{ target_user }}"
|
group: "{{ target_user }}"
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
@@ -477,7 +483,7 @@
|
|||||||
# target.example.com
|
# target.example.com
|
||||||
# www.example.com
|
# www.example.com
|
||||||
|
|
||||||
dest: "{{ operator_dir }}/targets/targets.txt"
|
dest: "{{ work_dir }}/targets/targets.txt"
|
||||||
owner: "{{ target_user }}"
|
owner: "{{ target_user }}"
|
||||||
group: "{{ target_user }}"
|
group: "{{ target_user }}"
|
||||||
mode: '0644'
|
mode: '0644'
|
||||||
@@ -490,21 +496,22 @@
|
|||||||
create: yes
|
create: yes
|
||||||
loop:
|
loop:
|
||||||
- "# Attack Box Aliases"
|
- "# Attack Box Aliases"
|
||||||
- "alias ops='cd {{ operator_dir }}'"
|
- "export WORK_DIR='{{ work_dir }}'"
|
||||||
- "alias tools='cd {{ operator_dir }}/tools'"
|
- "alias ops='cd {{ work_dir }}'"
|
||||||
- "alias scans='cd {{ operator_dir }}/scans'"
|
- "alias tools='cd {{ work_dir }}/tools'"
|
||||||
- "alias loot='cd {{ operator_dir }}/loot'"
|
- "alias scans='cd {{ work_dir }}/scans'"
|
||||||
- "alias targets='cd {{ operator_dir }}/targets'"
|
- "alias loot='cd {{ work_dir }}/loot'"
|
||||||
- "alias reports='cd {{ operator_dir }}/reports'"
|
- "alias targets='cd {{ work_dir }}/targets'"
|
||||||
- "alias logs='cd {{ operator_dir }}/logs'"
|
- "alias reports='cd {{ work_dir }}/reports'"
|
||||||
- "alias toolkit='python3 {{ operator_dir }}/tools/toolkit.py'"
|
- "alias logs='cd {{ work_dir }}/logs'"
|
||||||
- "alias recon='{{ operator_dir }}/tools/scripts/recon_automation.sh'"
|
- "alias toolkit='python3 {{ work_dir }}/tools/toolkit.py'"
|
||||||
- "alias portscan='{{ operator_dir }}/tools/scripts/port_scan_automation.sh'"
|
- "alias recon='{{ work_dir }}/tools/scripts/recon_automation.sh'"
|
||||||
- "alias webenum='{{ operator_dir }}/tools/scripts/web_enum_automation.sh'"
|
- "alias portscan='{{ work_dir }}/tools/scripts/port_scan_automation.sh'"
|
||||||
- "alias attack-menu='{{ operator_dir }}/tools/scripts/manual_testing_menu.sh'"
|
- "alias webenum='{{ work_dir }}/tools/scripts/web_enum_automation.sh'"
|
||||||
- "alias opsec='{{ operator_dir }}/tools/scripts/opsec-check.sh'"
|
- "alias attack-menu='{{ work_dir }}/tools/scripts/manual_testing_menu.sh'"
|
||||||
- "alias panic='{{ operator_dir }}/tools/scripts/emergency-wipe.sh'"
|
- "alias opsec='{{ work_dir }}/tools/scripts/opsec-check.sh'"
|
||||||
- "alias clean='{{ operator_dir }}/tools/scripts/trash-cleanup.sh'"
|
- "alias panic='{{ work_dir }}/tools/scripts/emergency-wipe.sh'"
|
||||||
|
- "alias clean='{{ work_dir }}/tools/scripts/trash-cleanup.sh'"
|
||||||
when: enhanced_opsec | default(false)
|
when: enhanced_opsec | default(false)
|
||||||
|
|
||||||
- name: Create bash aliases for workflow (Standard mode)
|
- name: Create bash aliases for workflow (Standard mode)
|
||||||
@@ -513,19 +520,20 @@
|
|||||||
line: "{{ item }}"
|
line: "{{ item }}"
|
||||||
create: yes
|
create: yes
|
||||||
loop:
|
loop:
|
||||||
- "# TrashPanda Attack Box Aliases"
|
- "# Attack Box Aliases"
|
||||||
- "alias operator='cd {{ operator_dir }}'"
|
- "export WORK_DIR='{{ work_dir }}'"
|
||||||
- "alias tools='cd {{ operator_dir }}/tools'"
|
- "alias workspace='cd {{ work_dir }}'"
|
||||||
- "alias scans='cd {{ operator_dir }}/scans'"
|
- "alias tools='cd {{ work_dir }}/tools'"
|
||||||
- "alias loot='cd {{ operator_dir }}/loot'"
|
- "alias scans='cd {{ work_dir }}/scans'"
|
||||||
- "alias targets='cd {{ operator_dir }}/targets'"
|
- "alias loot='cd {{ work_dir }}/loot'"
|
||||||
- "alias reports='cd {{ operator_dir }}/reports'"
|
- "alias targets='cd {{ work_dir }}/targets'"
|
||||||
- "alias logs='cd {{ operator_dir }}/logs'"
|
- "alias reports='cd {{ work_dir }}/reports'"
|
||||||
- "alias trashpanda='python3 {{ operator_dir }}/tools/trashpanda.py'"
|
- "alias logs='cd {{ work_dir }}/logs'"
|
||||||
- "alias recon='{{ operator_dir }}/tools/scripts/recon_automation.sh'"
|
- "alias trashpanda='python3 {{ work_dir }}/tools/{{ tool_name }}.py'"
|
||||||
- "alias portscan='{{ operator_dir }}/tools/scripts/port_scan_automation.sh'"
|
- "alias recon='{{ work_dir }}/tools/scripts/recon_automation.sh'"
|
||||||
- "alias webenum='{{ operator_dir }}/tools/scripts/web_enum_automation.sh'"
|
- "alias portscan='{{ work_dir }}/tools/scripts/port_scan_automation.sh'"
|
||||||
- "alias attack-menu='{{ operator_dir }}/tools/scripts/manual_testing_menu.sh'"
|
- "alias webenum='{{ work_dir }}/tools/scripts/web_enum_automation.sh'"
|
||||||
|
- "alias attack-menu='{{ work_dir }}/tools/scripts/manual_testing_menu.sh'"
|
||||||
when: not (enhanced_opsec | default(false))
|
when: not (enhanced_opsec | default(false))
|
||||||
|
|
||||||
- name: Set Go path in bashrc
|
- name: Set Go path in bashrc
|
||||||
@@ -534,15 +542,15 @@
|
|||||||
line: "{{ item }}"
|
line: "{{ item }}"
|
||||||
create: yes
|
create: yes
|
||||||
loop:
|
loop:
|
||||||
- "export GOPATH={{ operator_dir }}/tools/go"
|
- "export GOPATH={{ work_dir }}/tools/go"
|
||||||
- "export PATH=$PATH:{{ operator_dir }}/tools/go/bin"
|
- "export PATH=$PATH:{{ work_dir }}/tools/go/bin"
|
||||||
|
|
||||||
- name: Load OPSEC shell aliases (Enhanced OPSEC mode)
|
- name: Load OPSEC shell aliases (Enhanced OPSEC mode)
|
||||||
blockinfile:
|
blockinfile:
|
||||||
path: "{{ user_home }}/.bashrc"
|
path: "{{ user_home }}/.bashrc"
|
||||||
block: |
|
block: |
|
||||||
# OPSEC-aware shell aliases
|
# OPSEC-aware shell aliases
|
||||||
source {{ operator_dir }}/tools/scripts/shell-aliases
|
source {{ work_dir }}/tools/scripts/shell-aliases
|
||||||
marker: "# {mark} OPSEC SHELL ALIASES"
|
marker: "# {mark} OPSEC SHELL ALIASES"
|
||||||
create: yes
|
create: yes
|
||||||
when: enhanced_opsec | default(false)
|
when: enhanced_opsec | default(false)
|
||||||
@@ -607,6 +615,49 @@
|
|||||||
replace: 'socks5 127.0.0.1 9050'
|
replace: 'socks5 127.0.0.1 9050'
|
||||||
when: setup_tor | default(false)
|
when: setup_tor | default(false)
|
||||||
|
|
||||||
|
- name: Create themes directory
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ work_dir }}/tools/themes"
|
||||||
|
state: directory
|
||||||
|
owner: "{{ target_user }}"
|
||||||
|
group: "{{ target_user }}"
|
||||||
|
mode: '0755'
|
||||||
|
|
||||||
|
- name: Upload terminal theme installer script
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "../files/install_terminal_themes.sh"
|
||||||
|
dest: "{{ work_dir }}/tools/scripts/install_terminal_themes.sh"
|
||||||
|
mode: '0755'
|
||||||
|
owner: "{{ target_user }}"
|
||||||
|
group: "{{ target_user }}"
|
||||||
|
|
||||||
|
- name: Upload DC27 dconf theme file
|
||||||
|
ansible.builtin.copy:
|
||||||
|
src: "../files/dc27-theme.dconf"
|
||||||
|
dest: "{{ work_dir }}/tools/themes/dc27-theme.dconf"
|
||||||
|
mode: '0644'
|
||||||
|
owner: "{{ target_user }}"
|
||||||
|
group: "{{ target_user }}"
|
||||||
|
|
||||||
|
- name: Add terminal theme alias to bashrc
|
||||||
|
lineinfile:
|
||||||
|
path: "{{ user_home }}/.bashrc"
|
||||||
|
line: "alias install-themes='WORK_DIR={{ work_dir }} {{ work_dir }}/tools/scripts/install_terminal_themes.sh'"
|
||||||
|
create: yes
|
||||||
|
|
||||||
|
- name: Execute terminal theme installer during deployment
|
||||||
|
ansible.builtin.shell: WORK_DIR="{{ work_dir }}" {{ work_dir }}/tools/scripts/install_terminal_themes.sh
|
||||||
|
args:
|
||||||
|
executable: /bin/bash
|
||||||
|
register: theme_install_result
|
||||||
|
when: install_terminal_themes | default(false)
|
||||||
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: Display terminal theme installation result
|
||||||
|
debug:
|
||||||
|
msg: "Terminal themes {{ 'installed' if theme_install_result.rc == 0 else 'installation had issues (non-critical)' }}"
|
||||||
|
when: install_terminal_themes | default(false) and theme_install_result is defined
|
||||||
|
|
||||||
- name: Update locate database
|
- name: Update locate database
|
||||||
command: updatedb
|
command: updatedb
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
@@ -626,7 +677,7 @@
|
|||||||
Target: {{ ansible_host }}
|
Target: {{ ansible_host }}
|
||||||
Configuration Duration: {{ config_duration }} minutes
|
Configuration Duration: {{ config_duration }} minutes
|
||||||
|
|
||||||
Directory Structure: {{ operator_dir }}
|
Directory Structure: {{ work_dir }}
|
||||||
├── docs/ - Documentation and notes
|
├── docs/ - Documentation and notes
|
||||||
├── exploits/ - Exploit development
|
├── exploits/ - Exploit development
|
||||||
├── loot/ - Extracted data and findings
|
├── loot/ - Extracted data and findings
|
||||||
@@ -646,11 +697,11 @@
|
|||||||
Environment:
|
Environment:
|
||||||
- PATH configured for all tools
|
- PATH configured for all tools
|
||||||
- pipx tools accessible system-wide
|
- pipx tools accessible system-wide
|
||||||
- Go tools in {{ operator_dir }}/tools/go/bin
|
- Go tools in {{ work_dir }}/tools/go/bin
|
||||||
|
|
||||||
Next Steps:
|
Next Steps:
|
||||||
1. SSH into the box: ssh -i a-{{ deployment_id }} root@{{ ansible_host }}
|
1. SSH into the box: ssh -i a-{{ deployment_id }} root@{{ ansible_host }}
|
||||||
2. Navigate to working directory: cd {{ operator_dir }}
|
2. Navigate to working directory: cd {{ work_dir }}
|
||||||
3. Start your assessment activities
|
3. Start your assessment activities
|
||||||
|
|
||||||
================================================================
|
================================================================
|
||||||
@@ -660,10 +711,10 @@
|
|||||||
msg:
|
msg:
|
||||||
- "Attack Box Setup Complete!"
|
- "Attack Box Setup Complete!"
|
||||||
- ""
|
- ""
|
||||||
- "Main Directory: {{ operator_dir }}"
|
- "Main Directory: {{ work_dir }}"
|
||||||
- "Tools Location: {{ operator_dir }}/tools"
|
- "Tools Location: {{ work_dir }}/tools"
|
||||||
- "Scan Results: {{ operator_dir }}/scans"
|
- "Scan Results: {{ work_dir }}/scans"
|
||||||
- "Loot Storage: {{ operator_dir }}/loot"
|
- "Loot Storage: {{ work_dir }}/loot"
|
||||||
- ""
|
- ""
|
||||||
- "Quick Commands:"
|
- "Quick Commands:"
|
||||||
- " ops - Go to main directory"
|
- " ops - Go to main directory"
|
||||||
@@ -676,7 +727,7 @@
|
|||||||
- " panic - Emergency sanitization"
|
- " panic - Emergency sanitization"
|
||||||
- " clean - Clean operational artifacts"
|
- " clean - Clean operational artifacts"
|
||||||
- ""
|
- ""
|
||||||
- "Start here: {{ operator_dir }}/targets/targets.txt"
|
- "Start here: {{ work_dir }}/targets/targets.txt"
|
||||||
when: enhanced_opsec | default(false)
|
when: enhanced_opsec | default(false)
|
||||||
|
|
||||||
- name: Display setup completion information (Standard mode)
|
- name: Display setup completion information (Standard mode)
|
||||||
@@ -684,18 +735,18 @@
|
|||||||
msg:
|
msg:
|
||||||
- "TrashPanda Attack Box Setup Complete!"
|
- "TrashPanda Attack Box Setup Complete!"
|
||||||
- ""
|
- ""
|
||||||
- "Main Directory: {{ operator_dir }}"
|
- "Main Directory: {{ work_dir }}"
|
||||||
- "Tools Location: {{ operator_dir }}/tools"
|
- "Tools Location: {{ work_dir }}/tools"
|
||||||
- "Scan Results: {{ operator_dir }}/scans"
|
- "Scan Results: {{ work_dir }}/scans"
|
||||||
- "Loot Storage: {{ operator_dir }}/loot"
|
- "Loot Storage: {{ work_dir }}/loot"
|
||||||
- ""
|
- ""
|
||||||
- "Quick Commands:"
|
- "Quick Commands:"
|
||||||
- " operator - Go to main directory"
|
- " workspace - Go to main directory"
|
||||||
- " trashpanda [targets] - Run TrashPanda enumeration"
|
- " trashpanda [targets] - Run TrashPanda enumeration"
|
||||||
- " recon <target> - Run reconnaissance automation"
|
- " recon <target> - Run reconnaissance automation"
|
||||||
- " portscan <target> - Run port scan automation"
|
- " portscan <target> - Run port scan automation"
|
||||||
- " webenum <target> - Run web enumeration automation"
|
- " webenum <target> - Run web enumeration automation"
|
||||||
- " attack-menu - Launch manual testing menu"
|
- " attack-menu - Launch manual testing menu"
|
||||||
- ""
|
- ""
|
||||||
- "Start here: {{ operator_dir }}/targets/targets.txt"
|
- "Start here: {{ work_dir }}/targets/targets.txt"
|
||||||
when: not (enhanced_opsec | default(false))
|
when: not (enhanced_opsec | default(false))
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
- name: Set common variables
|
- name: Set common variables
|
||||||
set_fact:
|
set_fact:
|
||||||
target_user: "root"
|
target_user: "root"
|
||||||
work_dir: "/root/recon"
|
work_dir: "{{ work_dir | default('/root/' + deployment_id) }}"
|
||||||
deployment_id: "{{ deployment_id }}"
|
deployment_id: "{{ deployment_id }}"
|
||||||
attack_box_name: "{{ attack_box_name }}"
|
attack_box_name: "{{ attack_box_name }}"
|
||||||
|
|
||||||
@@ -200,6 +200,13 @@
|
|||||||
- "alias tor-nmap='torsocks nmap'"
|
- "alias tor-nmap='torsocks nmap'"
|
||||||
- "alias tor-curl='torsocks curl'"
|
- "alias tor-curl='torsocks curl'"
|
||||||
- "alias check-tor='curl --socks5 127.0.0.1:9050 https://check.torproject.org/api/ip'"
|
- "alias check-tor='curl --socks5 127.0.0.1:9050 https://check.torproject.org/api/ip'"
|
||||||
|
- "export TMUX_TMPDIR=/root/.local/share/tmux"
|
||||||
|
|
||||||
|
- name: Create persistent tmux socket directory
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: /root/.local/share/tmux
|
||||||
|
state: directory
|
||||||
|
mode: '0700'
|
||||||
|
|
||||||
- name: Create simple quick reference
|
- name: Create simple quick reference
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
|
|||||||
Reference in New Issue
Block a user