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

Fix rare Telerik bug #1066

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 34 additions & 35 deletions bbot/modules/telerik.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,44 +288,43 @@ async def handle_event(self, event):

spellcheckhandler = "Telerik.Web.UI.SpellCheckHandler.axd"
result, _ = await self.test_detector(event.data, spellcheckhandler)
try:
# The standard behavior for the spellcheck handler without parameters is a 500
if result.status_code == 500:
# Sometimes webapps will just return 500 for everything, so rule out the false positive
validate_result, _ = await self.test_detector(event.data, self.helpers.rand_string())
self.debug(validate_result)
if validate_result.status_code != 500:
self.debug(f"Detected Telerik UI instance (Telerik.Web.UI.SpellCheckHandler.axd)")
description = f"Telerik SpellCheckHandler detected"
await self.emit_event(
{
"host": str(event.host),
"url": f"{event.data}{spellcheckhandler}",
"description": description,
},
"FINDING",
event,
)
except Exception:
pass
status_code = getattr(result, "status_code", 0)
# The standard behavior for the spellcheck handler without parameters is a 500
if status_code == 500:
# Sometimes webapps will just return 500 for everything, so rule out the false positive
validate_result, _ = await self.test_detector(event.data, self.helpers.rand_string())
self.debug(validate_result)
validate_status_code = getattr(validate_result, "status_code", 0)
if validate_status_code not in (0, 500):
self.debug(f"Detected Telerik UI instance (Telerik.Web.UI.SpellCheckHandler.axd)")
description = f"Telerik SpellCheckHandler detected"
await self.emit_event(
{
"host": str(event.host),
"url": f"{event.data}{spellcheckhandler}",
"description": description,
},
"FINDING",
event,
)

chartimagehandler = "ChartImage.axd?ImageName=bqYXJAqm315eEd6b%2bY4%2bGqZpe7a1kY0e89gfXli%2bjFw%3d"
result, _ = await self.test_detector(event.data, chartimagehandler)

if result:
if result.status_code == 200:
chartimagehandler_error = "ChartImage.axd?ImageName="
result_error, _ = await self.test_detector(event.data, chartimagehandler_error)
if result_error.status_code != 200:
await self.emit_event(
{
"host": str(event.host),
"url": f"{event.data}{chartimagehandler}",
"description": "Telerik ChartImage AXD Handler Detected",
},
"FINDING",
event,
)
status_code = getattr(result, "status_code", 0)
if status_code == 200:
chartimagehandler_error = "ChartImage.axd?ImageName="
result_error, _ = await self.test_detector(event.data, chartimagehandler_error)
error_status_code = getattr(result_error, "status_code", 0)
if error_status_code not in (0, 200):
await self.emit_event(
{
"host": str(event.host),
"url": f"{event.data}{chartimagehandler}",
"description": "Telerik ChartImage AXD Handler Detected",
},
"FINDING",
event,
)

elif event.type == "HTTP_RESPONSE":
resp_body = event.data.get("body", None)
Expand Down
Loading