19.09.2017 Views

the-web-application-hackers-handbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 21 n A Web Application Hacker’s Methodology 839<br />

8.3 Test for SOAP Injection<br />

8.3.1 Target each parameter in turn that you suspect is being processed via<br />

a SOAP message. Submit a rogue XML closing tag, such as . If<br />

no error occurs, your input is probably not being inserted into a SOAP<br />

message or is being sanitized in some way.<br />

8.3.2 If an error was received, submit instead a valid opening and closing<br />

tag pair, such as . If this causes <strong>the</strong> error to disappear, <strong>the</strong><br />

<strong>application</strong> may be vulnerable.<br />

8.3.3 If <strong>the</strong> item you submit is copied back into <strong>the</strong> <strong>application</strong>’s responses,<br />

submit <strong>the</strong> following two values in turn. If you find that ei<strong>the</strong>r item is<br />

returned as <strong>the</strong> o<strong>the</strong>r, or as simply test, you can be confident that your<br />

input is being inserted into an XML-based message.<br />

test<br />

test<br />

8.3.4 If <strong>the</strong> HTTP request contains several parameters that may be being<br />

placed into a SOAP message, try inserting <strong>the</strong> opening comment character<br />

<br />

into ano<strong>the</strong>r parameter. Then switch <strong>the</strong>se (because you have no way<br />

of knowing in which order <strong>the</strong> parameters appear). This can have <strong>the</strong><br />

effect of commenting out a portion of <strong>the</strong> server’s SOAP message, which<br />

may change <strong>the</strong> <strong>application</strong>’s logic or result in a different error condition<br />

that may divulge information.<br />

8.4 Test for LDAP Injection<br />

8.4.1 In any functionality where user-supplied data is used to retrieve information<br />

from a directory service, target each parameter in turn to test<br />

for potential injection into an LDAP query.<br />

8.4.2 Submit <strong>the</strong> * character. If a large number of results are returned, this is<br />

a good indicator that you are dealing with an LDAP query.<br />

8.4.3 Try entering a number of closing paren<strong>the</strong>ses:<br />

))))))))))<br />

This input invalidates <strong>the</strong> query syntax, so if an error or o<strong>the</strong>r anomalous<br />

behavior results, <strong>the</strong> <strong>application</strong> may be vulnerable (although many<br />

o<strong>the</strong>r <strong>application</strong> functions and injection situations may behave in <strong>the</strong><br />

same way).<br />

8.4.4 Try entering various expressions designed to interfere with different<br />

types of queries, and see if <strong>the</strong>se allow you to influence <strong>the</strong> results being

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!