nuclei
nuclei copied to clipboard
Invalid action type: setmethod (headless)
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
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:

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}}"
Fixed with https://github.com/projectdiscovery/nuclei/commit/d24736f655c2614509d8f86b4565c50f21ef45a4