Major vhost (virtualhost) rewrite#2672
Conversation
| assert canary_subdomain.endswith(".example.com"), ( | ||
| f"Subdomain canary doesn't end with basehost: {canary_subdomain}" | ||
| ) | ||
| assert "-test.example.com" in canary_mutation, ( |
Check failure
Code scanning / CodeQL
Incomplete URL substring sanitization
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 5 months ago
The fix is to replace the substring check " -test.example.com" in canary_mutation with a more precise hostname validation. Since canary_mutation is intended as a hostname or domain, and we want to ensure it correctly ends with -test.example.com rather than appearing at any arbitrary position, we should parse (or treat) it as a domain name and use the .endswith() method. This would check that canary_mutation is a domain with the required suffix, so only validly-structured canary hosts would pass the test.
The change should occur in bbot/test/test_step_2/module_tests/test_module_virtualhost.py, around line 470, inside the check method of TestVirtualhostHTTPSLogic. No additional imports are needed, as string logic is sufficient here.
| @@ -467,8 +467,8 @@ | ||
| assert canary_subdomain.endswith(".example.com"), ( | ||
| f"Subdomain canary doesn't end with basehost: {canary_subdomain}" | ||
| ) | ||
| assert "-test.example.com" in canary_mutation, ( | ||
| f"Mutation canary doesn't contain expected pattern: {canary_mutation}" | ||
| assert canary_mutation.endswith("-test.example.com"), ( | ||
| f"Mutation canary doesn't end with expected pattern: {canary_mutation}" | ||
| ) | ||
| assert canary_random.endswith(".com"), f"Random canary doesn't end with .com: {canary_random}" | ||
|
|
untangle cli arg issues
# Conflicts: # bbot/test/test_step_1/test_presets.py
a65a347 to
344130e
Compare
Resolve conflicts taking asn-as-targets as source of truth. Move bake()+init into Scanner.__init__ (sync bake). Convert generic_ssrf from VULNERABILITY to FINDING event type. Fix virtualhost test to check FINDING instead of VULNERABILITY. Keep generic_ssrf module (deleted on asn-as-targets, restored here).
No description provided.