LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 10-18-2006, 09:43 PM   #1
macushk
LQ Newbie
 
Registered: Oct 2006
Posts: 7

Rep: Reputation: 0
Root delete files problems


My hone server has been hacked by put some php shell files in the /var/www/html .But ,I can't remove those files even if I am the root.
How to remove those files !?
I have tried to use chattr and rm -f .But it still show "Permission denied".
How to fix it !?
 
Old 10-19-2006, 03:22 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hi,

And welcome to LQ!

The question really belongs in our security forum.

As for the deletion: is the partition that /var/www resides on mounted read-only,
or do you not have write permissions on the directory?


Cheers,
Tink
 
Old 10-19-2006, 03:29 AM   #3
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Moved: This thread is more suitable in Linux-Security and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 10-19-2006, 06:05 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Hello and welcome to LQ. Sad to see it had to be on such an occasion.

My home server has been hacked
Then act accordingly. A compromised box needs to be reinitialised. Don't try to "fix" or "restore" unless you have the expertise to determine how serious the breach of security is.
1. Please read the first two docs first:
- Intruder Detection Checklist (CERT): http://www.cert.org/tech_tips/intrud...checklist.html
- Steps for Recovering from a UNIX or NT System Compromise (CERT): http://www.cert.org/tech_tips/root_compromise.html
- LQ FAQ: Security references: http://www.linuxquestions.org/questi...threadid=45261

2a. After that:
- shut down the box and only reboot it (for making backups) using a Live CD
- Backup /etc, /home for reference purposes only (not restore). Do not backup binaries. Backup temp dirs and /var if you want to peruse the logs and auth info.
- Repartition, reformat, re-install from scratch.
- Harden.

2b. If you OTOH want us to help you determine how serious the breach of security is, post the following information. Please answer as fast as possible, do not skip questions, post exact results and *then* shut down the box (only to be booted again using a Live CD):
- purpose of the box?
- date of incident?
- distro+release+kernel?
- do you make regular backups?
- do you run a file integrity checker like Aide, Samhain or tripwire and if so what does a check say? If not, what does your distro's package manager say if you verify packages?
- do you run Chkrootkit or Rootkit Hunter and if so what does a check say?
- do you run an IDS?
- What anomalies can you see in system, daemon and firewall logs?
- What accessable software was installed and was it up to date?
- What services where running at the time of compromise?
- Did you find any setuid root files in temp dirs?
- Can you see any activity from user shell history files?
- What does "lsof -n" say?
- And "ps axfwwwe"

For any logs larger than 10 lines please tarball them up and provide a download location.
 
Old 10-22-2006, 09:44 AM   #5
macushk
LQ Newbie
 
Registered: Oct 2006
Posts: 7

Original Poster
Rep: Reputation: 0
thanks a lot .
I have used the resuce CD to mount the system.
I have used the chattr the modify the flag of the files and deleted them .
However I found a strange process "local -t unix" with the command "ps ax".
What's that process ?? blackdoor process??
I have tried to use chkrootkit and rkhunter to check the system again and all passed.
Moreover,I have checked the listening port of my system and all seems are working normal.
Is this all finished ??
 
Old 10-23-2006, 05:55 AM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
I have used the chattr the modify the flag of the files and deleted them .
Flushing "evidence" down the drain. That is soo cool (not).


However I found a strange process "local -t unix" with the command "ps ax".
What's that process ?? blackdoor process??

I asked you to post certain information and in a certain way. Not posting complete information can lead to speculation and giving partial or generic advice. So, thanks for helping us help you.


Moreover,I have checked the listening port of my system and all seems are working normal.
Is this all finished ??

For you it is, yes. Here's you generic advice: go repartition, reformat, reinstall from scratch, then harden the box properly.
 
  


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
How to delete files that won't delete? di11rod Linux - Security 7 10-19-2005 09:14 PM
can't access/delete/list files even as root... tenshi Linux - General 7 10-13-2004 04:29 AM
Tried to delete file as root but it says I don't have permission to delete it! beejayzed Mandriva 23 03-12-2004 02:46 AM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 04:14 PM
How to delete the destination files while the source files deleted in cp -u ? myunicom Linux - General 4 09-26-2003 01:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 09:49 PM.

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