Skip to content

Silent doesn't work. Naabu (as a library) is too verbose.  #958

@ca5ua1

Description

@ca5ua1

Hi, I try to use Naabu as a library and the problem I have is that Naabu generate on its own terminal output what I don't want without verbose flag.

Naabu version: v2.2.1

Current Behavior:

When running scan with Naabu library it writes following lines in stdout:

[INF] Running CONNECT scan with non root privileges
[INF] Found 2 ports on host scanme.sh (128.199.158.128)
scanme.sh:443
scanme.sh:80

Even with silent flag set to true

When running Naabu itself with -silent flag the output is:

scanme.sh:443
scanme.sh:80

Expected Behavior:

No output at all with silent flag. Maybe new -silent-full flag or levels to silent flag

Ideally would be amazing to also have control over [INF] Running ... to pass it to log file for example (in context of library usage)

Steps To Reproduce:

Add Silent: true, option to example so it would look like that:

package main

import (
	"log"

	"github.com/projectdiscovery/goflags"
	"github.com/projectdiscovery/naabu/v2/pkg/result"
	"github.com/projectdiscovery/naabu/v2/pkg/runner"
)

func main() {
	options := runner.Options{
		Host:      goflags.StringSlice{"scanme.sh"},
		ScanType: "s",
		OnResult: func(hr *result.HostResult) {
			log.Println(hr.Host, hr.Ports)
		},
		Ports: "80",
                Silent: true,
	}

	naabuRunner, err := runner.NewRunner(&options)
	if err != nil {
		log.Fatal(err)
	}
	defer naabuRunner.Close()

	naabuRunner.RunEnumeration()
}

Btw, maybe naabu library need some documentation? As already stated in #432

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: CompletedNothing further to be done with this issue. Awaiting to be closed.Type: BugInconsistencies or issues which will cause an issue or problem for users or implementors.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions