performing-security-headers-audit
Skill này làm gì
Công cụ này kiểm tra xem website có dùng các biện pháp bảo vệ ở cấp trình duyệt quan trọng hay không. Nó phân tích các “header” phản hồi của website để đảm bảo thông tin nhạy cảm không bị lộ và trang được bảo vệ trước các cuộc tấn công phổ biến.
Khi nào nên dùng
- ✓Khi kiểm tra bảo mật một website mà bạn có quyền đánh giá.
- ✓Khi bạn muốn đảm bảo trình duyệt của người dùng được bảo vệ trước việc đánh cắp dữ liệu hoặc tấn công.
- ✓Khi cần xác nhận một website có đáp ứng các yêu cầu bảo mật cụ thể không.
Liên kết skill
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-security-headers-audit/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Kiểm tra các security header của example.com”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Công cụ lấy phản hồi từ website và xem các security header mà nó gửi lại. Nó kiểm tra xem các thiết lập như “Content Security Policy” và “HTTP Strict Transport Security” đã được bật và cấu hình đúng để bảo vệ người dùng hay chưa.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Performing Security Headers Audit
When to Use
- During authorized web application security assessments as a standard configuration review
- When evaluating browser-level protections against XSS, clickjacking, and data leakage
- For compliance assessments requiring security header implementation (PCI DSS, SOC 2)
- When performing initial reconnaissance to identify easy-win security improvements
- During CI/CD pipeline security gate checks for new deployments
Prerequisites
- Authorization: Written scope for the target application (header review is low-risk)
- curl: For fetching response headers from target endpoints
- SecurityHeaders.com: Online scanner for quick header assessment
- Mozilla Observatory: Mozilla's web security testing tool
- Burp Suite: For comprehensive header analysis across multiple pages
- Browser DevTools: For examining headers and CSP violations in real-time
Workflow
Step 1: Collect Security Headers from Target
Retrieve and catalog all security-related response headers.
# Fetch all response headers
curl -s -I "https://target.example.com/" | grep -iE \
"(strict-transport|content-security|x-frame|x-content-type|x-xss|referrer-policy|permissions-policy|feature-policy|x-permitted|cross-origin|set-cookie|server|x-powered-by|cache-control)"
# Check headers across multiple pages
PAGES=("/" "/login" "/api/health" "/admin" "/account/settings" "/static/app.js")
for page in "${PAGES[@]}"; do
echo "=== $page ==="
curl -s -I "https://target.example.com$page" 2>/dev/null | grep -iE \
"(strict-transport|content-security|x-frame|x-content-type|x-xss|referrer-policy|permissions-policy|set-cookie|server|x-powered)"
echo
done
# Check both HTTP and HTTPS responses
echo "=== HTTP Response ==="
curl -s -I "http://target.example.com/" | head -20
echo "=== HTTPS Response ==="
curl -s -I "https://target.example.com/" | head -20
Step 2: Assess Transport Security (HSTS)
Evaluate HTTP Strict Transport Security configuration.
# Check HSTS header
curl -s -I "https://target.example.com/" | grep -i "strict-transport-security"
# Expected: Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
# Verify HSTS attributes:
# max-age: Should be >= 31536000 (1 year) for preload eligibility
# includeSubDomains: Protects all subdomains
# preload: Eligible for browser HSTS preload list
# Check if HTTP redirects to HTTPS
curl -s -I "http://target.example.com/" | head -5
# Should be 301/302 redirect to https://
# Check if HSTS is on the preload list
# Visit: https://hstspreload.org/?domain=target.example.com
# Test for HTTPS-only cookies
curl -s -I "https://target.example.com/login" | grep -i "set-cookie"
# All session cookies should have Secure flag
# Check for mixed content
curl -s "https://target.example.com/" | grep -oP "http://[^\"']+" | head -20
# HTTP resources loaded on HTTPS pages create mixed content vulnerabilities
Step 3: Audit Content Security Policy (CSP)
Analyze CSP headers for effectiveness and potential bypasses.
# Extract CSP header
CSP=$(curl -s -I "https://target.example.com/" | grep -i "content-security-policy" | cut -d: -f2-)
echo "$CSP"
# Check for dangerous directives:
# 'unsafe-inline' in script-src: Allows inline scripts (XSS risk)
# 'unsafe-eval' in script-src: Allows eval() (XSS risk)
# * in any directive: Allows loading from any origin
# data: in script-src: Allows data: URI scripts
# Missing default-src: No fallback policy
echo "$CSP" | tr ';' '\n' | while read directive; do
echo " $directive"
if echo "$directive" | grep -q "unsafe-inline"; then
echo " WARNING: unsafe-inline allows inline script execution"
fi
if echo "$directive" | grep -q "unsafe-eval"; then
echo " WARNING: unsafe-eval allows eval() calls"
fi
if echo "$directive" | grep -q " \* "; then
echo " WARNING: wildcard allows loading from any origin"
fi
done
# Check for CSP report-only (not enforcing)
curl -s -I "https://target.example.com/" | grep -i "content-security-policy-report-only"
# Report-only does NOT block violations, only logs them
# Test CSP with Google's evaluator
# https://csp-evaluator.withgoogle.com/
# Paste the CSP header for automated analysis
# Check for CSP bypass via whitelisted domains
# If CDN domains are whitelisted, check for JSONP endpoints or angular libraries
Step 4: Check Frame Protection and Click Defense Headers
…
Câu hỏi thường gặp
Security header là gì?
Đây là các thông tin bổ sung mà website gửi cho trình duyệt, hướng dẫn trình duyệt cách xử lý nội dung một cách an toàn, như ngăn tải script từ nguồn không đáng tin hoặc bảo đảm kết nối luôn dùng HTTPS.
Tôi có cần sự cho phép để dùng công cụ này không?
Có, bạn cần sự cho phép rõ ràng để kiểm tra bảo mật một website. Kiểm thử khi không có sự cho phép có thể vi phạm pháp luật.
Công cụ này có thể tìm những loại vấn đề nào?
Nó có thể xác định các cấu hình sai khiến website dễ bị tấn công như Cross-Site Scripting (XSS), clickjacking, rò rỉ dữ liệu và thiếu mã hóa kết nối phù hợp.
Chi tiết
Mô tả gốc của tác giả
Auditing HTTP security headers including CSP, HSTS, X-Frame-Options, and cookie attributes to identify missing or misconfigured browser-level protections.
Độ phổ biến
- Sao GitHub
- 35k
- Vị trí xếp hạng
- #8302
- Giấy phép
- Apache-2.0
- Cập nhật
- 31/8/2026
Bình luận
- …
Thêm skill từ kho mã này
abusing-dpapi-for-credential-access
35kCung cấp cho agent AI của bạn hướng dẫn có sẵn cho một tác vụ cụ thể, giúp nó làm việc tốt hơn và nhanh hơn.
abusing-shadow-credentials-for-privesc
35kDạy agent AI của bạn viết văn bản rõ ràng và có cấu trúc tốt.
achieving-cmmc-level-2-compliance
35kGiúp agent của bạn chuẩn bị môi trường để tuân thủ CMMC Level 2. Triển khai các yêu cầu bảo mật và quản lý tài liệu cần thiết.
acquiring-disk-image-with-dd-and-dcfldd
35kGiúp agent của bạn tạo bản sao chính xác của ổ đĩa. Cách này đảm bảo không mất hay thay đổi thông tin trong quá trình điều tra.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.