Skip to content

Commit

Permalink
fix -u input read (#5147)
Browse files Browse the repository at this point in the history
* fix `-u` input read

* Fix tests

---------

Co-authored-by: Ramana Reddy <[email protected]>
  • Loading branch information
dogancanbakir and RamanaReddy0M authored May 6, 2024
1 parent 673404a commit 907f5a0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions cmd/integration-test/profile-loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,25 @@ var profileLoaderTestcases = []TestCaseInfo{
type profileLoaderByRelFile struct{}

func (h *profileLoaderByRelFile) Execute(testName string) error {
results, err := testutils.RunNucleiWithArgsAndGetResults(false, "-tl", "-tp", "kev.yml")
results, err := testutils.RunNucleiWithArgsAndGetResults(false, "-tl", "-tp", "cloud.yml")
if err != nil {
return errorutil.NewWithErr(err).Msgf("failed to load template with id")
}
if len(results) < 267 {
return fmt.Errorf("incorrect result: expected more results than %d, got %v", 267, len(results))
if len(results) < 100 {
return fmt.Errorf("incorrect result: expected more results than %d, got %v", 100, len(results))
}
return nil
}

type profileLoaderById struct{}

func (h *profileLoaderById) Execute(testName string) error {
results, err := testutils.RunNucleiWithArgsAndGetResults(false, "-tl", "-tp", "kev")
results, err := testutils.RunNucleiWithArgsAndGetResults(false, "-tl", "-tp", "cloud")
if err != nil {
return errorutil.NewWithErr(err).Msgf("failed to load template with id")
}
if len(results) < 267 {
return fmt.Errorf("incorrect result: expected more results than %d, got %v", 267, len(results))
if len(results) < 100 {
return fmt.Errorf("incorrect result: expected more results than %d, got %v", 100, len(results))
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/nuclei/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ on extensive configurability, massive extensibility and ease of use.`)
*/

flagSet.CreateGroup("input", "Target",
flagSet.StringSliceVarP(&options.Targets, "target", "u", nil, "target URLs/hosts to scan", goflags.StringSliceOptions),
flagSet.StringSliceVarP(&options.Targets, "target", "u", nil, "target URLs/hosts to scan", goflags.CommaSeparatedStringSliceOptions),
flagSet.StringVarP(&options.TargetsFilePath, "list", "l", "", "path to file containing a list of target URLs/hosts to scan (one per line)"),
flagSet.StringSliceVarP(&options.ExcludeTargets, "exclude-hosts", "eh", nil, "hosts to exclude to scan from the input list (ip, cidr, hostname)", goflags.FileCommaSeparatedStringSliceOptions),
flagSet.StringVar(&options.Resume, "resume", "", "resume scan using resume.cfg (clustering will be disabled)"),
Expand Down

0 comments on commit 907f5a0

Please sign in to comment.