projectdiscovery / dnsx

dnsx is a fast and multi-purpose DNS toolkit allow to run multiple DNS queries of your choice with a list of user-supplied resolvers.
https://docs.projectdiscovery.io/tools/dnsx
MIT License
2.19k stars 245 forks source link

Include Specific Responses in Output #13

Closed m0chan closed 3 years ago

m0chan commented 3 years ago

Is your feature request related to a problem? Please describe.

Hey Team! - It would be cool if we could choose to include specific responses in our output besides NOERROR and valid domains such as NXDOMAIN, SERVFAIL, REFUSED etc.

This may be a weird suggestion as dnsx's main purpose is to find valid live resolving domains but sometimes there is a need to find which domains are in the above states, mainly SERVFAIL.

~ @m0chan

ehsandeep commented 3 years ago

Hi @m0chan,

You already have everything is the JSON response, you just need to extract what you looking for based on your use case, for example, as per your question, here is how you can get the expected data.

JSON response includes everything, valid/invalid DNS response that includes SERVFAIL, REFUSED as well.

chaos -silent -d hackerone.com | dnsx -json | jq -j '.host, ":", .status_code, "\n"'

      _             __  __
   __| | _ __   ___ \ \/ /
  / _' || '_ \ / __| \  / 
 | (_| || | | |\__ \ /  \ 
  \__,_||_| |_||___//_/\_\ v1.0.1

        projectdiscovery.io

[WRN] Use with caution. You are responsible for your actions
[WRN] Developers assume no liability and are not responsible for any misuse or damage.

events.hackerone.com:NXDOMAIN
api.hackerone.com:NOERROR
mta-sts.hackerone.com:NOERROR
mta-sts.forwarding.hackerone.com:NOERROR
links.hackerone.com:NXDOMAIN
o1.email.hackerone.com:NXDOMAIN
support.hackerone.com:NOERROR
resources.hackerone.com:NOERROR
b.ns.hackerone.com:NOERROR
go.hackerone.com:NXDOMAIN
a.ns.hackerone.com:NOERROR
email.hackerone.com:NXDOMAIN
o2.email.hackerone.com:NXDOMAIN
info.hackerone.com:NXDOMAIN
ns.hackerone.com:NOERROR
mta-sts.managed.hackerone.com:NOERROR
o3.email.hackerone.com:NXDOMAIN
www.hackerone.com:NOERROR
docs.hackerone.com:NOERROR

Let me know if you have additional questions.

m0chan commented 3 years ago

Nice! I didn't realize this thanks :)

~ @m0chan

testt2 commented 3 years ago

Hi, seems like the current version only includes NOERROR with -json ... It was a nice feature to include everything. Bug?

chaos -silent -d hackerone.com | dnsx -json | jq -j '.host, ":", .status_code, "\n"'

      _             __  __
   __| | _ __   ___ \ \/ /
  / _' || '_ \ / __| \  / 
 | (_| || | | |\__ \ /  \ 
  \__,_||_| |_||___//_/\_\ v1.0.3

                projectdiscovery.io

Use with caution. You are responsible for your actions
Developers assume no liability and are not responsible for any misuse or damage.
api.hackerone.com:NOERROR
b.ns.hackerone.com:NOERROR
www.hackerone.com:NOERROR
a.ns.hackerone.com:NOERROR
resources.hackerone.com:NOERROR
docs.hackerone.com:NOERROR
mta-sts.hackerone.com:NOERROR
mta-sts.managed.hackerone.com:NOERROR
support.hackerone.com:NOERROR
mta-sts.forwarding.hackerone.com:NOERROR
ehsandeep commented 3 years ago

@testt2 looks like a bug, I can confirm this behavior is changed with the release of v1.0.2, we will review and update this.