Skip to content

feat(cli): add custom dns resolver option #531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

khanhnt2
Copy link

What's changed:

  1. trust-dns-resolver is rebranded to hickory-resolver so I updated the dns resolver library to hickory-resolver, https://github.com/hickory-dns/hickory-dns/releases/tag/v0.24.0

  2. Add --resolver option to CLI to use custom dns resolver, you can pass the file path or string comma-delimited list. For example:

# Download resolvers list to a file
$ curl 'https://raw.githubusercontent.com/trickest/resolvers/main/resolvers-trusted.txt' -o 'resolvers-trusted.txt'
$ rustscan -a hackerone.com --resolver resolvers-trusted.txt

Or

$ rustscan -a hackerone.com --resolver 1.1.1.1,8.8.8.8

@bee-san
Copy link
Owner

bee-san commented Apr 6, 2024

Hi! Mind pushing an empty commit? CI has failed to pick this up and I think it'll only pick it up on a new commit? 🤔

@khanhnt2 khanhnt2 force-pushed the custom-dns-resolver branch from 252bfc4 to 1ac9c3f Compare April 7, 2024 09:12
@khanhnt2
Copy link
Author

khanhnt2 commented Apr 7, 2024

Hi @bee-san , I just pushed an empty commit, can you check again?

@bee-san
Copy link
Owner

bee-san commented Apr 7, 2024

Thank you @khanhnt2 !

Just some points :)

  • The linting is failing :(

I think this logic might work better:

  1. Read from default resolver file. In Linux this is this file. Maybe HickoryDNS has this built in already somewhere or an arg we can use?
    ^^ This should happen without an argument I think
  2. We have a Rustscan config file , I think you can use that here to define resolvers too as it'll be useful to not have to redefine them all the time, and you can have system-wide resolvers vs just Rustscan ones

If user enters the resolver argument:
3. Read from file
if fail to read file then:
4. Split string and use those as resolvers
5. If resolvers fail to... resolve, I think RustScan's error handling will take care of this already 🤔

What do you think? Let me know. Thank you for your contribution! <3 :) And maybe some tests would be nice too <3

@bee-san
Copy link
Owner

bee-san commented Apr 7, 2024

Maybe a bit much for 1 PR.

What about:

  1. Add some tests
  2. Check if Hickory uses the DNS default file?

And I'll make a ticket to address the others :)

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.

2 participants