nuclei-templates icon indicating copy to clipboard operation
nuclei-templates copied to clipboard

Issue with resolving version api (hosted on cloudflare) failing to install templates

Open cyb3rzest opened this issue 1 year ago • 11 comments

After removing and installing multiple times, using go install command as well as apt install nuclei, getting this below error

┌──(root💀ViTi-Security)-[~]
└─# nuclei -ut
                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v2.8.9
		projectdiscovery.io

[INF] nuclei-templates are not installed, installing...
[ERR] Could not update templates: Version string empty

Not only this, have manually downloaded the templates, and validated it, still giving the same error.

┌──(root💀ViTi-Security)-[~]
└─# nuclei -validate /root/nuclei-templates 
                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v2.8.9
		projectdiscovery.io
[INF] All templates validated successfully
                                                                                                               
┌──(root💀ViTi-Security)-[~]
└─# nuclei -ut                             
                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v2.8.9
		projectdiscovery.io
[INF] nuclei-templates are not installed, installing...
[ERR] Could not update templates: Version string empty

cyb3rzest avatar Feb 24 '23 09:02 cyb3rzest

Hi @cyb3rzest is it possible share the some info regarding which operating system you are trying to install

DhiyaneshGeek avatar Feb 25 '23 08:02 DhiyaneshGeek

Hi @cyb3rzest is it possible share the some info regarding which operating system you are trying to install

Hi, I am using Kali Linux 2022.4, temporarily fixed it, but its needed to be rectified

cyb3rzest avatar Mar 01 '23 18:03 cyb3rzest

@DhiyaneshGeek its not fixed till now. Could not update templates: could not read configuration file: EOF image

cyb3rzest avatar Mar 07 '23 13:03 cyb3rzest

Can you provide more context about kali linux version? Is it running in a container? In a virtualized environment (eg. VirtualBox)?

Could you post the output of nuclei -hc?

Thanks!

Mzack9999 avatar Mar 30 '23 15:03 Mzack9999

@Mzack9999 it was in 2.8.9 and its fixed in version 2.9.x I was using it in both, vmware as well as on host.

cyb3rzest avatar Mar 30 '23 15:03 cyb3rzest

I'm having the same issue, MacOS Ventura 13.1, Macbook M1. It's a clean install via brew.

Steps to reproduce:

  1. rm -rf ~/.config/nuclei
  2. brew remove nuclei
  3. brew install nuclei
  4. nuclei -ut
image

Verbose output image

I tried accessing that URL via browser and it loaded fine image

I do have dns configured to use pihole, but tried with it enabled as well as disabled. I killed mdnsresponder in between tests as well (that should flush the local dns cache).

This is working for me via a github action, though.

The default ~/.config/nuclei/config.yaml has everything commented out and is effectively blank. See https://pastebin.com/WbWqG8mk

derekmurawsky avatar Apr 06 '23 21:04 derekmurawsky

I was able to install it from another machine on my network, so there's clearly something up with my mac. I'll keep poking at it and post anything I find here.

I did notice that even curl would take a long time to start from within my shell (iterm2/zsh). I'll start poking there.

derekmurawsky avatar Apr 06 '23 22:04 derekmurawsky

@derekmurawsky Yes, looks like some dns issue on the system, Can you try with using -sr option as well?

   -sr, -system-resolvers  use system DNS resolving as error fallback

ehsandeep avatar Apr 07 '23 10:04 ehsandeep

@derekmurawsky Yes, looks like some dns issue on the system, Can you try with using -sr option as well?

   -sr, -system-resolvers  use system DNS resolving as error fallback

It's definitely something specific to my terminal. Brave works, sshing to a local server and doing it there works, but curl takes exactly 30.x seconds, which screams DNS timeout or similar. The output of the SR command was:

image

The interesting thing here is that DNS works perfectly via dig. Both my local dns servers respond instantly with the correct information. I suspected I might have a proxy configured, but that seems to be blank/not configured as well.

I'm going to spend some time debugging my zsh config to see if I can isolate the problem.

ETA: I set up a test user on my system and everything worked fine from there, so it's definitely something with my ZSH setup. Will update here when I figure it out in case others come upon this thread.

derekmurawsky avatar Apr 07 '23 14:04 derekmurawsky

I updated the title based on what we know about this issue.

Users reported nuclei failed to resolve version API (hosted on Cloudflare), failing to install templates / ignore file.

How to reproduce this?

We still don't know how to replicate this on our side as only a few of the users are facing this issue, and most of the time, running nuclei on

  • Kali OS
  • Behind VPN / Proxy

ehsandeep avatar Apr 08 '23 07:04 ehsandeep

At current time with latest kali linux the issue appears to be standard certificates not installed on the system:

# nuclei -v

                     __     _
   ____  __  _______/ /__  (_)
  / __ \/ / / / ___/ / _ \/ /
 / / / / /_/ / /__/ /  __/ /
/_/ /_/\__,_/\___/_/\___/_/   v2.9.4

                projectdiscovery.io

[WRN] failed to update nuclei templates: [:RUNTIME] failed to install templates at /root/.local/nuclei-templates <- [:RUNTIME] Get "https://api.github.com/repos/projectdiscovery/nuclei-templates/releases/latest": x509: certificate signed by unknown authority
[ERR] Could not find template '/root/.local/nuclei-templates': no templates found in path /root/.local/nuclei-templates
[INF] Current nuclei version: v2.9.4 (latest)
[INF] Current nuclei-templates version:  (outdated)
[INF] No results found. Better luck next time!
[FTL] Could not run nuclei: no valid templates were found

It can be fixed generally by installing the following packages:

$ sudo apt install git curl build-essential

Mzack9999 avatar May 25 '23 13:05 Mzack9999

Due to inactivity, we are closing this issue. Please don't hesitate to create a new issue if you encounter any bugs or have any questions regarding template writing. Feel free to join our Discord server

princechaddha avatar Jun 15 '23 08:06 princechaddha