Skip to content
KitploitKITPLOIT
أدواتعمليات الاستغلالالمدونة
Log in
إرسال
أدواتعمليات الاستغلالالمدونة
إرسال

أدوات الاختراق واختبار الاختراق والأمن السيبراني لترسانتك الأمنية!

Kitploit هو دليل لأدوات الاختراق والأمن السيبراني واختبار الاختراق. اكتشف آخر تحديثات المشاريع للعثور على الثغرات وتحليل الأنظمة وأتمتة الاختبارات وتعزيز أمنك.

الخلاصاتاتصالالخصوصية© 2026 Kitploit

دليل الأدوات

الفئات

عرض جميع الفئات
Loading categories
js-xss — تعقيم HTML غير الموثوق به (لمنع XSS) باستخدام إعدادات محددة عبر قائمة بيضاء | Kitploit
أدوات/GitHubGitHub/leizongmin/js-xss
أدوات دفاعيةاستغلال تطبيقات الويبأمن الويبالأدوات والمكونات
GitHubleizongmin/js-xss

js-xss

تعقيم HTML غير الموثوق به (لمنع XSS) باستخدام إعدادات محددة عبر قائمة بيضاء

عرض المستودع
5.3k63024 أكتوبر 2026تمت المراجعة من قبل Kitploit
مشاركة
الموقع الإلكتروني

NPM version Node.js CI Test coverage David deps node version npm download npm license

تعقيم HTML غير الموثوق (لمنع XSS) باستخدام إعدادات محددة بواسطة قائمة بيضاء.

Greenkeeper badge

xss


xss هي وحدة تُستخدم لتصفية المدخلات من المستخدمين لمنع هجمات XSS. (ما هو هجوم XSS؟)

الصفحة الرئيسية للمشروع: http://jsxss.com

جرّبه عبر الإنترنت: http://jsxss.com/en/try.html

中文版文档


الميزات

  • يحدد وسوم HTML وسماتها المسموح بها عبر قائمة بيضاء
  • يتعامل مع أي وسوم أو سمات باستخدام دالة مخصصة.

مراجع

  • ورقة مرجعية حول التهرب من تصفية XSS
  • مخطط Data URI
  • XSS باستخدام مخطط Data URI

قياس الأداء (للمرجعية فقط)

  • وحدة xss: 22.53 MB/s
  • دالة xss() من الوحدة [email protected]: 6.9 MB/s

للاطلاع على كود الاختبار يُرجى الرجوع إلى الدليل benchmark.

يستخدمون وحدة xss

  • nodeclub - منتدى Node.js يستخدم MongoDB - https://github.com/cnodejs/nodeclub
  • cnpmjs.org - سجل npm خاص وموقع ويب للمؤسسات - https://github.com/cnpm/cnpmjs.org
  • cocalc.com - الحوسبة التعاونية وعلوم البيانات - https://cocalc.com

التثبيت

NPM

npm install xss

Bower

bower install xss

أو

bower install https://github.com/leizongmin/js-xss.git

الاستخدامات

على Node.js

var xss = require("xss");
var html = xss('<script>alert("xss");</script>');
console.log(html);

الحصول على HTML المعقّم والعناصر المحذوفة

يمكنك استخدام filterXSSWithResult للحصول على كل من HTML المعقّم وقائمة بالوسوم/السمات المحذوفة:

var xss = require("xss");
var result = xss.filterXSSWithResult('<script>alert("xss");</script><a href="#" onclick="evil()">click</a>');
console.log(result.html);
// Output: "&lt;script&gt;alert(\"xss\");&lt;/script&gt;<a href=\"#\">click</a>"
console.log(result.removed);
// Output: [
//   { type: "tag", tag: "script", html: "<script>", isClosing: false },
//   { type: "tag", tag: "script", html: "</script>", isClosing: true },
//   { type: "attr", tag: "a", attr: "onclick", value: "evil()" }
// ]

