goscan icon indicating copy to clipboard operation
goscan copied to clipboard

runtime error: index out of range due to incomplete command

Open butterflyx opened this issue 4 years ago • 1 comments

Hi Marco,

goscan looks very promising to me. Thank you for your development effort and publishing it as open source. 😃

I downloaded and use v.2.4 on a kali 2020.1 box and can provoke a crash using a incomplete command, just by leaving out the IP/target:

[goscan] > load target SINGLE
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/marco-lancini/goscan/core/utils.ParseNextArg(...)
	/go/src/github.com/marco-lancini/goscan/core/utils/utils.go:116
github.com/marco-lancini/goscan/core/cli.cmdLoad(0xc420076760, 0x2, 0x2, 0x4)
	/go/src/github.com/marco-lancini/goscan/core/cli/executor.go:115 +0x764
github.com/marco-lancini/goscan/core/cli.Executor(0xc42025cce0, 0x12)
	/go/src/github.com/marco-lancini/goscan/core/cli/executor.go:23 +0x14e
github.com/marco-lancini/goscan/vendor/github.com/c-bata/go-prompt.(*Prompt).Run(0xc4200622a0)
	/go/src/github.com/marco-lancini/goscan/vendor/github.com/c-bata/go-prompt/prompt.go:77 +0x688
main.main()
	/go/src/github.com/marco-lancini/goscan/main.go:67 +0xee

I would expect an error message and no crash. I can reproduce this crash.

image

butterflyx avatar Jul 14 '20 18:07 butterflyx

Hi @butterflyx, sorry for the late reply and thanks for raising this.

Would you have any bandwidth to tackle this?

marco-lancini avatar Aug 22 '20 11:08 marco-lancini