Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/CyberStrikeus/CyberStrike --skill wstg-errh-02명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SOC 직업 분류 기준
SKILL.md 표시 중
| name | wstg-errh-02 |
| description | Testing for Stack Traces |
| category | error-handling |
| owasp_id | WSTG-ERRH-02 |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["error-handling","information-leak","stack-trace","wstg","errh"] |
| tech_stack | [] |
| cwe_ids | ["CWE-209"] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
WSTG-ERRH-02
Testing for Stack Traces
Stack traces provide detailed information about application internals including function call sequences, file paths, line numbers, and sometimes variable values. When exposed to users, stack traces can reveal sensitive implementation details that help attackers understand the application architecture and identify potential vulnerabilities.
#!/bin/bash
TARGET="https://target.com"
# Force exceptions with various inputs
payloads=(
# Division/null errors
"0"
"null"
"undefined"
"NaN"
# Type errors
"[]"
"{}"
"true"
# SQL errors
"'"
"1'"
"1 OR 1=1"
# Path errors
"../../etc/passwd"
"/etc/passwd"
# Format string
"%s%s%s%s%s"
"%n%n%n%n%n"
# Buffer overflow attempt
"$(python3 -c 'print(\"A\"*10000)')"
)
for payload in ;
response=$(curl -s )
| grep -qiE ;
| -20
#!/bin/bash
TARGET="https://target.com"
# Look for debug indicators
response=$(curl -s "$TARGET/nonexistent")
# Django debug page
if echo "$response" | grep -q "Using the URLconf defined in"; then
echo "[VULN] Django DEBUG=True detected"
fi
# Flask debug mode
if echo "$response" | grep -q "Werkzeug Debugger"; then
echo "[VULN] Flask debug mode detected"
fi
# ASP.NET detailed errors
if echo "$response" | grep -q "Stack Trace:"; then
echo "[VULN] ASP.NET detailed errors enabled"
fi
# PHP errors
if echo "$response" | grep -qiE "Fatal error:|Parse error:|Warning:.*on line"; then
echo "[VULN] PHP errors displayed"
fi
# Express.js errors
if echo "$response" | grep -q "at Layer.handle"; then
echo "[VULN] Express.js stack trace exposed"
fi
#!/usr/bin/env python3
import requests
import re
class StackTraceTester:
def __init__(self, base_url):
self.base_url = base_url
self.findings = []
STACK_TRACE_PATTERNS = {
'java': r'at\s+[\w.]+\([\w.]+:\d+\)',
'python': r'File\s+"[^"]+",\s+line\s+\d+',
'dotnet': r'at\s+[\w.]+\s+in\s+[^:]+:\d+',
'php': r'in\s+/[\w/]+\.php\s+on\s+line\s+\d+',
'nodejs': r'at\s+[\w.]+\s+\([^)]+:\d+:\d+\)',
'ruby': r'from\s+[\w/]+\.rb:\d+',
}
FRAMEWORK_PATTERNS = {
'django': r'Using the URLconf defined in|Django Version:',
'flask': r'Werkzeug Debugger|werkzeug\.exceptions',
'rails': r'ActionController::RoutingError|Rails\.root:',
'spring': r'org\.springframework\.|Whitelabel Error Page',
'express': r'at Layer\.handle|at Route\.dispatch',
'laravel': r'Illuminate\\|app/Exceptions/Handler',
}
def test_endpoints(self, endpoints):
"""Test multiple endpoints for stack traces"""
print("[*] Testing for stack trace exposure...")
for endpoint in endpoints:
self._test_endpoint(endpoint)
return self.findings
def _test_endpoint(self, endpoint):
"""Test single endpoint"""
# Error-triggering payloads
payloads = ["'", "null", "0", "{{7*7}}", "../"]
for payload in payloads:
try:
url = f"{self.base_url}{endpoint}?id={payload}"
response = requests.get(url, timeout=10)
self._analyze_response(url, response.text)
except requests.exceptions.RequestException:
pass
def _analyze_response(self, url, content):
"""Analyze response for stack traces"""
# Check for stack traces
for lang, pattern in self.STACK_TRACE_PATTERNS.items():
if re.search(pattern, content):
print(f"[VULN] {lang.upper()} stack trace at: {url}")
self.findings.append({
"url": url,
"type": f"{lang}_stack_trace",
"severity": "Medium"
})
# Check for framework debug pages
for framework, pattern in self.FRAMEWORK_PATTERNS.items():
if re.search(pattern, content, re.IGNORECASE):
print(f"[VULN] {framework.upper()} debug mode at: {url}")
self.findings.append({
"url": url,
"type": f"{framework}_debug",
"severity": "High"
})
def generate_report(self):
"""Generate findings report"""
print("\n" + "="*50)
print("STACK TRACE EXPOSURE REPORT")
print("="*50)
if not self.findings:
print("\nNo stack traces found.")
return
print(f"\nFindings: {len(self.findings)}")
for f in self.findings:
print(f"\n [{f['severity']}] {f['type']}")
print(f" URL: {f['url']}")
# Usage
tester = StackTraceTester("https://target.com")
tester.test_endpoints(["/api/user", "/api/search", "/api/product"])
tester.generate_report()
# Flask
app.config['DEBUG'] = False
app.config['PROPAGATE_EXCEPTIONS'] = False
# Django
DEBUG = False
ALLOWED_HOSTS = ['example.com']
// Spring Boot - application.properties
server.error.include-stacktrace=never
server.error.include-message=never
// PHP
display_errors = Off
log_errors = On
error_log = /var/log/php/error.log
| Finding | CVSS | Severity |
|---|---|---|
| Full stack trace in production | 5.3 | Medium |
| Debug mode enabled | 7.5 | High |
| Framework debug page | 7.5 | High |
| CWE ID | Title |
|---|---|
| CWE-209 | Generation of Error Message Containing Sensitive Information |
| CWE-215 | Insertion of Sensitive Information Into Debugging Code |
[ ] Error-triggering inputs tested
[ ] Debug mode indicators checked
[ ] Framework-specific debug pages tested
[ ] Stack trace patterns analyzed
[ ] API error responses checked
[ ] Findings documented