cdncheck icon indicating copy to clipboard operation
cdncheck copied to clipboard

Add support for ipv6 ranges

Open Mzack9999 opened this issue 2 years ago • 2 comments

Description

Only ipv4 cidrs are supported via regex extraction

Mzack9999 avatar Jan 23 '23 11:01 Mzack9999

@Mzack9999, Could you provide some examples of ipv6 addresses that I can put into test cases. I have a draft PR to which I'd like to add the test cases : Draft PR

iamargus95 avatar Apr 10 '23 04:04 iamargus95

After Check() accepts IPv6, we could add something like this here. @tarunKoyalwar

https://github.com/projectdiscovery/cdncheck/blob/main/cdncheck.go#L119

	if dnsResponse.AAAA != nil {
		for _, ip := range dnsResponse.AAAA {
			ipAddr := net.ParseIP(ip)
			if ipAddr == nil {
				continue
			}
			matched, value, itemType, err := c.Check(ipAddr)
			if err != nil {
				return false, "", "", err
			}
			if matched {
				return matched, value, itemType, nil
			}
		}
	}

brenocss avatar May 05 '23 22:05 brenocss