-
I'm trying to run the sample powershell code template from here but it fails with a signing issue. The steps I took are:
Result on Windows 11 -- signing issueI had expected the template to run, but it will not run saying it is not signed or tampered with:
However A nudge to resolve this issue would be appreciated! EnvironmentWindows 11 Enterprise Eval (Hyper-V quick create)
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
To execute code templates, use the
Could you try again and let us know if it works? |
Beta Was this translation helpful? Give feedback.
-
Hi @dogancanbakir, thanks for your response! I have executed a retry per your instructions below. It's the same command I had in my original post and it yields the same result. The code template is not executed. I don't understand why it's reporting |
Beta Was this translation helpful? Give feedback.
-
Hi @dogancanbakir, I found the signing issue. The result is: PS C:\Users\User\nuclei-templates> $Env:SHOW_DSL_ERRORS=$true
PS C:\Users\User\nuclei-templates> $Env:DEBUG=$true
PS C:\Users\User\nuclei-templates> $Env:NUCLEI_LOG_ALL=$true
PS C:\Users\User\nuclei-templates> "inputzzz" | nuclei -t .\example-code.yaml -code -vv -debug
__ _
____ __ _______/ /__ (_)
/ __ \/ / / / ___/ / _ \/ /
/ / / / /_/ / /__/ / __/ /
/_/ /_/\__,_/\___/_/\___/_/ v3.3.9
projectdiscovery.io
[url] got empty hostname for inputzzz skipping ip selection
[INF] Current nuclei version: v3.3.9 (latest)
[INF] Current nuclei-templates version: v10.1.3 (latest)
[WRN] Scan results upload to cloud is disabled.
[INF] New templates added in latest release: 52
[INF] Templates loaded for current scan: 1
[INF] Executing 1 signed templates from cert-user-name
[INF] Targets loaded for current scan: 1
[ps1-code-snippet] ps1-code-snippet (@pdteam) [info]
[DBG] [ps1-code-snippet] Dumped Executed Source Code for input/stdin: 'inputzzz'
---------------
Source Code:
---------------
$stdin = [Console]::In
$line = $stdin.ReadLine()
Write-Host "hello from $line"
---------------
Command Executed:
---------------
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File C:\Users\User\AppData\Local\Temp\nuclei-tmp-3301126859\541749567.ps1
---------------
Command Output:
---------------
hello from inputzzz
[WRN] Command Output here is stdout+sterr, in response variables they are seperate (use -v -svd flags for more details)
[DBG] [ps1-code-snippet] Dumped Code Execution for inputzzz
hello from inputzzz
[ps1-code-snippet:word-1] [code] [info] inputzzz |
Beta Was this translation helpful? Give feedback.
Hi @dogancanbakir, I found the signing issue.
When I save the code template yaml with Windows line endings (\r\n) it does not work because Nuclei claims it is not signed.
When I save the code template yaml with Unix line endings (\n) it works as expected.
I noticed because the template signer tests all use \n
The result is: