Closed ovakisan closed 3 years ago
I think this might be the same issue as - https://github.com/sensepost/gowitness/issues/67
.\gowitness-2.1.1-windows-amd64.exe scan --cidr 10.3.18.0/28 --threads 20 --debug
`panic: unable to redefine 'p' shorthand in "scan" flagset: it's already used for "ports" flag
goroutine 1 [running]: github.com/spf13/pflag.(FlagSet).AddFlag(0xc000138a00, 0xc00027a000) /go/pkg/mod/github.com/spf13/pflag@v1.0.3/flag.go:862 +0x6de github.com/spf13/pflag.(FlagSet).AddFlagSet.func1(0xc00027a000) /go/pkg/mod/github.com/spf13/pflag@v1.0.3/flag.go:875 +0xaf github.com/spf13/pflag.(FlagSet).VisitAll(0xc000138f00, 0xc00011db28) /go/pkg/mod/github.com/spf13/pflag@v1.0.3/flag.go:278 +0x9b github.com/spf13/pflag.(FlagSet).AddFlagSet(0xc000138a00, 0xc000138f00) /go/pkg/mod/github.com/spf13/pflag@v1.0.3/flag.go:873 +0x5f github.com/spf13/cobra.(Command).mergePersistentFlags(0xbbe860) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:1612 +0x97 github.com/spf13/cobra.stripFlags(0xc0002584b0, 0x5, 0x5, 0xbbe860, 0x5, 0x0, 0x5) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:554 +0x58 github.com/spf13/cobra.(Command).Find.func1(0xbbe860, 0xc0002584b0, 0x5, 0x5, 0x4, 0xc0002584b0, 0x5, 0x5) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:613 +0x63 github.com/spf13/cobra.(Command).Find.func1(0xbbe5c0, 0xc00011e010, 0x6, 0x7, 0xa69acc, 0xd2cb20, 0xc0001fefc0, 0x8) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:621 +0x120 github.com/spf13/cobra.(Command).Find(0xbbe5c0, 0xc00011e010, 0x6, 0x7, 0x2, 0xc00002e090, 0x88, 0xc00027e000, 0xc00011de30, 0xa694d2) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:626 +0x93 github.com/spf13/cobra.(Command).initCompleteCmd(0xbbe5c0, 0xc00011e010, 0x6, 0x7) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/custom_completions.go:127 +0x2d2 github.com/spf13/cobra.(Command).ExecuteC(0xbbe5c0, 0x4460a1, 0xb7c1e0, 0xc00004a000) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:919 +0x104 github.com/spf13/cobra.(*Command).Execute(...) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887 github.com/sensepost/gowitness/cmd.Execute() /go/src/github.com/sensepost/gowitness/cmd/root.go:49 +0x38 main.main() /go/src/github.com/sensepost/gowitness/main.go:6 +0x27`
Maybe this part of the code is the issue, can't verify it at the moment: scanCmd.Flags().StringVarP(&options.ScanPorts, "ports", "p", "", "comma separated list of extra ports to scan")
scanCmd.Flags().StringVarP(&options.ScanPorts, "ports", "p", "", "comma separated list of extra ports to scan")
Wups! Pushing a fix shortly. Thanks for the report!
I released 2.1.2 fixing this.
I think this might be the same issue as - https://github.com/sensepost/gowitness/issues/67
.\gowitness-2.1.1-windows-amd64.exe scan --cidr 10.3.18.0/28 --threads 20 --debug
`panic: unable to redefine 'p' shorthand in "scan" flagset: it's already used for "ports" flag
goroutine 1 [running]: github.com/spf13/pflag.(FlagSet).AddFlag(0xc000138a00, 0xc00027a000) /go/pkg/mod/github.com/spf13/pflag@v1.0.3/flag.go:862 +0x6de github.com/spf13/pflag.(FlagSet).AddFlagSet.func1(0xc00027a000) /go/pkg/mod/github.com/spf13/pflag@v1.0.3/flag.go:875 +0xaf github.com/spf13/pflag.(FlagSet).VisitAll(0xc000138f00, 0xc00011db28) /go/pkg/mod/github.com/spf13/pflag@v1.0.3/flag.go:278 +0x9b github.com/spf13/pflag.(FlagSet).AddFlagSet(0xc000138a00, 0xc000138f00) /go/pkg/mod/github.com/spf13/pflag@v1.0.3/flag.go:873 +0x5f github.com/spf13/cobra.(Command).mergePersistentFlags(0xbbe860) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:1612 +0x97 github.com/spf13/cobra.stripFlags(0xc0002584b0, 0x5, 0x5, 0xbbe860, 0x5, 0x0, 0x5) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:554 +0x58 github.com/spf13/cobra.(Command).Find.func1(0xbbe860, 0xc0002584b0, 0x5, 0x5, 0x4, 0xc0002584b0, 0x5, 0x5) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:613 +0x63 github.com/spf13/cobra.(Command).Find.func1(0xbbe5c0, 0xc00011e010, 0x6, 0x7, 0xa69acc, 0xd2cb20, 0xc0001fefc0, 0x8) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:621 +0x120 github.com/spf13/cobra.(Command).Find(0xbbe5c0, 0xc00011e010, 0x6, 0x7, 0x2, 0xc00002e090, 0x88, 0xc00027e000, 0xc00011de30, 0xa694d2) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:626 +0x93 github.com/spf13/cobra.(Command).initCompleteCmd(0xbbe5c0, 0xc00011e010, 0x6, 0x7) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/custom_completions.go:127 +0x2d2 github.com/spf13/cobra.(Command).ExecuteC(0xbbe5c0, 0x4460a1, 0xb7c1e0, 0xc00004a000) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:919 +0x104 github.com/spf13/cobra.(*Command).Execute(...) /go/pkg/mod/github.com/spf13/cobra@v1.0.0/command.go:887 github.com/sensepost/gowitness/cmd.Execute() /go/src/github.com/sensepost/gowitness/cmd/root.go:49 +0x38 main.main() /go/src/github.com/sensepost/gowitness/main.go:6 +0x27`
Maybe this part of the code is the issue, can't verify it at the moment:
scanCmd.Flags().StringVarP(&options.ScanPorts, "ports", "p", "", "comma separated list of extra ports to scan")