katana
katana copied to clipboard
[FTL] could not create runner: %!s(<nil>)
katana version:
lucian@h:~$ katana -version
__ __
/ /_____ _/ /____ ____ ___ _
/ '_/ _ / __/ _ / _ \/ _ /
/_/\_\\_,_/\__/\_,_/_//_/\_,_/ v0.0.1
projectdiscovery.io
[WRN] Use with caution. You are responsible for your actions.
[WRN] Developers assume no liability and are not responsible for any misuse or damage.
[INF] Current version: v0.0.1
[FTL] could not create runner: %!s(<nil>)
Current Behavior:
When running katana -version
we get: [FTL] could not create runner: %!s(<nil>)
Expected Behavior:
The output should only contain the version and headers.
Steps To Reproduce:
Example: steps to reproduce the behavior:
- Run 'katana -version' or 'katana --version'.
- See error...
Anything else:
@NitescuLucian is it an issue with -version
option only or do you see the same issue with crawl as well?
@ehsandeep I do not follow you last questions... you mean this? should it crawl or not?
@NitescuLucian no, I mean, do you see the same error when you do echo https://hackerone.com/ | katana
?
This seems to be related to the return value in case of the version flag being set in internal/runner/runner.go
if options.Version {
gologger.Info().Msgf("Current version: %s", version)
return nil, nil
}
This will lead to always returning a Fatal() message after creating the runner:
runner, err := runner.New(options)
if err != nil || runner == nil {
gologger.Fatal().Msgf("could not create runner: %s\n", err)
}
I have added a check to this part if the version option is set and return in that case, but I am not sure if this is the cleanest way. Will create a MR in a second.