mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Added two payload examples for XPath expression examples.
This commit is contained in:
parent
efe52d4e77
commit
1c639cf7dd
@ -3,7 +3,7 @@
|
||||
<title>ModSecurity Reference Manual</title>
|
||||
|
||||
<articleinfo>
|
||||
<releaseinfo>Version 2.2.0-trunk / (June 14, 2007)</releaseinfo>
|
||||
<releaseinfo>Version 2.5.0-trunk / (June 20, 2007)</releaseinfo>
|
||||
|
||||
<copyright>
|
||||
<year>2004-2007</year>
|
||||
@ -2833,6 +2833,56 @@ SecRule <emphasis role="bold">XML:/employees/employee/name/text()</emphasis> Fre
|
||||
SecRule <emphasis role="bold">XML:/xq:employees/employee/name/text()</emphasis> Fred \
|
||||
xmlns:xq=http://www.example.com/employees</programlisting>
|
||||
|
||||
<para>The first XPath expression does not use namespaces. It would match
|
||||
against payload such as this one:</para>
|
||||
|
||||
<programlisting><employees>
|
||||
<employee>
|
||||
<name>Fred Jones</name>
|
||||
<address location="home">
|
||||
<street>900 Aurora Ave.</street>
|
||||
<city>Seattle</city>
|
||||
<state>WA</state>
|
||||
<zip>98115</zip>
|
||||
</address>
|
||||
<address location="work">
|
||||
<street>2011 152nd Avenue NE</street>
|
||||
<city>Redmond</city>
|
||||
<state>WA</state>
|
||||
<zip>98052</zip>
|
||||
</address>
|
||||
<phone location="work">(425)555-5665</phone>
|
||||
<phone location="home">(206)555-5555</phone>
|
||||
<phone location="mobile">(206)555-4321</phone>
|
||||
</employee>
|
||||
</employees></programlisting>
|
||||
|
||||
<para>The second XPath expression does use namespaces. It would match
|
||||
the following payload:</para>
|
||||
|
||||
<programlisting><xq:employees xmlns:xq="http://www.example.com/employees">
|
||||
<employee>
|
||||
<name>Fred Jones</name>
|
||||
<address location="home">
|
||||
<street>900 Aurora Ave.</street>
|
||||
<city>Seattle</city>
|
||||
<state>WA</state>
|
||||
<zip>98115</zip>
|
||||
</address>
|
||||
<address location="work">
|
||||
<street>2011 152nd Avenue NE</street>
|
||||
<city>Redmond</city>
|
||||
<state>WA</state>
|
||||
<zip>98052</zip>
|
||||
</address>
|
||||
<phone location="work">(425)555-5665</phone>
|
||||
<phone location="home">(206)555-5555</phone>
|
||||
<phone location="mobile">(206)555-4321</phone>
|
||||
</employee>
|
||||
</xq:employees></programlisting>
|
||||
|
||||
<para>Note the different namespace used in the second example.</para>
|
||||
|
||||
<para>To learn more about XPath we suggest the following
|
||||
resources:</para>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user