Workflows allow users to define an execution sequence for templates. The templates will be run on the defined conditions. These are the most efficient way to use nuclei, where all the templates are configured based on needs of users. This means, you can create Technology Based / Target based workflows, like WordPress Workflow, Jira Workflow which only run when the specific technology is detected.All templates part of a workflow share a common execution context, hence the named extractors from a template are accessible to other templates just by referring to it with its name.If the tech stack is known, we recommend creating your custom workflows to run your scans. This leads to much lower scan times with better results.Workflows can be defined with workflows attribute, following the template / subtemplates and tags to execute.
In generic workflow one can define single or multiple template to be executed from a single workflow file. It supports both files and directories as input.A workflow that runs all config related templates on the list of give URLs.
You can also create conditional templates which execute after matching the condition from a previous template. This is mostly useful for vulnerability detection and exploitation as well as tech based detection and exploitation. Use-cases for this kind of workflows are vast and varied.Templates based condition checkA workflow that executes subtemplates when base template gets matched.
In similar manner, one can create as many and as nested checks for workflows as needed.Subtemplate and matcher name based multi level conditional checkA workflow showcasing chain of template executions that run only if the previous templates get matched.
Conditional workflows are great examples of performing checks and vulnerability detection in most efficient manner instead of spraying all the templates on all the targets and generally come with good ROI on your time and is gentle for the targets as well.
Nuclei engine supports transparent workflow cookiejar and key-value sharing across templates parts of a same workflow. Here follow an example of a workflow that extract a value from the first template and use it in the second conditional one:
Copy
Ask AI
id: key-value-sharing-exampleinfo: name: Key Value Sharing Example author: pdteam severity: infoworkflows: - template: template-with-named-extractor.yaml subtemplates: - template: template-using-named-extractor.yaml
For example, the following templates extract href links from a target web page body and make the value available under the extracted key: