katana icon indicating copy to clipboard operation
katana copied to clipboard

[FTL] could not create runner: %!s(<nil>)

Open NitescuLucian opened this issue 1 year ago • 4 comments

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:

  1. Run 'katana -version' or 'katana --version'.
  2. See error...

Anything else:

image

NitescuLucian avatar Nov 08 '22 08:11 NitescuLucian

@NitescuLucian is it an issue with -version option only or do you see the same issue with crawl as well?

ehsandeep avatar Nov 08 '22 11:11 ehsandeep

@ehsandeep I do not follow you last questions... you mean this? should it crawl or not? image

NitescuLucian avatar Nov 08 '22 11:11 NitescuLucian

@NitescuLucian no, I mean, do you see the same error when you do echo https://hackerone.com/ | katana?

ehsandeep avatar Nov 08 '22 11:11 ehsandeep

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.

mschader avatar Nov 08 '22 11:11 mschader