From d8d832a43461eb31cffdc131b6cc1a71b497d128 Mon Sep 17 00:00:00 2001 From: n0mad1k Date: Thu, 30 Apr 2026 16:55:43 -0400 Subject: [PATCH] Remove redundant naming prompt and fix Ansible empty-prefix command failure in webrunner - Replace get_deployment_name_with_options() call with auto-derived wr-{deployment_id}; user already entered engagement name, second naming menu was noise - Split run_scan.yml single command with conditional Jinja prefix into two when-gated tasks; empty-string prefix from use_tor=false caused Ansible to fail with return code 4 --- modules/webrunner/deploy_webrunner.py | 10 +++------- modules/webrunner/tasks/run_scan.yml | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/modules/webrunner/deploy_webrunner.py b/modules/webrunner/deploy_webrunner.py index 2baeb06..50f9a42 100644 --- a/modules/webrunner/deploy_webrunner.py +++ b/modules/webrunner/deploy_webrunner.py @@ -21,7 +21,7 @@ from utils.common import ( ) from utils.provider_utils import select_provider, gather_provider_config from utils.ssh_utils import generate_ssh_key -from utils.naming_utils import get_deployment_name_with_options, show_naming_relationship +from utils.naming_utils import show_naming_relationship from utils.deployment_engine import execute_playbook, set_provider_environment from utils.chunk_utils import get_country_cidrs, chunk_cidrs, ip_count from utils.provider_rates import ( @@ -223,12 +223,8 @@ def gather_webrunner_parameters() -> dict | None: config['deployment_type'] = 'webrunner' config['webrunner_deployment'] = True - # Naming - config['webrunner_name'] = get_deployment_name_with_options( - deployment_type='webrunner', - deployment_id=config['deployment_id'], - prefix='wr-', - ) + # Naming — auto-derive from deployment_id, no second prompt + config['webrunner_name'] = f"wr-{config['deployment_id']}" # SSH key ssh_key_path = generate_ssh_key(config['webrunner_name']) diff --git a/modules/webrunner/tasks/run_scan.yml b/modules/webrunner/tasks/run_scan.yml index 4877936..1709a6b 100644 --- a/modules/webrunner/tasks/run_scan.yml +++ b/modules/webrunner/tasks/run_scan.yml @@ -11,7 +11,6 @@ - name: Run scan on {{ node_name }} ({{ node_ip_count }} IPs, mode={{ scan_mode }}) command: > - {{ 'proxychains4 -f /etc/proxychains4.conf' if (use_tor | default(false) | bool) else '' }} python3 /root/webrunner/node_scanner.py --mode {{ scan_mode }} --ports {{ ports_str }} @@ -23,6 +22,23 @@ async: 43200 poll: 60 ignore_errors: true + when: not (use_tor | default(false) | bool) + +- name: Run scan via Tor on {{ node_name }} ({{ node_ip_count }} IPs, mode={{ scan_mode }}) + command: > + proxychains4 -f /etc/proxychains4.conf + python3 /root/webrunner/node_scanner.py + --mode {{ scan_mode }} + --ports {{ ports_str }} + --rate {{ masscan_rate }} + --node-name {{ node_name }} + args: + chdir: /root/webrunner + register: scan_output + async: 43200 + poll: 60 + ignore_errors: true + when: use_tor | default(false) | bool - name: Show scan output for {{ node_name }} debug: