这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@LuitelSamikshya
Copy link
Contributor

@LuitelSamikshya LuitelSamikshya commented Dec 3, 2021

This PR has a dependency to projectdiscovery/goflags#32 and provides following support:

  • provides go flags support

  • safely remove following controls from the current config file as we already this information in the code resolvers,sources, all-sources,recursive

  • Creates default goflags config for the subfinder at $HOME/.config/subfinder/config.yaml

  • supports custom source/provider config file

@LuitelSamikshya LuitelSamikshya linked an issue Dec 3, 2021 that may be closed by this pull request
@LuitelSamikshya LuitelSamikshya self-assigned this Dec 3, 2021
@LuitelSamikshya LuitelSamikshya added the Type: Enhancement Most issues will probably ask for additions or changes. label Dec 3, 2021
@Mzack9999 Mzack9999 added the Status: On Hold Similar to blocked, but is assigned to someone label Dec 6, 2021
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

As discussed, if the config file can't be YAML unmarshaled due to deprecated structure, let's warn the user and exit. It may be possible that it's also necessary to modify https://github.com/projectdiscovery/goflags to detect the error. If that's the case, let's track it into a separate GH issue in the goflags repository.

@Mzack9999 Mzack9999 added Status: In Progress This issue is being worked on, and has someone assigned. and removed Status: On Hold Similar to blocked, but is assigned to someone labels Dec 7, 2021
@LuitelSamikshya LuitelSamikshya marked this pull request as draft December 9, 2021 16:28
@LuitelSamikshya
Copy link
Contributor Author

LuitelSamikshya commented Dec 14, 2021

Modification in the go flags library is being tracked https://github.com/projectdiscovery/goflags/issues/31

@LuitelSamikshya LuitelSamikshya marked this pull request as ready for review December 14, 2021 19:20
@Mzack9999 Mzack9999 changed the title Issue 378 goflag support goflags support Dec 15, 2021
@Mzack9999 Mzack9999 removed the Status: In Progress This issue is being worked on, and has someone assigned. label Dec 15, 2021
Copy link
Member

@ehsandeep ehsandeep left a comment

Choose a reason for hiding this comment

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

@LuitelSamikshya unable to see new config file and scan is not running with this branch as well, here is example outputs:

$ git branch
  dev
* issue-378-goflag-support
  master
  pr/419
  pr/424
  pr/431
  pr/433
  pr/437
  pr/438
  pr/445
  pr/461

$ go build

$ ./subfinder -d hackerone.com

               __    _____           __         
   _______  __/ /_  / __(_)___  ____/ /__  _____
  / ___/ / / / __ \/ /_/ / __ \/ __  / _ \/ ___/
 (__  ) /_/ / /_/ / __/ / / / / /_/ /  __/ /    
/____/\__,_/_.___/_/ /_/_/ /_/\__,_/\___/_/ v2.4.9

		projectdiscovery.io

Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.
By using subfinder, you also agree to the terms of the APIs used.

[INF] loading the default
[INF] Enumerating subdomains for hackerone.com
[INF] Found 0 subdomains for hackerone.com in 144 microseconds

$ ls ~/.config/subfinder/
config.yaml

@ehsandeep ehsandeep added Status: Revision Needed Submitter of PR needs to revise the PR related to the issue. and removed status:in-review 🔨 labels Dec 16, 2021
@Mzack9999 Mzack9999 self-requested a review January 27, 2022 11:23
Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

It's necessary to update go.mod to use the latest commit of projectdiscovery/goflags#32

Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

Providers are correctly migrated to $HOME/.config/subfinder/provider.yaml, anyway invoking again the tool trigger an EOF error for $HOME/.config/subfinder/config.yaml. If no options are specified, the tool should load the default config from config.yaml and the providers from the default provider.yaml.

@LuitelSamikshya LuitelSamikshya marked this pull request as draft February 3, 2022 17:26
@LuitelSamikshya LuitelSamikshya marked this pull request as ready for review February 3, 2022 17:43
@Mzack9999 Mzack9999 dismissed stale reviews from ehsandeep and themself February 4, 2022 07:41

outdated

Copy link
Member

@Mzack9999 Mzack9999 left a comment

Choose a reason for hiding this comment

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

If the $home/.config/subfinder folder is empty I guess the application should re-generate empty configuration files:

$ rm -rf /Users/user/.config/subfinder/
$ echo hackerone.com | ./subfinder 

               __    _____           __         
   _______  __/ /_  / __(_)___  ____/ /__  _____
  / ___/ / / / __ \/ /_/ / __ \/ __  / _ \/ ___/
 (__  ) /_/ / /_/ / __/ / / / / /_/ /  __/ /    
/____/\__,_/_.___/_/ /_/_/ /_/\__,_/\___/_/ v2.4.9

                projectdiscovery.io

Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.
By using subfinder, you also agree to the terms of the APIs used.

[INF] loading the default
[FTL] Could not read configuration file /Users/user/.config/subfinder/provider.yaml: open /Users/user/.config/subfinder/provider.yaml: no such file or directory

@Mzack9999 Mzack9999 requested review from Mzack9999 and removed request for Mzack9999 February 4, 2022 07:46
@LuitelSamikshya
Copy link
Contributor Author

Screen Shot 2022-02-07 at 10 42 02 AM

@ehsandeep
Copy link
Member

Closing as this PR moved to #498

@ehsandeep ehsandeep closed this Feb 21, 2022
@ehsandeep ehsandeep deleted the issue-378-goflag-support branch February 21, 2022 14:32
@ehsandeep ehsandeep removed Status: Revision Needed Submitter of PR needs to revise the PR related to the issue. Type: Enhancement Most issues will probably ask for additions or changes. labels Feb 21, 2022
@ehsandeep ehsandeep removed the request for review from Mzack9999 February 21, 2022 14:33
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.

Adding goflags support

4 participants