على المتصفح

وضع Shim (الملف المرجعي test/test.html):

<script src="https://rawgit.com/leizongmin/js-xss/master/dist/xss.js"></script>
<script>
  // apply function filterXSS in the same way
  var html = filterXSS('<script>alert("xss");</scr' + "ipt>");
  alert(html);
</script>

وضع AMD - shim:

<script>
  require.config({
    baseUrl: "./",
    paths: {
      xss: "https://rawgit.com/leizongmin/js-xss/master/dist/xss.js",
    },
    shim: {
      xss: { exports: "filterXSS" },
    },
  });
  require(["xss"], function (xss) {
    var html = xss('<script>alert("xss");</scr' + "ipt>");
    alert(html);
  });
</script>

ملاحظات: يُرجى عدم استخدام عنوان URL https://rawgit.com/leizongmin/js-xss/master/dist/xss.js في بيئة الإنتاج.

أداة سطر الأوامر

معالجة ملف

يمكنك استخدام أداة سطر الأوامر xss لمعالجة ملف. طريقة الاستخدام:

xss -i <input_file> -o <output_file>

مثال:

xss -i origin.html -o target.html

اختبار نشط

نفّذ الأمر التالي، ثم يمكنك كتابة كود HTML في سطر الأوامر، وفحص المخرجات المفلترة:

xss -t

لمزيد من التفاصيل، يُرجى تشغيل $ xss -h لرؤيتها.

قواعد التصفية المخصصة

عند استخدام الدالة xss()، يمكن استخدام المعامل الثاني لتحديد قواعد مخصصة:

options = {}; // Custom rules
html = xss('<script>alert("xss");</script>', options);

لتجنب تمرير options في كل مرة، يمكنك أيضًا القيام بذلك بطريقة أسرع عبر إنشاء نسخة FilterXSS:

options = {}; // Custom rules
myxss = new xss.FilterXSS(options);
// then apply myxss.process()
html = myxss.process('<script>alert("xss");</script>');

تُوصف تفاصيل المعاملات في options أدناه.

القائمة البيضاء

من خلال تحديد whiteList، على سبيل المثال { 'tagName': [ 'attr-1', 'attr-2' ] }. سيتم تصفية الوسوم والسمات غير الموجودة في القائمة البيضاء. على سبيل المثال:

// only tag a and its attributes href, title, target are allowed
var options = {
  whiteList: {
    a: ["href", "title", "target"],
  },
};
// With the configuration specified above, the following HTML:
// <a href="#" onclick="hello()"><i>Hello</i></a>
// would become:
// <a href="#">&lt;i&gt;Hello&lt;/i&gt;</a>

بالنسبة للقائمة البيضاء الافتراضية، يُرجى الرجوع إلى xss.whiteList.

يُدعم أيضًا allowList، وله نفس وظيفة whiteList.

تخصيص دالة المعالج للوسوم المطابقة

عن طريق تحديد دالة المعالج باستخدام onTag:

function onTag(tag, html, options) {
  // tag is the name of current tag, e.g. 'a' for tag <a>
  // html is the HTML of this tag, e.g. '<a>' for tag <a>
  // options is some addition informations:
  //   isWhite    boolean, whether the tag is in whitelist
  //   isClosing  boolean, whether the tag is a closing tag, e.g. true for </a>
  //   position        integer, the position of the tag in output result
  //   sourcePosition  integer, the position of the tag in input HTML source
  // If a string is returned, the current tag would be replaced with the string
  // If return nothing, the default measure would be taken:
  //   If in whitelist: filter attributes using onTagAttr, as described below
  //   If not in whitelist: handle by onIgnoreTag, as described below
}

تخصيص دالة المعالج لخصائص الوسوم المطابقة

من خلال تحديد دالة المعالج باستخدام onTagAttr:

