-
Notifications
You must be signed in to change notification settings - Fork 549
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
Scan more ports when CDN is Cloudflare #270
Comments
func (r *Runner) canIScanIfCDN(host string, port int) bool {
// if CDN ips are not excluded all scans are allowed
if !r.options.ExcludeCDN {
return true
}
cdnbool, cdnprovider, err := r.scanner.CdnCheck(host)
// if exclusion is enabled, but the ip is not part of the CDN ips range we can scan
if err == nil && !cdnbool {
return true
}
// If ip is from cloudflare we can scan 2052,2053,2082,2083,2086,2087,2095,2096,443,80,8080,8443,8880
if cdnprovider == "cloudflare" {
return port == 2052 || port == 2053 || port == 2082 || port == 2083 || port == 2086 || port == 2087 || port == 2095 || port == 2096 || port == 443 || port == 80 || port == 8080 || port == 8443 || port == 8880
}
// If the cdn is part of the CDN ips range - only ports 80 and 443 are allowed
return port == 80 || port == 443
} |
As the behavior -exclude-cdn already exists and it by default and definition only scans 80 and 443, we can define a flag -exclude-cdn-extended that looks for more port for that cdn, as the cloudflare example |
Hi @brenocss , from above info, the solution you suggested is to add the new flag -exclude-cdn-extended (-ece) and also check if provider is cloudfare, we can check from the list of cloudfare ports and return true for the matching port(exactly as in the above code given by you) Question - can i write code for -
Thanks, |
Keep 80,443 for others cdn Cloudflare 80,443 + extended port list |
Hi @brenocss, hence any ip out of this range will give empty o/p from the func and it would not reach our code for cloudflare, Thanks, |
Please describe your feature request:
Since now we can differentiate CDN providers by name projectdiscovery/cdncheck#16 it would be interesting for Cloudflare to scan other ports besides 443 and 80
naabu/v2/pkg/runner/runner.go
Lines 257 to 270 in b6bca90
Describe the use case of this feature:
Always use the
-exclude-cdn
flag and get more valid resultsThe text was updated successfully, but these errors were encountered: