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.
|
|
12-10-2004, 03:04 PM
|
#1
|
Member
Registered: Oct 2001
Location: Tokyo, Japan
Distribution: Slackware
Posts: 105
Rep:
|
recent attack via phpBB, log files deleted? accessed file system outside /home/
My server was recently attacked by some hackers that used an exploit in php and phpBB's forum software.
In this attack the attacker manager to delete all the files from /var/log in addition they took down apache.
Now for my questions. If the linux user "user1" has a website in /home/user1/www and apache is being run by the "apache" user what user is actually accessing the files when it is http://www.site.blah/forum/ ?
How could this user then begin running things outside the /home/ directory?
I was running RedHat 9.
Thanks for the info.
|
|
|
12-10-2004, 04:55 PM
|
#2
|
Senior Member
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197
Rep:
|
Apache runs as "apache". Chances are the attecker used the phpBB hole to gain access to the system, then used a local exploit to gain higher access. Generally speaking, people tend to ignore local exploits thinking "My listening daemons are secure, so I don't have to worry about that" ...
This is a good example of why that's not true.
|
|
|
12-13-2004, 01:00 PM
|
#3
|
Member
Registered: Oct 2001
Location: Tokyo, Japan
Distribution: Slackware
Posts: 105
Original Poster
Rep:
|
Quote:
Originally posted by sigsegv
Apache runs as "apache". Chances are the attecker used the phpBB hole to gain access to the system, then used a local exploit to gain higher access. Generally speaking, people tend to ignore local exploits thinking "My listening daemons are secure, so I don't have to worry about that" ...
This is a good example of why that's not true.
|
I agree 100% and this is my question. How do I know the local exploits? Once I acknowledge the local exploits how to I plug them up?
Perhaps I need to read a Linux security book?
|
|
|
12-13-2004, 04:49 PM
|
#4
|
Senior Member
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197
Rep:
|
While that's a good idea too, you should mostly just watch your distro's security mailing list to see when holes are discovered (I have no idea if Slack has such a thing -- Not used it since v3). Another good list to watch is Bugtraq, or PacketStorm.
Last edited by sigsegv; 12-13-2004 at 04:50 PM.
|
|
|
12-17-2004, 01:49 PM
|
#6
|
Member
Registered: Dec 2004
Location: Hawaii
Distribution: Fedora & CentOS
Posts: 72
Rep:
|
What I always recomend is a very tight firewall. What hackers like to do, is try to retrieve a backdoor program they can telnet or ssh into. If you're filtering all ports not in use, then they can't do this.
Also, if you reject certian types of outgoing requests, they can't retrieve a hacker program at all. I have a deny-by-default policy, on both incoming and outgoing, and so far, for outgoing, I only have enabled udp to certian IP addresses on port 53 ( my DNS servers ), and port 25 ( to be able to send mail ).
If they try to retrieve something, they will get:
Code:
[corman@localhost corman]$ wget cormander.com
--10:35:30-- http://cormander.com/
=> `index.html'
Resolving cormander.com... done.
Connecting to cormander.com[68.157.128.141]:80... failed: Connection refused.
[corman@localhost corman]$
Also, it is a good idea to symlink /usr/tmp, /var/tmp, and any other world writable directory to /tmp. This makes a single place to look at for hacker-made files. Have a cronjob running, that checks for executable files in /tmp, and alerts you, because you should never have an executable file in there.
-Corey
|
|
|
12-17-2004, 02:33 PM
|
#7
|
Senior Member
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197
Rep:
|
Quote:
Originally posted by cormander
What I always recomend is a very tight firewall. What hackers like to do, is try to retrieve a backdoor program they can telnet or ssh into. If you're filtering all ports not in use, then they can't do this.
|
This isn't true, but is a good idea anyway
Quote:
Originally posted by cormander
If they try to retrieve something, they will get:
|
Unless they run their rootkit server on tcp 25 of course
Quote:
Originally posted by cormander
... that checks for executable files in /tmp, and alerts you, because you should never have an executable file in there.
|
This isn't true either, though also not a bad idea. What you should do instead is mount /tmp (and pretty much everything besides /usr) noexec. This is also a nice example of why the all to common trend among Linux distros to put entire fs under one big all encompassing '/' is a stupid idea.
|
|
|
12-17-2004, 02:43 PM
|
#8
|
Member
Registered: Dec 2004
Location: Hawaii
Distribution: Fedora & CentOS
Posts: 72
Rep:
|
Security isn't about having "true" fixes to hack methods, it's about taking more steps to prevent them then the hackers are able to try.
Haven't considered the mounted no-exec before, however. How exactly do you do that? Would I have to create a whole new partition and mount it to /tmp ?
-Corey
|
|
|
12-17-2004, 02:51 PM
|
#9
|
Senior Member
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197
Rep:
|
Quote:
Originally posted by cormander
Security isn't about having "true" fixes to hack methods, it's about taking more steps to prevent them then the hackers are able to try.
|
Quote:
Originally posted by cormander
Haven't considered the mounted no-exec before, however. How exactly do you do that? Would I have to create a whole new partition and mount it to /tmp ?
|
man mount
|
|
|
All times are GMT -5. The time now is 09:33 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
|
|