Home page logo
/

pen-test logo Penetration Testing mailing list archives

Re: Let's exploit this
From: James Harless <jharless () kidwellcompanies com>
Date: Wed, 02 Aug 2006 14:59:52 -0500

Hmm...

Knowing that all apostrophes are escaped with backlsashes...and that is the
only character checked for...my first instinct is to put a backslash before
the apostrophe.ie 'Nancy\'s' as the input.

So, then the function would add another escape character, correct?  Then you
would essentially escape the backslash and leave the apostrophe intact,
right?  Or..am I off base here?

I'm picturing the final function looking like:

MyFunc('Nancy\\'s','hamster');

It seems like that could be put to evil use.

James

On 8/2/06 7:57 AM, "Tim" <tim-pentest () sentinelchicken org> wrote:

Hello list,

After a discussion with our moderator about list content, I decided I'll
try to encourage some more in-depth technical discussion about the
exploitation certain quirky bugs.  So, here's one that I came across a
while back.  

It is an exploitable XSS bug, but it isn't immediately obvious (at least
it wasn't to me) how it can be exploited.  Suppose we have a dynamically
generated web page which contains the following line of JavaScript:

  myFunc('FOO', 'BAR');

In this page, the user can control both the values of FOO and BAR.  In
other words, this JavaScript is dynamically generated.  Here's the
catch:  The values FOO and BAR are both checked for apostrophe (single
quote) characters.  Any instances of these are escaped with backslashes.
For instance, if a user supplied values "Nancy's" and "hamster" for FOO
and BAR, respectively, then the following line would be generated:

  myFunc('Nancy\'s', 'hamster');

Apostrophe is the only character checked for, in all it's variants
(unicode?).  Let us suppose an attacker can inject arbitrary binary data
in those strings.

Now, like I said, I know of one way to exploit this behavior to inject
almost arbitrary JavaScript.  I'm hoping this will prompt an interesting
discussion on the topic of browser behavior and perhaps learn of other
ways it can be exploited.

cheers,
tim

------------------------------------------------------------------------------
This List Sponsored by: Cenzic

Concerned about Web Application Security?
Why not go with the #1 solution - Cenzic, the only one to win the Analyst's
Choice Award from eWeek. As attacks through web applications continue to rise,
you need to proactively protect your applications from hackers. Cenzic has the
most comprehensive solutions to meet your application security penetration
testing and vulnerability management needs. You have an option to go with a
managed service (Cenzic ClickToSecure) or an enterprise software
(Cenzic Hailstorm). Download FREE whitepaper on how a managed service can
help you: http://www.cenzic.com/news_events/wpappsec.php
And, now for a limited time we can do a FREE audit for you to confirm your
results from other product. Contact us at request () cenzic com for details.
------------------------------------------------------------------------------



------------------------------------------------------------------------------
This List Sponsored by: Cenzic

Concerned about Web Application Security? 
Why not go with the #1 solution - Cenzic, the only one to win the Analyst's 
Choice Award from eWeek. As attacks through web applications continue to rise, 
you need to proactively protect your applications from hackers. Cenzic has the 
most comprehensive solutions to meet your application security penetration 
testing and vulnerability management needs. You have an option to go with a 
managed service (Cenzic ClickToSecure) or an enterprise software 
(Cenzic Hailstorm). Download FREE whitepaper on how a managed service can 
help you: http://www.cenzic.com/news_events/wpappsec.php 
And, now for a limited time we can do a FREE audit for you to confirm your 
results from other product. Contact us at request () cenzic com for details.
------------------------------------------------------------------------------


  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]