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

Feature/8561 cdn detection #18368

Merged
merged 8 commits into from
Feb 17, 2020
Merged

Feature/8561 cdn detection #18368

merged 8 commits into from
Feb 17, 2020

Conversation

Q-back
Copy link
Collaborator

@Q-back Q-back commented Feb 3, 2020

Added CDN detection plugin, closes #8561

Copy link
Owner

@andresriancho andresriancho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for taking a lot of time to review this PR!

w3af/plugins/grep/cdn_providers.py Show resolved Hide resolved
w3af/plugins/grep/cdn_providers.py Outdated Show resolved Hide resolved
[".v3cdn.net", "Edgecast"],
[".v4cdn.net", "Edgecast"],
[".v5cdn.net", "Edgecast"],
["hwcdn.net", "Highwinds"],
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing leading dot here? Or all the others don't need the leading dot?

Copy link
Collaborator Author

@Q-back Q-back Feb 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess Highwinds is discovered only when we can't see any subdomain in url, while for example Netlify's url may look like cdn.netlify.com, so we have here .netlify.com to make sure that subdomain is used.

w3af/plugins/grep/cdn_providers.py Outdated Show resolved Hide resolved
if cdn_header[1] == headers[cdn_header_name]:
self._detect_cdn(response, cdn_header[2])

url = request.get_url()
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to run URL detection even after the CDN was identified using the headers? This might yield duplicates in some cases?

Also, for a very very small % of requests, the ones that match to a CDN by domain; the grep method will be faster if you do the URL match first.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, I thought about case when plugin detects another CDN provider with header and another with URL. But in fact if someone adds wrong CDN info to header.. It just shouldn't happen. I changed it to return after detecting provider via header. URL is here as backup option if we can't detect CDN with header.

w3af/plugins/grep/cdn_providers.py Outdated Show resolved Hide resolved
w3af/plugins/grep/cdn_providers.py Outdated Show resolved Hide resolved
w3af/plugins/tests/grep/test_cdn_providers.py Show resolved Hide resolved
w3af/plugins/tests/grep/test_cdn_providers.py Show resolved Hide resolved
@andresriancho andresriancho merged commit 658bdfb into andresriancho:develop Feb 17, 2020
@andresriancho
Copy link
Owner

giphy (1)

@Q-back Q-back deleted the feature/8561-CDN-detection branch February 17, 2020 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants