Django Debug Mode detection
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from kittysploit import *
from lib.protocols.http.http_client import Http_client
def _looks_like_django_debug_page(response) -> bool:
"""Match Django's real debug/technical error pages, not generic 'debug' text."""
if not response:
return False
content = (response.text or "").lower()
status = getattr(response, "status_code", 0)
strong_markers = [
"you're seeing this error because you have <code>debug = true</code>",
"you're seeing this error because you have debug = true",
"using the urlconf defined in",
"django tried these url patterns",
"the current path, <code>",
"page not found <span>(404)</span>",
"exception type:",
"exception value:",
"traceback <span>",
"request method:",
"request url:",
"raised during:",
"django version:",
"python executable:",
"python path:",
"server time:",
"wsgirequest:",
"settings</th>",
]
score = sum(1 for marker in strong_markers if marker in content)
# 404 debug pages and 500 technical tracebacks use different wording.
if status == 404 and score >= 3:
return True
if status >= 500 and score >= 4:
return True
return False
class Module(Scanner, Http_client):
__info__ = {
'name': 'Django Debug Mode detection',
'description': 'Detects if Django debug mode is enabled on the target, which may lead to information disclosure or RCE.',
'author': ['KittySploit Team'],
'severity': 'high',
'modules': ['exploits/http/django_debug_rce'],
'tags': ['web', 'scanner', 'django', 'debug', 'rce'],
'agent': {
'risk': 'active',
'effects': ['network_probe'],
'expected_requests': 2,
'reversible': True,
'approval_required': False,
'produces': ['tech_hints', 'risk_signals', 'endpoints'],
'cost': 1.0,
'noise': 0.5,
'value': 1.0,
'requires': {'min_endpoints': 0,
'min_params': 0,
'tech_hints_any': [],
'tech_hints_all': [],
'specializations_any': [],
'risk_signals_any': [],
'auth_session': False,
'capabilities_any': [],
'capabilities_all': [],
'confidence_min': {},
'confidence_min_any': {},
'endpoint_pattern_any': [],
'param_any': [],
'api_surface_ready': False},
'chain': {'produces_capabilities': [{'capability': 'rce', 'from_detail': ''}],
'consumes_capabilities': [],
'option_bindings': {},
'suggested_followups': []},
},
}
def run(self):
try:
# Trigger an error to check for debug page
response = self.http_request(
method="GET",
path="/nonexistent-page-that-should-404-for-django-debug-check/",
allow_redirects=False
)
if _looks_like_django_debug_page(response):
self.set_info(severity="high", reason="Django debug mode is enabled")
return True
return False
except Exception:
return False
Data
Build on a solid foundation with Vulners data
We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data
Api
Power your application with Vulners API
The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access
App
Assess and manage vulnerabilities with Vulners tools
Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation
05 Aug 2026 13:34Current
5.8Medium risk
Vulners AI Score5.8