This Ansible Galaxy role installs and configures the Nuclei Scanner, a powerful tool for vulnerability scanning and configuration management.
- Supported Operating Systems: Linux (e.g., Ubuntu, CentOS) , Windows and Mac
- Dependencies:
unzip
package must be available on the system.
Available variables are listed below, along with their default values in defaults/main.yml
:
nuclei_download_url: "https://github.com/projectdiscovery/nuclei/releases/latest/download/nuclei.zip"
nuclei_install_path: "/usr/local/bin"
nuclei_data_path: "/opt/nuclei-templates"
This role has no specific dependencies.
for example install_nuclei.yml
---
- name: Install and run nuclei
hosts: target-machines
become: true
roles:
- nuclei
for ansible.cfg
[default]
inventory = ./inventory.ini
remote_user = root
log_path = ./log/ansible.log
[privilege_escalation]
become = true
become_user = root
become_method = sudo
for inventory.ini
file
[target-machines]
192.168.56.10 ansible_user=root
192.168.56.11 ansible_user=root
- Downloads the Nuclei binary ZIP file from the specified URL.
- Extracts the binary to the defined installation path.
- Ensures the installation directory exists.
- Downloads the latest Nuclei templates to the defined data path.
- Updates templates if they already exist.
- Provides a simple wrapper for running the
nuclei
binary with specific options.
After installing the role, you can run Nuclei as follows:
for spilt input list:
copy input
file into /tmp/input.txt
cp <your input list> /tmp/input.txt
ansible-playbook -i inventory.ini ./install_nuclei.yml --tags "split"
for running single target use -u <host>
you should:
ansible-playbook -i inventory.ini ./install_nuclei.yml -e "nuclei_args= -u example.com -t ssl " --tags "run"
for running list targets:
ansible-playbook -i inventory.ini ./install_nuclei.yml -e "nuclei_args='-list /tmp/*.csv -t ssl'" --tags "run"
for collect results from workers:
ansible-playbook -i inventory.ini ./install_nuclei.yml --tags "collect"
and find the results on master in this path:
/tmp/fetched_files/
MIT
This role was created by DannyRavi.