Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 22 additions & 22 deletions cmd/nuclei/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func main() {
if err != templates.ErrNotATemplate {
// skip warnings and errors as given items are not templates
errorCounter++
options.Logger.Error().Msgf("could not sign '%s': %s\n", iterItem, err)
options.Logger.Error().Msgf("Could not sign %q template: %s", iterItem, err)
}
} else {
successCounter++
Expand All @@ -108,10 +108,10 @@ func main() {
return nil
})
if err != nil {
options.Logger.Error().Msgf("%s\n", err)
options.Logger.Error().Msg(err.Error())
}
}
options.Logger.Info().Msgf("All templates signatures were elaborated success=%d failed=%d\n", successCounter, errorCounter)
options.Logger.Info().Msgf("All templates signatures were elaborated success=%d failed=%d", successCounter, errorCounter)
return
}

Expand All @@ -122,7 +122,7 @@ func main() {
createProfileFile := func(ext, profileType string) *os.File {
f, err := os.Create(memProfile + ext)
if err != nil {
options.Logger.Fatal().Msgf("profile: could not create %s profile %q file: %v", profileType, f.Name(), err)
options.Logger.Fatal().Msgf("Could not create %s profile %q file: %v", profileType, f.Name(), err)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify createProfileFile uses f.Name() in os.Create error branch.
rg -n -C3 'createProfileFile|os\.Create\(|f\.Name\(\)' cmd/nuclei/main.go

Repository: projectdiscovery/nuclei

Length of output: 719


Nil pointer dereference in profile creation error handler.

Line 125: f.Name() is called after a failed os.Create(), but f will be nil and cause a panic before the error is logged.

Suggested fix
 		createProfileFile := func(ext, profileType string) *os.File {
-			f, err := os.Create(memProfile + ext)
+			profilePath := memProfile + ext
+			f, err := os.Create(profilePath)
 			if err != nil {
-				options.Logger.Fatal().Msgf("Could not create %s profile %q file: %v", profileType, f.Name(), err)
+				options.Logger.Fatal().Msgf("Could not create %s profile %q file: %v", profileType, profilePath, err)
 			}
 			return f
 		}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
options.Logger.Fatal().Msgf("Could not create %s profile %q file: %v", profileType, f.Name(), err)
createProfileFile := func(ext, profileType string) *os.File {
profilePath := memProfile + ext
f, err := os.Create(profilePath)
if err != nil {
options.Logger.Fatal().Msgf("Could not create %s profile %q file: %v", profileType, profilePath, err)
}
return f
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/nuclei/main.go` at line 125, The error log calls f.Name() after os.Create
failed, which can dereference nil; update the profile creation error handling in
the profile creation block so you do not access f when err != nil: check if err
!= nil and log the intended filename/path (use the existing target path variable
or the string passed to os.Create) instead of f.Name(), or only call f.Name()
after confirming f != nil; ensure the Fatal() call uses the safe name/path and
includes the original err.

}
return f
}
Expand All @@ -136,18 +136,18 @@ func main() {

// Start tracing
if err := trace.Start(traceFile); err != nil {
options.Logger.Fatal().Msgf("profile: could not start trace: %v", err)
options.Logger.Fatal().Msgf("Could not start trace: %v", err)
}

// Start CPU profiling
if err := pprof.StartCPUProfile(cpuProfileFile); err != nil {
options.Logger.Fatal().Msgf("profile: could not start CPU profile: %v", err)
options.Logger.Fatal().Msgf("Could not start CPU profile: %v", err)
}

defer func() {
// Start heap memory snapshot
if err := pprof.WriteHeapProfile(memProfileFile); err != nil {
options.Logger.Fatal().Msgf("profile: could not write memory profile: %v", err)
options.Logger.Fatal().Msgf("Could not write memory profile: %v", err)
}

pprof.StopCPUProfile()
Expand Down Expand Up @@ -192,7 +192,7 @@ func main() {
options.Logger.Info().Msgf("Uploading scan results to cloud...")
}
nucleiRunner.Close()
options.Logger.Info().Msgf("Creating resume file: %s\n", resumeFileName)
options.Logger.Info().Msgf("Creating resume file: %s", resumeFileName)
err := nucleiRunner.SaveResumeConfig(resumeFileName)
if err != nil {
return errkit.Wrap(err, "couldn't create crash resume file")
Expand All @@ -210,7 +210,7 @@ func main() {
signal.Notify(c, os.Interrupt)
go func() {
<-c
options.Logger.Info().Msgf("CTRL+C pressed: Exiting\n")
options.Logger.Info().Msgf("CTRL+C pressed: Exiting")
if options.DASTServer {
nucleiRunner.Close()
os.Exit(1)
Expand All @@ -222,10 +222,10 @@ func main() {
}
nucleiRunner.Close()
if options.ShouldSaveResume() {
options.Logger.Info().Msgf("Creating resume file: %s\n", resumeFileName)
options.Logger.Info().Msgf("Creating resume file: %s", resumeFileName)
err := nucleiRunner.SaveResumeConfig(resumeFileName)
if err != nil {
options.Logger.Error().Msgf("Couldn't create resume file: %s\n", err)
options.Logger.Error().Msgf("Couldn't create resume file: %s", err)
}
}
for _, f := range inlineSecretsTempFiles {
Expand Down Expand Up @@ -629,7 +629,7 @@ Additional documentation is available at: https://docs.nuclei.sh/getting-started
if strVal, ok := value.(string); ok {
err = options.Vars.Set(strVal)
if err != nil {
gologger.Warning().Msgf("Could not set variable from config file: %s\n", err)
gologger.Warning().Msgf("Could not set variable from config file: %s", err)
}
} else {
gologger.Warning().Msgf("Skipping non-string variable in config: %#v", value)
Expand Down Expand Up @@ -741,25 +741,25 @@ func readFlagsConfig(flagset *goflags.FlagSet) {
if err != nil {
// something went wrong either dir is not readable or something else went wrong upstream in `goflags`
// warn and exit in this case
options.Logger.Warning().Msgf("Could not read config file: %s\n", err)
options.Logger.Warning().Msgf("Could not read config file: %s", err)
return
}
cfgFile := config.DefaultConfig.GetFlagsConfigFilePath()
if !fileutil.FileExists(cfgFile) {
if !fileutil.FileExists(defaultCfgFile) {
// if default config does not exist, warn and exit
options.Logger.Warning().Msgf("missing default config file : %s", defaultCfgFile)
options.Logger.Warning().Msgf("Missing default config %q file", defaultCfgFile)
return
}
// if does not exist copy it from the default config
if err = fileutil.CopyFile(defaultCfgFile, cfgFile); err != nil {
options.Logger.Warning().Msgf("Could not copy config file: %s\n", err)
options.Logger.Warning().Msgf("Could not copy config file: %s", err)
}
return
}
// if config file exists, merge it with the default config
if err = flagset.MergeConfigFile(cfgFile); err != nil {
options.Logger.Warning().Msgf("failed to merge configfile with flags got: %s\n", err)
options.Logger.Warning().Msgf("Could not merge config file with flags: %s", err)
}
}

Expand All @@ -780,19 +780,19 @@ func printVersion() {
// printTemplateVersion prints the nuclei template version and exits.
func printTemplateVersion() {
cfg := config.DefaultConfig
options.Logger.Info().Msgf("Public nuclei-templates version: %s (%s)\n", cfg.TemplateVersion, cfg.TemplatesDirectory)
options.Logger.Info().Msgf("Public nuclei-templates version: %s (%q)", cfg.TemplateVersion, cfg.TemplatesDirectory)

if fileutil.FolderExists(cfg.CustomS3TemplatesDirectory) {
options.Logger.Info().Msgf("Custom S3 templates location: %s\n", cfg.CustomS3TemplatesDirectory)
options.Logger.Info().Msgf("Custom S3 templates location: %s", cfg.CustomS3TemplatesDirectory)
}
if fileutil.FolderExists(cfg.CustomGitHubTemplatesDirectory) {
options.Logger.Info().Msgf("Custom GitHub templates location: %s ", cfg.CustomGitHubTemplatesDirectory)
options.Logger.Info().Msgf("Custom GitHub templates location: %s", cfg.CustomGitHubTemplatesDirectory)
}
if fileutil.FolderExists(cfg.CustomGitLabTemplatesDirectory) {
options.Logger.Info().Msgf("Custom GitLab templates location: %s ", cfg.CustomGitLabTemplatesDirectory)
options.Logger.Info().Msgf("Custom GitLab templates location: %s", cfg.CustomGitLabTemplatesDirectory)
}
if fileutil.FolderExists(cfg.CustomAzureTemplatesDirectory) {
options.Logger.Info().Msgf("Custom Azure templates location: %s ", cfg.CustomAzureTemplatesDirectory)
options.Logger.Info().Msgf("Custom Azure templates location: %s", cfg.CustomAzureTemplatesDirectory)
}
os.Exit(0)
}
Expand Down Expand Up @@ -858,7 +858,7 @@ func findProfilePathById(profileId, templatesDir string) string {
return nil
})
if err != nil && err.Error() != "FOUND" {
options.Logger.Error().Msgf("%s\n", err)
options.Logger.Error().Msg(err.Error())
}
return profilePath
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tmc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ func main() {
gologger.DefaultLogger.SetMaxLevel(levels.LevelDebug)
}
if err := process(opts); err != nil {
gologger.Error().Msgf("could not process: %s\n", err)
gologger.Error().Msgf("could not process: %s", err)
}
Comment on lines 128 to 130
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Return a non-zero exit code on processing failure.

The branch logs an error but still exits with status 0, which makes automation treat failures as success.

Proposed fix
 if err := process(opts); err != nil {
 	gologger.Error().Msgf("could not process: %s", err)
+	os.Exit(1)
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if err := process(opts); err != nil {
gologger.Error().Msgf("could not process: %s\n", err)
gologger.Error().Msgf("could not process: %s", err)
}
if err := process(opts); err != nil {
gologger.Error().Msgf("could not process: %s", err)
os.Exit(1)
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cmd/tmc/main.go` around lines 128 - 130, The current error branch in main
(the if err := process(opts) { ... } in cmd/tmc/main.go) only logs the failure
but leaves the program exiting with status 0; update that branch to exit with a
non-zero status (e.g., call os.Exit(1)) after logging the error, or
alternatively propagate the error out of main so the runtime returns a non-zero
code; ensure you import "os" if you add os.Exit and reference the process(opts)
error path and its logging (gologger.Error().Msgf) when making the change.

}

Expand Down
8 changes: 4 additions & 4 deletions cmd/tools/signer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func main() {
if err != nil {
gologger.Fatal().Msgf("failed to create signer: %s", err)
}
gologger.Info().Msgf("Template Signer: %v\n", tmplSigner.Identifier())
gologger.Info().Msgf("Template Signer: %v", tmplSigner.Identifier())

// read file
bin, err := os.ReadFile(template)
Expand All @@ -67,15 +67,15 @@ func main() {
gologger.Info().Msgf("Signature Details:")
gologger.Info().Msgf("----------------")
gologger.Info().Msgf("Signature: %s", sig)
gologger.Info().Msgf("Content Hash (SHA256): %s\n", hex.EncodeToString(hash[:]))
gologger.Info().Msgf("Content Hash (SHA256): %s", hex.EncodeToString(hash[:]))

execOpts := defaultExecutorOpts(template)

tmpl, err := templates.Parse(template, nil, execOpts)
if err != nil {
gologger.Fatal().Msgf("failed to parse template: %s", err)
}
gologger.Info().Msgf("Template Verified: %v\n", tmpl.Verified)
gologger.Info().Msgf("Template Verified: %v", tmpl.Verified)

if !tmpl.Verified {
gologger.Info().Msgf("------------------------")
Expand All @@ -94,7 +94,7 @@ func main() {
gologger.Info().Msgf("Updated Signature Details:")
gologger.Info().Msgf("------------------------")
gologger.Info().Msgf("Signature: %s", sig2)
gologger.Info().Msgf("Content Hash (SHA256): %s\n", hex.EncodeToString(hash2[:]))
gologger.Info().Msgf("Content Hash (SHA256): %s", hex.EncodeToString(hash2[:]))
}
gologger.Info().Msgf("✓ Template signed & verified successfully")
}
Expand Down
2 changes: 1 addition & 1 deletion internal/runner/inputs.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (r *Runner) initializeTemplatesHTTPInput() (*hybrid.HybridMap, error) {

if r.options.ProbeConcurrency > 0 && swg.Size != r.options.ProbeConcurrency {
if err := swg.Resize(context.Background(), r.options.ProbeConcurrency); err != nil {
r.Logger.Error().Msgf("Could not resize workpool: %s\n", err)
r.Logger.Error().Msgf("Could not resize workpool: %s", err)
}
}

Expand Down
4 changes: 2 additions & 2 deletions internal/runner/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ func ParseOptions(options *types.Options) {
return nil
})
if err != nil {
options.Logger.Error().Msgf("%s\n", err)
options.Logger.Error().Msg(err.Error())
}
os.Exit(0)
Comment on lines 102 to 105
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Template profile listing should fail with non-zero status on walk errors.

After logging the filesystem error, the flow still exits with status 0, which hides failure from callers.

Proposed fix
 		if err != nil {
 			options.Logger.Error().Msg(err.Error())
+			os.Exit(1)
 		}
 		os.Exit(0)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if err != nil {
options.Logger.Error().Msgf("%s\n", err)
options.Logger.Error().Msg(err.Error())
}
os.Exit(0)
if err != nil {
options.Logger.Error().Msg(err.Error())
os.Exit(1)
}
os.Exit(0)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/runner/options.go` around lines 102 - 105, The current code logs
filesystem walk errors but always calls os.Exit(0); change the exit behavior so
that when an error occurs during the template/profile walk you exit with a
non-zero status (e.g., os.Exit(1)). Concretely, in the block using
options.Logger.Error().Msg(...) and os.Exit(...) ensure that the err != nil
branch performs the non-zero exit and only successes return/os.Exit(0); keep the
logging via options.Logger.Error().Msg(err.Error()) and adjust the os.Exit call
accordingly.

}
if options.StoreResponseDir != DefaultDumpTrafficOutputFolder && !options.StoreResponse {
options.Logger.Debug().Msgf("Store response directory specified, enabling \"store-resp\" flag automatically\n")
options.Logger.Debug().Msgf("Store response directory specified, enabling \"store-resp\" flag automatically")
options.StoreResponse = true
}
// Validate the options passed by the user and if any
Expand Down
34 changes: 17 additions & 17 deletions internal/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ import (
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/automaticscan"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/contextargs"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/globalmatchers"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/honeypotdetector"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/hosterrorscache"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/interactsh"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/protocolinit"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/honeypotdetector"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/uncover"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/common/utils/excludematchers"
"github.com/projectdiscovery/nuclei/v3/pkg/protocols/headless/engine"
Expand Down Expand Up @@ -124,7 +124,7 @@ func New(options *types.Options) (*Runner, error) {
if config.DefaultConfig.CanCheckForUpdates() {
if err := installer.NucleiVersionCheck(); err != nil {
if options.Verbose || options.Debug {
runner.Logger.Error().Msgf("nuclei version check failed got: %s\n", err)
runner.Logger.Error().Msgf("nuclei version check failed: %s", err)
}
}

Expand All @@ -141,23 +141,23 @@ func New(options *types.Options) (*Runner, error) {
DisablePublicTemplates: options.PublicTemplateDisableDownload,
}
if err := tm.FreshInstallIfNotExists(); err != nil {
runner.Logger.Warning().Msgf("failed to install nuclei templates: %s\n", err)
runner.Logger.Warning().Msgf("Failed to install nuclei-templates: %s", err)
}
if err := tm.UpdateIfOutdated(); err != nil {
runner.Logger.Warning().Msgf("failed to update nuclei templates: %s\n", err)
runner.Logger.Warning().Msgf("Failed to update nuclei-templates: %s", err)
}

if config.DefaultConfig.NeedsIgnoreFileUpdate() {
if err := installer.UpdateIgnoreFile(); err != nil {
runner.Logger.Warning().Msgf("failed to update nuclei ignore file: %s\n", err)
runner.Logger.Warning().Msgf("Failed to update nuclei ignore file: %s", err)
}
}

if options.UpdateTemplates {
// we automatically check for updates unless explicitly disabled
// this print statement is only to inform the user that there are no updates
if !config.DefaultConfig.NeedsTemplateUpdate() {
runner.Logger.Info().Msgf("No new updates found for nuclei templates")
runner.Logger.Info().Msgf("No new updates found for nuclei-templates")
}
// manually trigger update of custom templates
if ctm != nil {
Expand All @@ -184,7 +184,7 @@ func New(options *types.Options) (*Runner, error) {

if options.Headless {
if engine.MustDisableSandbox() {
runner.Logger.Warning().Msgf("The current platform and privileged user will run the browser without sandbox\n")
runner.Logger.Warning().Msgf("The current platform and privileged user will run the browser without sandbox")
}
browser, err := engine.New(options)
if err != nil {
Expand Down Expand Up @@ -397,7 +397,7 @@ func New(options *types.Options) (*Runner, error) {
}

if options.RateLimitMinute > 0 {
runner.Logger.Print().Msgf("[%v] %v", aurora.BrightYellow("WRN"), "rate limit per minute is deprecated - use rate-limit-duration")
runner.Logger.Warning().Msg("The rate-limit-minute flag is deprecated, use rate-limit-duration flag instead")
options.RateLimit = options.RateLimitMinute
options.RateLimitDuration = time.Minute
}
Expand Down Expand Up @@ -481,14 +481,14 @@ func (r *Runner) setupPDCPUpload(writer output.Writer) output.Writer {
creds, err := h.GetCreds()
if err != nil {
if err != pdcpauth.ErrNoCreds && !HideAutoSaveMsg {
r.Logger.Verbose().Msgf("Could not get credentials for cloud upload: %s\n", err)
r.Logger.Verbose().Msgf("Could not get credentials for cloud upload: %s", err)
}
r.pdcpUploadErrMsg = fmt.Sprintf("To view results on Cloud Dashboard, configure API key from %v", pdcpauth.DashBoardURL)
r.pdcpUploadErrMsg = fmt.Sprintf("To view results on Cloud Dashboard, configure API key from %s", pdcpauth.DashBoardURL)
return writer
}
uploadWriter, err := pdcp.NewUploadWriter(context.Background(), r.Logger, creds)
if err != nil {
r.pdcpUploadErrMsg = fmt.Sprintf("PDCP (%v) Auto-Save Failed: %s\n", pdcpauth.DashBoardURL, err)
r.pdcpUploadErrMsg = fmt.Sprintf("PDCP (%s) auto-save failed: %s\n", pdcpauth.DashBoardURL, err)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove trailing newline from pdcpUploadErrMsg to finish log normalization.

This message is later emitted with Logger.Warning().Msg(...); keeping \n here can produce double line breaks and is inconsistent with the rest of this PR’s newline cleanup.

Suggested fix
-		r.pdcpUploadErrMsg = fmt.Sprintf("PDCP (%s) auto-save failed: %s\n", pdcpauth.DashBoardURL, err)
+		r.pdcpUploadErrMsg = fmt.Sprintf("PDCP (%s) auto-save failed: %s", pdcpauth.DashBoardURL, err)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
r.pdcpUploadErrMsg = fmt.Sprintf("PDCP (%s) auto-save failed: %s\n", pdcpauth.DashBoardURL, err)
r.pdcpUploadErrMsg = fmt.Sprintf("PDCP (%s) auto-save failed: %s", pdcpauth.DashBoardURL, err)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@internal/runner/runner.go` at line 491, The pdcpUploadErrMsg string assigned
in runner.go includes a trailing "\n" which causes double line breaks when later
emitted via Logger.Warning().Msg; update the fmt.Sprintf call that sets
r.pdcpUploadErrMsg (using pdcpauth.DashBoardURL and err) to remove the trailing
newline so the message is normalized with the project's other log messages.

return writer
}
if r.options.ScanID != "" {
Expand Down Expand Up @@ -886,7 +886,7 @@ func (r *Runner) displayExecutionInfo(store *loader.Store) {
if tmplCount == 0 && workflowCount == 0 {
// if dast flag is used print explicit warning
if r.options.DAST {
r.Logger.Print().Msgf("[%v] No DAST templates found", aurora.BrightYellow("WRN"))
r.Logger.Warning().Msg("No DAST templates found")
}
stats.ForceDisplayWarning(templates.SkippedCodeTmplTamperedStats)
} else {
Expand All @@ -901,7 +901,7 @@ func (r *Runner) displayExecutionInfo(store *loader.Store) {
updateutils.Aurora = r.colorizer
versionInfo := func(version, latestVersion, versionType string) string {
if !cfg.CanCheckForUpdates() {
return fmt.Sprintf("Current %s version: %v (%s) - remove '-duc' flag to enable update checks", versionType, version, r.colorizer.BrightYellow("unknown"))
return fmt.Sprintf("Current %s version: %v (%s) - remove disable-update-check flag for updates", versionType, version, r.colorizer.BrightYellow("unknown"))
}
return fmt.Sprintf("Current %s version: %v %v", versionType, version, updateutils.GetVersionDescription(version, latestVersion))
}
Expand All @@ -910,7 +910,7 @@ func (r *Runner) displayExecutionInfo(store *loader.Store) {
gologger.Info().Msg(versionInfo(cfg.TemplateVersion, cfg.LatestNucleiTemplatesVersion, "nuclei-templates"))
if !HideAutoSaveMsg {
if r.pdcpUploadErrMsg != "" {
r.Logger.Warning().Msgf("%s", r.pdcpUploadErrMsg)
r.Logger.Warning().Msg(r.pdcpUploadErrMsg)
} else {
r.Logger.Info().Msgf("To view results on cloud dashboard, visit %v/scans upon scan completion.", pdcpauth.DashBoardURL)
}
Expand All @@ -928,7 +928,7 @@ func (r *Runner) displayExecutionInfo(store *loader.Store) {
value := v.Load()
if value > 0 {
if k == templates.Unsigned && !r.options.Silent && !config.DefaultConfig.HideTemplateSigWarning {
r.Logger.Print().Msgf("[%v] Loading %d unsigned templates for scan. Use with caution.", r.colorizer.BrightYellow("WRN"), value)
r.Logger.Warning().Msgf("Loading %d unsigned templates for scan. Use with caution.", value)
} else {
r.Logger.Info().Msgf("Executing %d signed templates from %s", value, k)
}
Expand Down Expand Up @@ -993,11 +993,11 @@ func UploadResultsToCloud(options *types.Options) error {
var r output.ResultEvent
err := dec.Decode(&r)
if err != nil {
options.Logger.Warning().Msgf("Could not decode jsonl: %s\n", err)
options.Logger.Warning().Msgf("Could not decode jsonl: %s", err)
continue
}
if err = uploadWriter.Write(&r); err != nil {
options.Logger.Warning().Msgf("[%s] failed to upload: %s\n", r.TemplateID, err)
options.Logger.Warning().Msgf("[%s] Failed to upload: %s", r.TemplateID, err)
}
}
uploadWriter.Close()
Expand Down
2 changes: 1 addition & 1 deletion internal/runner/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func (r *Runner) logAvailableTemplate(tplPath string) {
panic("not a template")
}
if err != nil {
r.Logger.Error().Msgf("Could not parse file '%s': %s\n", tplPath, err)
r.Logger.Error().Msgf("Could not parse file '%s': %s", tplPath, err)
} else {
r.verboseTemplate(tpl)
}
Expand Down
Loading
Loading