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 10 n Attacking Back-End Components 401<br />

should also test for each kind of attack, and you should perform each test case<br />

using both Windows- and UNIX-style newline characters.<br />

HACK STEPS<br />

1. You should submit each of <strong>the</strong> following test strings as each parameter in<br />

turn, inserting your own e-mail address at <strong>the</strong> relevant position:<br />

%0aCc:<br />

%0d%0aCc:<br />

%0aBcc:<br />

%0d%0aBcc:<br />

%0aDATA%0afoo%0a%2e%0aMAIL+FROM:+%0aRCPT+TO:+%0aDATA%0aFrom:+%0aTo:+%0aS<br />

ubject:+test%0afoo%0a%2e%0a<br />

%0d%0aDATA%0d%0afoo%0d%0a%2e%0d%0aMAIL+FROM:+%0<br />

d%0aRCPT+TO:+%0d%0aDATA%0d%0aFrom:+%<br />

0d%0aTo:+%0d%0aSubject:+test%0d%0<br />

afoo%0d%0a%2e%0d%0a<br />

2. Note any error messages <strong>the</strong> <strong>application</strong> returns. If <strong>the</strong>se appear to relate<br />

to any problem in <strong>the</strong> e-mail function, investigate whe<strong>the</strong>r you need to<br />

fine-tune your input to exploit a vulnerability.<br />

3. The <strong>application</strong>’s responses may not indicate in any way whe<strong>the</strong>r a vulnerability<br />

exists or was successfully exploited. You should monitor <strong>the</strong><br />

e-mail address you specified to see if any mail is received.<br />

4. Review closely <strong>the</strong> HTML form that generates <strong>the</strong> relevant request. This<br />

may contain clues about <strong>the</strong> server-side software being used. It may also<br />

contain a hidden or disabled field that specifies <strong>the</strong> e-mail’s To address,<br />

which you can modify directly.<br />

TIP Functions to send e-mails to <strong>application</strong> support personnel are frequently<br />

regarded as peripheral and may not be subject to <strong>the</strong> same security<br />

standards or testing as <strong>the</strong> main <strong>application</strong> functionality. Also, because <strong>the</strong>y<br />

involve interfacing to an unusual back-end component, <strong>the</strong>y are often implemented<br />

via a direct call to <strong>the</strong> relevant operating system command. Hence,<br />

in addition to probing for SMTP injection, you should also closely review all<br />

e-mail-related functionality for OS command injection flaws.

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

Saved successfully!

Ooh no, something went wrong!