Get Paid to Participate     Twitter     Facebook     Google+
Hosting Discussion
 

forgot password?


Reply


Old
  Post #1 (permalink)   05-04-2004, 06:51 PM
HD Guru
 
turnkey's Avatar
 
Join Date: Dec 2003
Location: Cary, NC
Posts: 588
Send a message via Yahoo to turnkey

Status: turnkey is offline
Ok, I've been tracking this guy(s) down for a couple of weeks and finally got some control over it.

First, one of my users got compromised so the server is still safe.

This is what to look for:

1. check your /tmp all the time
2. check your /dev/shm all the time

Both of these are temp directories.

The user will try to upload dos attack files here.

The only way to catch them is to install phpsuexec, good thread at the cPanel forums and it is pretty easy now to setup.

Once phpsuexec is done, if you see strange files they will now be owned by a user instead of nobody (easier to track down).

Find the user who is causing the problem and suspend there account. I know they are not at fault but security comes first. They will understand. They may have to re-upload there site or look through all there php/cgi code if any nasty easter eggs have been dropped.

Now, look in your apache usage and find what they were doing. You will get there IP's.

In my example, I had 2 attempts from Canada and EV1. Both of these IP's have been dropped in iptables.

Here is now to block there IP's:

iptables -I INPUT -s 205.207.137.3 -j DROP | echo Dropped 205.207.137.3
iptables -I INPUT -s 64.246.42.44 -j DROP | echo Dropped 64.246.42.44

Remember this is only for when the machine is up. If you reboot you have to do this again. Might be a good idea to put it in a shell command and run it manually after a reboot o place in your /etc/init.d

Hope this helps, and if you are not running phpsuexec on cPanel you should. I have not seen any limitations to PHP at all. You might get a couple of 500 errors but they are easily fixed with the howto on cPanel's forums.

Good luck, hope this helps somebody.
__________________
Turnkey Resellers
www.turnkeyresellers.com
Reseller Hosting and PHP Programming
 
 
 


Old
  Post #2 (permalink)   05-05-2004, 04:13 PM
HD Guru
 
Join Date: Oct 2003
Posts: 579
Send a message via AIM to Francisco Send a message via Yahoo to Francisco

Status: Francisco is offline
Good post on your part Turnkey, it seems a good one to some newbies /self admins to secure their servers.

Cheers.
 
 
 


Old
  Post #3 (permalink)   05-06-2004, 04:58 AM
HD Master
 
Join Date: Feb 2004
Posts: 284

Status: Freckled is offline
Turnkey why wouldn't you just put there IP's in deny.hosts?
Glad you caught them though and hope they don't give you any more problems.
__________________
Stop on by and say hello!
Arizona bound!!
FreckleFaceHosting.com
 
 
 


Old
  Post #4 (permalink)   05-06-2004, 05:21 AM
HD Guru
 
turnkey's Avatar
 
Join Date: Dec 2003
Location: Cary, NC
Posts: 588
Send a message via Yahoo to turnkey

Status: turnkey is offline
Quote:
deny.hosts
I forgot all about that file, thanks for the reminder.
__________________
Turnkey Resellers
www.turnkeyresellers.com
Reseller Hosting and PHP Programming
 
 
 


Old
  Post #5 (permalink)   05-06-2004, 05:52 AM
HD Master
 
Join Date: Feb 2004
Posts: 284

Status: Freckled is offline
Well I actually had it backwards hosts.deny but glad to help.
__________________
Stop on by and say hello!
Arizona bound!!
FreckleFaceHosting.com
 
 
 


Old
  Post #6 (permalink)   05-10-2004, 12:19 AM
HD Newbie
 
Join Date: Feb 2004
Posts: 43

Status: imported_TheLinuxGuy is offline
Alot of times hacks happen from insecure cgi/php scripts if its a cpanel box you can track this down using:

Quote:
for files in /usr/local/apache/domlogs/*; do grep "wget" $files; done;
Alot of people dont do it, but you can noexec, nosuid your /dev/shm in fstab
 
 
 
Reply

Thread Tools

New Post New Post   Old Post Old Post
Posting Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Sponsored By: