nuclei icon indicating copy to clipboard operation
nuclei copied to clipboard

When using conditional workflows, only subtemplate shows in output

Open Mzack9999 opened this issue 1 year ago • 2 comments

Discussed in https://github.com/projectdiscovery/nuclei/discussions/2683

Originally posted by tryeng September 5, 2022 Workflow:

id: test

info:
  name: test workflow
  author: t
  description: Simple workflow running templates

workflows:
  - template: mydevice.yaml 
    subtemplates:
        - template: mydevice-default-password-check.yaml 

Output:

$ ./nuclei -w nuclei-templates/workflows/test.yaml -l input.txt

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   2.7.7

		projectdiscovery.io

[WRN] Use with caution. You are responsible for your actions.
[WRN] Developers assume no liability and are not responsible for any misuse or damage.
[INF] Using Nuclei Engine 2.7.7 (latest)
[INF] Using Nuclei Templates 9.1.8 (latest)
[INF] Workflows loaded for scan: 1
[2022-09-05 15:50:24] [mydevice-default-password-check] [http] [info] http://localhost:10001/

I would expect this to also show matches on the mydevice template. Currently this can be done by running mydevice twice, but that will take twice the number of requests and more cluttered workflow files.

Mzack9999 avatar Sep 06 '23 14:09 Mzack9999

hope awesome nuclei team will fix this!

k3mlol avatar Oct 17 '23 03:10 k3mlol

Hi, may I ask this bug have any plan to fix?

k3mlol avatar Nov 16 '23 08:11 k3mlol

Hi, may I ask this bug have any plan to fix?

k3mlol avatar May 11 '24 01:05 k3mlol

@k3mlol this is by design, here is workaround to get the expected result.

id: test

info:
  name: test workflow
  author: t
  description: Simple workflow running templates

workflows:
  - template: mydevice.yaml 
    subtemplates:
        - template: mydevice.yaml 
        - template: mydevice-default-password-check.yaml 

ehsandeep avatar May 11 '24 10:05 ehsandeep

Closing as it seems the design is not going to be changed - Summarizing for whom may incur into this behavior: it's necessary to execute again the condition template within subtemplates in order to have it among results

Mzack9999 avatar May 13 '24 07:05 Mzack9999