Navigation Menu

Skip to content
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

Hostname verification over TLS #29

Closed
faandg opened this issue Aug 25, 2021 · 5 comments
Closed

Hostname verification over TLS #29

faandg opened this issue Aug 25, 2021 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@faandg
Copy link

faandg commented Aug 25, 2021

Hi,

Just came across this doggo after looking for a way to do DoT lookups, looks neat and appreciate the colored formatting, nice work.

I want to do a lookup with a couple of specific nameservers but it requires tls hostname verification.

doggo google.se @tls://193.19.108.3
ERROR[2021-08-25T16:45:40+02:00] error looking up DNS records 
error="x509: cannot validate certificate for 193.19.108.3 because it doesn't contain any IP SANs"

Is there a way we can pass the expected hostname of the dns resolver like adblock.doh.mullvad.net for verification?
If I use doggo google.se @tls://adblock.doh.mullvad.net, the lookup succeeds but then I do not know which of mullvad's servers responded (there are 2 nameservers listed under adblock.doh.mullvad.net) and I want to be able to test them individually.

@mr-karan mr-karan added the enhancement New feature or request label Aug 25, 2021
@mr-karan mr-karan self-assigned this Aug 25, 2021
@cbuijs
Copy link

cbuijs commented Mar 7, 2022

I was wondering if this could be solved like this (based on google dns):

doggo @tls://dns.google:443/dns-query -n 8.8.4.4 .......

Then you have the IP (no DNS leakage due to hostname resolution by doggo) already, and the hostname specified. Seems the libraries/modules used already to hostname-verification if a hostname is used (but I could be wrong).

But it seems as soon as -n is used, doggo reverts back to udp/unencrypted?

BTW: Using the --nameserver version of the option results in an error as unknown option.

@mr-karan
Copy link
Owner

mr-karan commented Mar 7, 2022

But it seems as soon as -n is used, doggo reverts back to udp/unencrypted?

Hm, that seems a bug. I'll investigate.

@cbuijs
Copy link

cbuijs commented Mar 8, 2022

But it seems as soon as -n is used, doggo reverts back to udp/unencrypted?

Hm, that seems a bug. I'll investigate.

It is actually doing both when specified:

doggo @https://dns.google:443/dns-query -n 8.8.4.4 -q google.com ns
NAME       	TYPE	CLASS	TTL   	ADDRESS        	NAMESERVER                       
google.com.	NS  	IN   	15862s	ns4.google.com.	8.8.4.4:53                      	
google.com.	NS  	IN   	15862s	ns1.google.com.	8.8.4.4:53                      	
google.com.	NS  	IN   	15862s	ns2.google.com.	8.8.4.4:53                      	
google.com.	NS  	IN   	15862s	ns3.google.com.	8.8.4.4:53                      	
google.com.	NS  	IN   	21600s	ns1.google.com.	https://dns.google:443/dns-query	
google.com.	NS  	IN   	21600s	ns2.google.com.	https://dns.google:443/dns-query	
google.com.	NS  	IN   	21600s	ns3.google.com.	https://dns.google:443/dns-query	
google.com.	NS  	IN   	21600s	ns4.google.com.	https://dns.google:443/dns-query

I think when something else then udp:// and tcp:// is used, the ip-address with -n should be used for the name-server hostname, instead of resolving it using the system resolver (which would be the default if -n was not specified).

This is also nice to have all dns traffic encrypted, and prevent some unencrypted leakage during bootstrap of the hostname IP.

Great tool BTW, keep up the good work!

@mr-karan
Copy link
Owner

I've decided to add 2 new flags:

➜  doggo git:(main) ✗ ./bin/doggo.bin google.se @tls://193.19.108.3 --tls-hostname=adblock.doh.mullvad.net
NAME      	TYPE	CLASS	TTL 	ADDRESS      	NAMESERVER       
google.se.	A   	IN   	300s	142.250.200.3	193.19.108.3:853	

➜  doggo git:(main) ✗ ./bin/doggo.bin google.se @tls://193.19.108.3 --skip-hostname-verification 
NAME      	TYPE	CLASS	TTL	ADDRESS      	NAMESERVER       
google.se.	A   	IN   	30s	142.250.200.3	193.19.108.3:853	

Will push soon.

mr-karan added a commit that referenced this issue May 18, 2022
@mr-karan
Copy link
Owner

Released https://github.com/mr-karan/doggo/releases/tag/v0.5.2 which has these flags.

Feel free to re-open in case I missed something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants