Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ca5ua1 opened this issue Feb 6, 2024 · 1 comment · Fixed by #946
Closed

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

ca5ua1 opened this issue Feb 6, 2024 · 1 comment · Fixed by #946
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Milestone

Comments

@ca5ua1
Copy link

ca5ua1 commented Feb 6, 2024

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

@ca5ua1 ca5ua1 added the Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors. label Feb 6, 2024
@Mzack9999 Mzack9999 linked a pull request Feb 6, 2024 that will close this issue
@Mzack9999
Copy link
Member

Thanks for opening the issue @ca5ua1 - It should be fixed with #946 (currently the output configuration happens only when the runner is instantiated by CLI, I moved it within the runner itself, so it should cover also the sdk case)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Completed Nothing further to be done with this issue. Awaiting to be closed. Type: Bug Inconsistencies or issues which will cause an issue or problem for users or implementors.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants