nuclei icon indicating copy to clipboard operation
nuclei copied to clipboard

Invalid action type: setmethod (headless)

Open ehsandeep opened this issue 3 years ago • 3 comments

Nuclei version:

dev,latest

Current Behavior:

Using setmethod action to set arbitrary method to use.

Expected Behavior:

Error: Invalid action type: setmethod

Steps To Reproduce:

id: test

info:
  name: test
  author: test
  severity: low

headless:
  - steps:
      - action: navigate
        args:
          url: "{{BaseURL}}"

      - action: setbody
        args:
          part: request
          body: |
            { "a": "b" }

      - action: setmethod
        args:
          part: request
          method: POST
echo https://example.com | nuclei -t tt.yaml -debug

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

		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.
[WRN] Could not load template /Users/geekboy/Github/nuclei-templates/tt.yaml: Invalid action type: setmethod

ehsandeep avatar Jul 28 '22 20:07 ehsandeep

The Invalid action type: setmethod part was resolved by https://github.com/projectdiscovery/nuclei/commit/d24736f655c2614509d8f86b4565c50f21ef45a4, but the template doesn't work correctly. Instead of a POST request with a body, it makes a GET:

image

forgedhallpass avatar Jul 29 '22 11:07 forgedhallpass

that was invalid template, this should work as expected, closing as updating to set-method works.

id: test

info:
  name: test
  author: test
  severity: low

headless:
  - steps:
      - action: navigate
        args:
          url: "{{BaseURL}}"

      - action: setbody
        args:
          part: request
          body: |
            { "a": "b" }

      - action: setmethod
        args:
          part: request
          method: POST
          
      - action: navigate
        args:
          url: "{{BaseURL}}"

ehsandeep avatar Jul 29 '22 17:07 ehsandeep

Fixed with https://github.com/projectdiscovery/nuclei/commit/d24736f655c2614509d8f86b4565c50f21ef45a4

ehsandeep avatar Jul 29 '22 20:07 ehsandeep