function onTagAttr(tag, name, value, isWhiteAttr) {
  // tag is the name of current tag, e.g. 'a' for tag <a>
  // name is the name of current attribute, e.g. 'href' for href="#"
  // isWhiteAttr whether the attribute is in whitelist
  // If a string is returned, the attribute would be replaced with the string
  // If return nothing, the default measure would be taken:
  //   If in whitelist: filter the value using safeAttrValue as described below
  //   If not in whitelist: handle by onIgnoreTagAttr, as described below
}

تخصيص دالة المعالج للوسوم غير المدرجة في القائمة البيضاء

عن طريق تحديد دالة المعالج باستخدام onIgnoreTag:

function onIgnoreTag(tag, html, options) {
  // Parameters are the same with onTag
  // If a string is returned, the tag would be replaced with the string
  // If return nothing, the default measure would be taken (specifies using
  // escape, as described below)
}

تخصيص دالة المعالج للسمات غير الموجودة في القائمة البيضاء

من خلال تحديد دالة المعالج باستخدام onIgnoreTagAttr:

تنزيل الأداة

أدوات ذات صلة

  • wazuh

    منصة XDR و SIEM مفتوحة المصدر لكشف التهديدات وتحليل السجلات ومراقبة سلامة الملفات وتقييم الثغرات وإدارة الامتثال عبر نقاط النهاية وأعباء العمل السحابية.

  • suricata

    محرك شبكة مفتوح المصدر لأنظمة IDS/IPS/NSM لفحص حركة المرور في الوقت الفعلي، واكتشاف ومنع التسلل، وتحليل البروتوكولات، ومطاردة التهديدات المبنية على القواعد.

  • zeek

    Zeek هو إطار تحليل شبكات قوي يختلف كثيرًا عن نظام IDS التقليدي الذي قد تعرفه.

الأكثر شعبية

عرض الكل →

اكتشف الأدوات الأكثر استخدامًا من قبل مجتمعنا.

  • 1

    Callisto

    jetp1ane/callisto

    أداة تحليل ثغرات ثنائية آلية تقوم بفك ترجمة الملفات التنفيذية عبر Ghidra، ومسح كود شبه-C باستخدام Semgrep، والتحقق من النتائج باستخدام GPT-3.5-Turbo لتقليل الإيجابيات الكاذبة.

    2.2k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # تطبيق GhostLock للتنفيذ بنقرة واحدة (CVE-2026-43499)

    841
  • 3

    DFRoot

    a2333c/dfroot

    أداة root لنظام Android لهاتف Samsung Galaxy S25 Ultra (SM-S938B) تقوم بتسلسل DirtyFrag CVE-2026-43284 وCVE-2026-43499 للحصول على صلاحيات root تلقائيًا عند الإقلاع عبر KernelSU.

    449
  • 4

    ARTEX

    baarai/artex

    منصة اختبار اختراق مستقلة متعددة الوكلاء تعتمد على LLM، مع وكلاء تخطيط وتنفيذ، ومخططات للأصول والاستكشاف، وتسجيل حركة مرور MITM، وإعادة اختبار الثغرات.

    387
  • 5

    OsintHunter

    letox4/osinthunter

    🎯 مجموعة أدوات OSINT المثالية: رسم بياني للتحقيق، وتقييم الثقة، وعائلات الأسماء المستعارة، وخريطة، وخط زمني، وتقارير. 49 وحدة، وأكثر من 400 موقع، دون الحاجة إلى مفاتيح API.

    348
  • 6

    faraday

    infobyte/faraday

    أدوات الأمن السيبراني مفتوحة المصدر والمدعومة بالذكاء الاصطناعي للأمن الهجومي، وإدارة الثغرات، والاختبار الاختراقي الذاتي. صُنعت بواسطة قراصنة في أمريكا اللاتينية، وتُستخدم في جميع أنحاء العالم.

    334

استكشف جميع الأدوات

تصفح مجموعتنا من الأدوات

عرض جميع الأدوات →