Skip to content

implement TargetsFile and change logic of Targets - #884

Merged
forgedhallpass merged 8 commits into
projectdiscovery:devfrom
TerminalFi:impl/targets/targets_to_targetfile
Aug 4, 2021
Merged

forgedhallpass merged 8 commits into
projectdiscovery:devfrom
TerminalFi:impl/targets/targets_to_targetfile

Conversation

@TerminalFi

Copy link
Copy Markdown
Contributor

What

Change the existing flag list which correlates to Targets that loads a file full of targets into file which will correlate to a file for the TargetsFile option.

Implement a []string type for the Targets option and use the list flags to accept comma separated targets

@ehsandeep
ehsandeep changed the base branch from master to dev July 29, 2021 10:23

@forgedhallpass forgedhallpass left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to support this, we should rather change the -u, -target flag to accept multiple values (either CSV or by repeating the flag: -u http://host1:port1/path1 -u http://host2:port2/path2)

receive a goflags.StringSlice (`[]string`) as an argument
@TerminalFi

Copy link
Copy Markdown
Contributor Author

Updated

As we are still allowing single input per flag

@ehsandeep ehsandeep left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR introduces support for using multiple u/target flag similar to templates flag.

nuclei -u https://example.com -u https://google.com

Comment thread v2/internal/runner/runner.go Resolved
Comment thread v2/internal/runner/runner.go Resolved
Comment thread v2/pkg/types/types.go Resolved
Comment thread v2/cmd/nuclei/main.go Resolved
- Rename Targets -> TargetsFilePath
- Rename Target -> Targets
- Implement target checks (empty, dupe)
- Update documentation

@forgedhallpass forgedhallpass left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the minor changes in the comments. The rest looks good 👍

Comment thread v2/pkg/types/types.go Resolved
Comment thread v2/internal/runner/runner.go Resolved
Comment thread v2/internal/runner/runner.go Resolved
@forgedhallpass
forgedhallpass merged commit ef7591d into projectdiscovery:dev Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants