用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/CyberStrikeus/CyberStrike --skill wstg-errh-02命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
macOS post-exploitation for credential harvesting, DTrace monitoring, TCC bypass, and stealth operations via native tools
Windows userland post-exploitation for credential harvesting, monitoring, AMSI/ETW bypass, and stealth operations
Kubernetes post-exploitation for container escape, secret extraction, RBAC abuse, and cluster persistence
基于 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