Prerequisites
Before installing the Nuclei SDK, ensure you have:- Go 1.21 or higher installed on your system
- A Go project initialized with
go mod init - Basic familiarity with Go programming
Installation methods
Using go get
The recommended way to install the Nuclei SDK is usinggo get:
- Download the latest version of the Nuclei library
- Add it to your
go.modfile - Download all required dependencies
Using import statement
Alternatively, you can add the import to your Go file and let your IDE handle the installation:Verify installation
Create a simple test file to verify the installation:test.go
Nuclei SDK initialized successfully!
Template installation
Nuclei templates are required to run scans. They can be installed automatically or manually.Automatic installation
Templates are automatically downloaded when you first run a scan:Manual installation
For concurrent usage or CI/CD environments, pre-install templates:Pre-installing templates is recommended when using
NewThreadSafeNucleiEngine or in automated environments to avoid race conditions.Project structure
A typical project using the Nuclei SDK might look like:Common installation issues
Module checksum mismatch
If you encounter checksum errors:Version conflicts
Ensure you’re using compatible versions:Build errors
If you encounter build errors, check your Go version:Environment variables
Optional environment variables for customization:Custom path for Nuclei templates directory
Custom path for Nuclei configuration file
Custom path for Nuclei reporting database
Next steps
Basic usage
Start using the SDK with simple examples
Configuration options
Explore all available configuration options