kushvaibhav / PyNuclei

PyNuclei is an unofficial Python library for Nuclei Scanner.
MIT License
10 stars 4 forks source link

Path not recognise #6

Open LocaMartin opened 1 month ago

LocaMartin commented 1 month ago

CODE

from PyNuclei import Nuclei

# Define the path to the Nuclei binary
nuclei_path = "/home/loca/go/bin/nuclei"

# Initialize the Nuclei scanner
nuclei_scanner = Nuclei(nuclei_path)

try:
    # Attempt to print details about the Nuclei templates
    template_details = nuclei_scanner.returnTemplatesDetails()
    print("Nuclei Template Details:")
    print(template_details)
except Exception as e:
    print(f"An error occurred: {e}")

OUTPUT

[Running] python -u "/home/loca/Desktop/dork/pi_nuclei.py"
[PyNuclei] [INFO] Configuring PyNuclei for First Run...
Traceback (most recent call last):
  File "/home/loca/Desktop/dork/pi_nuclei.py", line 3, in <module>
    nucleiScanner = Nuclei(nucleiPath)
                    ^^^^^^^^^^^^^^^^^^
  File "/home/loca/.local/lib/python3.11/site-packages/PyNuclei/PyNuclei.py", line 52, in __init__
    Nuclei.checkFirstRun(self.nucleiPath)
  File "/home/loca/.local/lib/python3.11/site-packages/PyNuclei/PyNuclei.py", line 73, in checkFirstRun
    Nuclei.updateNuclei(True, nucleiPath)
  File "/home/loca/.local/lib/python3.11/site-packages/PyNuclei/PyNuclei.py", line 89, in updateNuclei
    Nuclei.isNucleiInstalled(nucleiPath)
  File "/home/loca/.local/lib/python3.11/site-packages/PyNuclei/PyNuclei.py", line 64, in isNucleiInstalled
    raise NucleiNotFound("[PyNuclei] [ERROR] Nuclei not found in path")
PyNuclei.PyNuclei.NucleiNotFound: [PyNuclei] [ERROR] Nuclei not found in path

[Done] exited with code=1 in 0.677 seconds

PATH

┌──(loca㉿loca)-[~/go/bin]
└─$ ls
anew    gau  httpx   nuclei     shortscan  waybackurls
dalfox  gf   katana  qsreplace  tlsx

┌──(loca㉿loca)-[~/go/bin]
└─$ pwd                                   
/home/loca/go/bin

DEBUG

[{
    "resource": "/home/loca/Desktop/dork/pi_nuclei.py",
    "owner": "_generated_diagnostic_collection_name_#2",
    "code": {
        "value": "reportMissingImports",
        "target": {
            "$mid": 1,
            "path": "/microsoft/pyright/blob/main/docs/configuration.md",
            "scheme": "https",
            "authority": "github.com",
            "fragment": "reportMissingImports"
        }
    },
    "severity": 4,
    "message": "Import \"PyNuclei\" could not be resolved",
    "source": "Pylance",
    "startLineNumber": 1,
    "startColumn": 6,
    "endLineNumber": 1,
    "endColumn": 14
}]
nrathaus commented 1 month ago

Nuclei Path needs to be just the path where the file 'nuclei' is present - not the whole path and filename

Try changing the provided path to not include 'nuclei' in it as it's already added when the library starts

nrathaus commented 1 month ago

This can be closed, its not a bug