Files
CoM-c2itall/modules/webrunner/tasks/run_scan.yml
T
n0mad1k 13ce8a9b8a Add masscan+nuclei mode, operator tuning controls, and vars file support to webrunner
- New scan mode: masscan+nuclei — masscan finds open ip:port pairs,
  nuclei runs operator-supplied CVE template against discovered hosts
- Per-country vulnerable host count in merge output via CIDR→country lookup
- Tuning args on every scan: --nmap-timing, --nmap-timeout, --nmap-workers,
  --nuclei-rate, --nuclei-concurrency, --nuclei-timeout, --masscan-rate
- Vars file support: operator provides scan_vars.yaml to pre-fill all
  tuning settings without interactive prompts
- Templates copied to nodes at provision time — no live fetches (OPSEC)
- run_scan.yml passes all tuning args with Ansible defaults as fallback
- configure_node.yml installs nuclei binary + uploads template on demand
- Updated deployment summary shows mode-specific tuning params
- countries-format.md and targets-format.md updated for new capabilities
- scan_vars.yaml.example documents all configurable settings with comments
2026-05-02 14:49:24 -04:00

89 lines
2.5 KiB
YAML

---
# Run the assigned scan on this WEBRUNNER node
# Per-node vars: node_name, node_cidrs, node_ip_count, node_idx
# Global vars (from extra-vars): scan_mode, ports_str, masscan_rate, webrunner_name, deployment_id, use_tor
- name: Write CIDR list for {{ node_name }}
copy:
content: "{{ node_cidrs | join('\n') }}\n"
dest: /root/webrunner/cidrs.txt
mode: '0644'
- name: Run scan on {{ node_name }} ({{ node_ip_count }} IPs, mode={{ scan_mode }})
command:
argv:
- python3
- /root/webrunner/node_scanner.py
- --mode
- "{{ scan_mode }}"
- --ports
- "{{ ports_str }}"
- --rate
- "{{ masscan_rate }}"
- --node-name
- "{{ node_name }}"
- --nmap-timing
- "{{ nmap_timing | default(4) }}"
- --nmap-timeout
- "{{ nmap_timeout | default(60) }}"
- --nmap-workers
- "{{ nmap_workers | default(10) }}"
- --nuclei-rate
- "{{ nuclei_rate | default(150) }}"
- --nuclei-concurrency
- "{{ nuclei_concurrency | default(25) }}"
- --nuclei-timeout
- "{{ nuclei_timeout | default(10) }}"
- --template
- "{{ nuclei_template_remote | default('') }}"
args:
chdir: /root/webrunner
register: scan_output
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:
argv:
- proxychains4
- -f
- /etc/proxychains4.conf
- python3
- /root/webrunner/node_scanner.py
- --mode
- "{{ scan_mode }}"
- --ports
- "{{ ports_str }}"
- --rate
- "{{ masscan_rate }}"
- --node-name
- "{{ node_name }}"
- --nmap-timing
- "{{ nmap_timing | default(4) }}"
- --nmap-timeout
- "{{ nmap_timeout | default(60) }}"
- --nmap-workers
- "{{ nmap_workers | default(10) }}"
- --nuclei-rate
- "{{ nuclei_rate | default(150) }}"
- --nuclei-concurrency
- "{{ nuclei_concurrency | default(25) }}"
- --nuclei-timeout
- "{{ nuclei_timeout | default(10) }}"
- --template
- "{{ nuclei_template_remote | default('') }}"
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:
var: scan_output.stdout_lines
when: scan_output.stdout_lines is defined