基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/CyberStrikeus/CyberStrike --skill wstg-conf-07命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
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
| name | wstg-conf-07 |
| description | Test HTTP Strict Transport Security |
| category | configuration |
| owasp_id | WSTG-CONF-07 |
| version | 1.0.0 |
| author | cyberstrike-official |
| tags | ["misconfiguration","hardening","server","wstg","conf"] |
| tech_stack | [] |
| cwe_ids | ["CWE-200"] |
| chains_with | [] |
| prerequisites | [] |
| severity_boost | {} |
WSTG-CONF-07
Test HTTP Strict Transport Security (HSTS)
HTTP Strict Transport Security (HSTS) is a security mechanism that forces browsers to communicate with websites only over HTTPS. When properly implemented, HSTS protects against protocol downgrade attacks, SSL stripping, and cookie hijacking. This test verifies that the HSTS header is present, properly configured, and includes appropriate directives.
| Directive | Description | Recommended |
|---|---|---|
max-age | Time in seconds to enforce HTTPS | >= 31536000 (1 year) |
includeSubDomains | Apply HSTS to all subdomains | Yes |
preload | Include in browser preload lists | Recommended |
# Check for HSTS header
curl -sI https://target.com | grep -i strict-transport-security
# Full header analysis
curl -sI https://target.com | grep -iE 'strict-transport|content-security|x-frame|x-content'
# Check specific values
curl -sI https://target.com | grep -i strict-transport-security | \
grep -oP 'max-age=\d+'
#!/bin/bash
TARGET=$1
echo
hsts=$(curl -sI | grep -i | -d )
[ -z ];
1
max_age=$( | grep -oP )
[ -z ];
[ -lt 31536000 ];
| grep -qi ;
| grep -qi ;
# Check that HTTP redirects to HTTPS
curl -sI http://target.com | head -10
# Should return 301/302 redirect to HTTPS
# HSTS header should NOT be sent over HTTP
curl -sI http://target.com | grep -i strict-transport
# If includeSubDomains is set, verify all subdomains support HTTPS
subdomains=("www" "api" "mail" "app" "admin")
for sub in "${subdomains[@]}"; do
host="${sub}.target.com"
echo "=== $host ==="
# Check HTTPS works
https_status=$(curl -s -o /dev/null -w "%{http_code}" "https://$host" 2>/dev/null)
echo "HTTPS Status: $https_status"
# Check HSTS on subdomain
curl -sI "https://$host" 2>/dev/null | grep -i strict-transport
done
# Check if domain is in HSTS preload list
# Visit: https://hstspreload.org/?domain=target.com
# Or use API
curl -s "https://hstspreload.org/api/v2/status?domain=target.com" | jq
Strict-Transport-Security| Tool | Description | Usage |
|---|---|---|
| curl | HTTP client | curl -sI https://target.com |
| testssl.sh | SSL/TLS tester | testssl.sh --hsts target.com |
| sslyze | SSL analyzer | sslyze --hsts target.com |
| Tool | URL | Purpose |
|---|---|---|
| SSL Labs | ssllabs.com/ssltest | Comprehensive SSL test |
| HSTS Preload | hstspreload.org | Preload list check |
| Security Headers | securityheaders.com | Header analysis |
# Install testssl.sh
git clone https://github.com/drwetter/testssl.sh.git
# Run HSTS check
./testssl.sh --hsts target.com
# Full test
./testssl.sh target.com
# Install
pip install sslyze
# Run scan
sslyze --hsts target.com
# Check for missing HSTS
nuclei -u https://target.com -t http/misconfiguration/http-missing-security-headers.yaml
# In httpd.conf or .htaccess
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
</IfModule>
# In server block
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
<system.webServer>
<httpProtocol>
<customHeaders>
<add name="Strict-Transport-Security" value="max-age=31536000; includeSubDomains; preload" />
</customHeaders>
</httpProtocol>
</system.webServer>
preload directiveincludeSubDomains is presentmax-age is at least 31536000 (1 year)Missing HSTS
| Metric | Value | Description |
|---|---|---|
| Attack Vector | Network | Remote attack |
| Attack Complexity | High | Requires MITM position |
| Privileges Required | None | No auth needed |
| User Interaction | Required | User visits site |
| Confidentiality | High | Session hijacking possible |
| Finding | Severity | Description |
|---|---|---|
| HSTS not implemented | Medium | SSL stripping possible |
| Low max-age value | Low | Reduced protection window |
| Missing includeSubDomains | Low | Subdomain attacks possible |
| Not in preload list | Info | First visit vulnerable |
| CWE ID | Title | Description |
|---|---|---|
| CWE-319 | Cleartext Transmission of Sensitive Information | Missing encryption enforcement |
| CWE-523 | Unprotected Transport of Credentials | Credential exposure risk |
| CWE-16 | Configuration | Security misconfiguration |
[ ] HSTS header checked on HTTPS response
[ ] max-age value verified (>= 31536000)
[ ] includeSubDomains directive checked
[ ] preload directive checked
[ ] HTTP to HTTPS redirect verified
[ ] HSTS not sent over HTTP
[ ] Subdomain HTTPS support verified
[ ] Preload list status checked
[ ] Mixed content issues checked
[ ] Browser testing completed
[ ] Findings documented