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.
|
 |
01-23-2006, 10:55 PM
|
#1
|
Member
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456
Rep:
|
got hacked, think i know how, help me stop it
lo there,
i am running a simple lamp from home.
i tried out this package from e107 that is a content management system.
i think i had some of the file permissions a little too permissive, and about a day after i installed it, something got in, created a user, and started to wreck havoc right in frot of my eyes. i unplugged from the ethernet, but still , lost a lot of time because i had to restore everything, lost root password, all kinds of stuff. i feel like an idiot about this.. but it brings me to my questions....
what is a good permissions setup for files in a webserver and cgi-bin ?
chmod 655 ? i know that 777 is no good.
another twist, i have a couple of users set up (friends) whose websites i was also hosting. i would let them ssh to upload their files to their home directory (also the web-root of their website). So they need to still be able to do that.
would ftp be safer ?
need some advice because, although i did not loose anything except some face and time, the thing cost a lot in doing a reinstall of archlinux and restoring backups.
any tips are welcome.
thanks gents
|
|
|
01-23-2006, 11:44 PM
|
#2
|
Member
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503
Rep:
|
i dont know about this package, but is its php config file readable on the web server? if so.... is there any way to make it not readable and still work, perhaps by putting it outside the web root?
if it is readable, was the mysql username and password the same as a system account username and password? if so, that would have been a very easy first step in.
|
|
|
01-23-2006, 11:48 PM
|
#3
|
Member
Registered: Jul 2003
Location: Pennsylvainia
Distribution: Slackware / Debian / *Ubuntu / Opensuse / Solaris uname: Brian Cooney
Posts: 503
Rep:
|
http://www.networksecurityarchive.or.../msg00106.html
google around for hacking e107 to find other problems and possibly ways to secure agenst them
|
|
|
01-24-2006, 05:10 AM
|
#4
|
Member
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456
Original Poster
Rep:
|
yeah, the name and password were the same, guess i know better than to do that now.
thanks
|
|
|
01-24-2006, 05:30 AM
|
#5
|
Member
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456
Original Poster
Rep:
|
by the way, thanks for the link.
what permissions should the files in the web_root folders be ?
|
|
|
01-24-2006, 06:40 AM
|
#6
|
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307
Rep:
|
For directories:
755 if you want to allow indexing
711 to disallow it
HTML,IMAGE,..:
644
CGI:
755 or 711
Last edited by nx5000; 01-24-2006 at 06:42 AM.
|
|
|
01-24-2006, 08:12 AM
|
#7
|
Member
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456
Original Poster
Rep:
|
wow, thanks a lot for that.
after googling around, not just at e107 hacking, but php (what i use most) there is some scary stuff out there, kinda surprised that i have not had this happen before, i have been running my server for a year.
thanks for the great info.
|
|
|
01-24-2006, 09:06 AM
|
#8
|
Member
Registered: Feb 2005
Location: Metro Detroit, US
Distribution: Suse/Slackware/Mepis
Posts: 174
Rep:
|
I've been running e107 for several years now on an internet facing box, been lucky I guess... anyway, have you checked out the e107.org site for updates ? they also have a very helpful and active forum that might help you out on permission/security questions.
Dave
|
|
|
01-24-2006, 01:12 PM
|
#9
|
Member
Registered: Oct 2003
Location: King George, VA
Distribution: RHEL/CentOS/Scientific/Fedora, LinuxMint
Posts: 370
Rep:
|
Get mod_security!!! http://www.modsecurity.org/
It rocks!!
|
|
|
01-24-2006, 02:19 PM
|
#10
|
Member
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456
Original Poster
Rep:
|
mod security looks great, even a debian package for it (use debian at work, arch at home) so i will have to get it for arch too.
thanks much. Yeah, having the same user name and password in the scripts as i use on my system was somewhat foolish of me, even more to just blanket everything with chmod 777 . i guess you just don't do that.
thanks everyone.
Last edited by nephish; 01-24-2006 at 02:21 PM.
|
|
|
01-24-2006, 09:51 PM
|
#11
|
Senior Member
Registered: Dec 2004
Location: Lee, NH
Distribution: OpenSUSE, CentOS, RHEL
Posts: 1,794
Rep:
|
Why not disable indexing in your {vhost}.conf file or at minimum in .htaccess?
|
|
|
01-25-2006, 07:30 AM
|
#12
|
Member
Registered: Jun 2005
Distribution: arch, ubuntu
Posts: 456
Original Poster
Rep:
|
ok, if i disable indexing, it means that someone cannot go to www.mysite.com/some_directory/ and see all the files listed there right?
ok, that sounds good.
I have hit a snag here with my permissions. There is part of the website where users can upload images to a certain directory. It doesnt work right now because i dont have permission as a web user to view the contents of said directory.
what permissions do i use in this case, the images need to be able to be uploaded, but also viewed later from the website.
thanks
|
|
|
All times are GMT -5. The time now is 07:22 AM.
|
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
|
|