LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-01-2014, 01:10 PM   #1
Scalpweb
LQ Newbie
 
Registered: Dec 2014
Posts: 2

Rep: Reputation: Disabled
CentOs server being hacked again and again


Hi everyone,

I have a CentOs server with about 10 virtual hosts configured with Apache.

A few days ago, I realised my server has been compromised and a phishing page has been hidden in some of the website root directories. I deleted them, updated Plesk, changed all my passwords (SSH, FTP, ...). I do not have any wordpress or other script like this: the websites are plain html files or based on my own php framework. But the phising scripts keep coming back, and I have no idea how to understand where they are coming from.

I can't even find my ftp logs files, but when I check my apache logs, they are so many lines, I don't really know what to look for...

Could you give me some guidances on what I should do ? For the moment, I configured a cron task to remove the files every minute, but it's not a long term solution of course. I'd like to understand how those files keep being created. I'm also afraid that those hackers could do way more damage than that eventually.

Thanks in advance
 
Old 12-01-2014, 05:17 PM   #2
ereus
LQ Newbie
 
Registered: Apr 2005
Distribution: debian, redhat
Posts: 10

Rep: Reputation: 0
Hi,
you can take a look to /var/log/secure
there are a lot of information about access to your server in these file.
Virtual hosts? Can anybody access remotely to virtual hosts? Some virtual machines have this option of configuration.
Every virtual hosts must be secure not only the real server (passwords, etc).
what software use? proftp?.
Sorry, but I don't know more options, at this moment with this information.
 
Old 12-01-2014, 06:36 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
also check your apache logs

it is VERY VERY -VERY- easy to configure a VERY INSECURE server

also have a look at the SELinux security logs
/var/log/selinux/????

if SE has been DISABLED -- not good

then
reformat the drives and reinstall with a KNOWN!!!! GOOD CLEAN UNCOMPRESSED back up
-- if you have one --

if not
start from scratch with CentOS 7.0 and the current Apache then keep SE set to ENFORCING

Last edited by John VV; 12-01-2014 at 06:38 PM.
 
Old 12-02-2014, 03:47 AM   #4
Scalpweb
LQ Newbie
 
Registered: Dec 2014
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks for your answers.

Lookng at /var/log/secure and /var/log/messages, I realized they were accessing my server via an old ftp account I've created months ago. I used it with the www.net2ftp.com web-based ftp service. They probably stole the credentials through it.

I disable this account and it seems fine now.

Thank you for your time.
 
Old 12-02-2014, 10:27 AM   #5
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
REINSTALL EVERYTINNG USING A KNOWN GOOD BACKUP FROM BEFORE THEY GOT ACCESS !!!!!


who KNOWS what THEY CHANGED
 
Old 12-02-2014, 10:32 AM   #6
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware64 15; SlackwareARM-current (aarch64); Debian 12
Posts: 8,298
Blog Entries: 61

Rep: Reputation: Disabled
Stop shouting.
 
1 members found this post helpful.
Old 12-03-2014, 01:11 PM   #7
deathsfriend99
Member
 
Registered: Nov 2007
Distribution: CentOS 6
Posts: 200

Rep: Reputation: 22
It might be a good idea to run a rootkit hunter on that thing if you're not going to wipe it.
 
Old 12-03-2014, 04:12 PM   #8
salasi
Senior Member
 
Registered: Jul 2007
Location: Directly above centre of the earth, UK
Distribution: SuSE, plus some hopping
Posts: 4,070

Rep: Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897Reputation: 897
...but without making the --propupd mistake.

Only use that switch if you know that the utils are in a clean condition and the only time that you know that is when the software has just been installed and no one has had chance to introduce 'fixed-up' (hacked) versions (and, many people don't absolutely know that, but in your particular case you have very, very good reasons for doubting it).

Well, unless you re-install, of course. Then you've got a clean situation.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Server Hacked Centos 6.2 kyrunner Linux - Server 7 06-03-2012 07:22 AM
[SOLVED] Centos server being hacked any help? newbie14 Linux - Security 8 04-27-2012 11:04 AM
Weird connection in my centos to outside..got hacked? michaelux Linux - Security 4 05-19-2011 09:34 AM
centos 5 hacked again jasonchongkn@hotmail.com Linux - Server 6 04-09-2011 11:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:10 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration