evilsocket / dnssearch

A subdomain enumeration tool.
GNU General Public License v3.0
894 stars 137 forks source link

False positive CNAME Display #15

Closed ehsandeep closed 7 years ago

ehsandeep commented 7 years ago

by design dnssearch display A record for every host, there is -cname option to display CNAME record of the host which is working good, but in case where subdomain don't have any CNAME record, as it have only A record, cname output still shows the cname entry same as A record, which making it unreliable.

eg:

test1.site.com : A [XX.169.9.87] : CNAME peproxyfeeu01.cloudapp.net.
et.site.com : A [XX.176.43.216] : CNAME et.trulia.com.

here et.site.com have only A record but still we can see same record in CNAME as well.

2nd request:

This is not an issue but by default displaying A record is enabled, and there is no option as well, so it will be good if users have option to display A record or not.

ehsandeep commented 7 years ago

and this is something introduced here: https://github.com/evilsocket/dnssearch/pull/7 cc @edyesed

edyesed commented 7 years ago

I see what you mean. here's an example with google.com. I bet this can be fixed pretty easily. i'll try and get it today.

EdA:dnssearch ed$ ./dnssearch  -a -cname -domain google.com -txt
dnssearch v1.0.1

DONE

Requests : 1
Results  : 1
           www.google.com : A [216.58.216.132 2607:f8b0:400a:800::2004] : TXT [] : CNAME www.google.com.
Time     : 5.047045119 s
Req/s    : 0.198135736143
EdA:dnssearch ed$ host -t CNAME www.google.com
www.google.com has no CNAME record
edyesed commented 7 years ago

well, turns out this is intended behavior from net.LookupCNAME.

I think the only option is to do a string comparison against the result and the hostname, and twiddle the result to be the empty string if they're equal.

edyesed commented 7 years ago

ok. see #16

ehsandeep commented 7 years ago

Hey @edyesed, great work, it's working well now, not sure why net.LookupCNAME. have this as intended behavior!