LinuxQuestions.org
Review your favorite Linux distribution.
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 12-24-2002, 09:34 AM   #1
cottonmouth
Member
 
Registered: May 2002
Location: under the fig tree
Distribution: Redhat 8.0, Mandrake 9.0
Posts: 87

Rep: Reputation: 15
Attack Paths


I was reading a book on linux security and "attack paths" were mentioned. One of the paths is a Anon FTP that " is not chroot'ed and can read /ect/passwd"
"FTP not chroot'ed and allowed to write to /tmp"

Another where an ordinary user can write to /tmp and root $PATH has "." before /bin"

Me being new to this I am not sure what all this means, can someone explain this in layman's terms and maybe provide an example of how to check to see if my distro has this problem and how do I fix it.
 
Old 12-24-2002, 02:04 PM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
look in the root folder for your ftp server

there is usually a few folders in there

ftp]# ls
bin etc lib pub


this is what you would see if you ftped into the system
this is not in the / filesystem but contained in /var/www/ftp
or wherever your ftp root is
 
Old 12-27-2002, 09:26 AM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
root $PATH has "." before /bin" means execution in "." or "current directory" will be favoured over the other locations in the $PATH. Man bash for more, look for something like "hash table".
 
Old 12-27-2002, 03:26 PM   #4
Miky
Member
 
Registered: Dec 2002
Location: London / Paris
Distribution: Debian / OpenBsd
Posts: 74

Rep: Reputation: 15
I'm far from being a guru but i think i have an idea of what you mean.

I think that if your ftp server is badly configured woth bad permissions you'll be able to go to the parent folder until you're in /
Then you can go in /etc and read passwd.
You take the encrypted root password and brute force it.

nb : on my distro (debian) and most of them now, passwords are stored into the /etc/shadow file which is only readable by root so you might not be able to gain root access like that

The other one is when you have to type program instead of ./program to execute your program called program
So i go into tmp, i create a script called ls.
When root comes into /tmp he naturally wants to ls the directory and he might going to execute you program instead of /bin/ls.
Your program that you called ls will be executed with the identity of root, so i assume it will have the root privileges then you can imagine that the system is yours

Ciao
 
Old 12-27-2002, 03:55 PM   #5
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
but ./filename is the same as filename just that if /bin/filename exists in the $PATH first it will be executed

so if $PATH is /bin:/usr/bin

if a file testfile is in /bin and in /usr/bin the one in bin would run. If a usr is in /usr/bin and types ./filename the one in /usr/bin will be executed if they just type filename the one in /bin will be executed

if you are in the ftp root then ls and ls ../ are also the same
 
Old 12-27-2002, 04:07 PM   #6
Miky
Member
 
Registered: Dec 2002
Location: London / Paris
Distribution: Debian / OpenBsd
Posts: 74

Rep: Reputation: 15
I don't understand what you meant...

I'm just saying (and i didn't tested it) that if root ls in /tmp or the ftp directory

the ls (in current directory) will be executed instead of /usr/bin/ls

I'll try to do it later on and give you confirmation or infirmation

Ciao
 
Old 12-27-2002, 05:19 PM   #7
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
this is true because there is no /usr/bin in the ftp root
and it's my opinion that breaking out of the ftp root is not possible

you can test this by renaming ls in your ftp/bin folder
 
  


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
What attack could this be??? darrel Linux - Security 10 02-26-2005 10:10 PM
different paths iomari Linux - General 1 11-10-2004 06:57 AM
Where are my paths? colly Linux - General 1 06-17-2004 07:15 AM
Automatically resolving WINDOWS paths to pre-configured Linux paths gazzy Linux - General 1 09-05-2003 10:15 PM
Help I am UNDER ATTACK... needamiracle Linux - Security 28 04-22-2003 12:06 PM

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

All times are GMT -5. The time now is 10: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