Clan x86

Technical (Development, Security, etc.) => Unix / Linux Discussion => Topic started by: Joe on April 20, 2006, 08:31:38 PM

Title: FD: LS where not allowed?
Post by: Joe on April 20, 2006, 08:31:38 PM
joe@deadmeat:/var/www $ cd test/
bash: cd: test/: Permission denied
joe@deadmeat:/var/www $ ls test/
ls: test/testfile.dat: Permission denied
ls: test/testfile.dat~: Permission denied


Recreation:
1. gksudo [or sudo] gedit
2. Write testfile.dat (It can be empty, whatever).
3. Save testfile.dat to /var/www/test - making sure you create the folder inside gedit.
4. Open aterm, xtrem, gnome-terminal, or whatever, and type cd /var/www
5. Execute above commands.

Should this be allowed? If you can't even move into the folder, you shouldn't be allowed to list it's contents. In fact, the opposite behavior is displayed here, where I can navigate to iago's home folder, but not list the directory.

joe@deadmeat:~ $ ssh -p 8001 www.javaop.com
Last login: Tue Apr 18 17:02:03 2006 from aca2e2b1.ipt.aol.com
Linux 2.4.29.

NOTE: Please don't run SETI@home on Darkside, I don't have a lot of CPU to begin with.  If anything, run it on Pie.

Mr. Salter's side of the conversation was limited to expressions of assent.
When Lord Copper was right he said "Definitely, Lord Copper"; when he was
wrong, "Up to a point."
        "Let me see, what's the name of the place I mean?  Capital of Japan?
Yokohama isn't it?"
        "Up to a point, Lord Copper."
        "And Hong Kong definitely belongs to us, doesn't it?"
        "Definitely, Lord Copper."
                -- Evelyn Waugh, "Scoop"

joe@darkside:~$ cd /home/iago
joe@darkside:/home/iago$ ls
/bin/ls: .: Permission denied


Also, this seems to be only in effect for folders created by the superuser.

joe@darkside:/home$ ls iago
/bin/ls: iago: Permission denied


Discuss?
Title: Re: FD: LS where not allowed?
Post by: Newby on April 20, 2006, 09:55:06 PM
Quotejames@impaler:~$ cd /home
james@impaler:/home$ ls
ftp/  hitmen/  james/  krazed/  newby/
james@impaler:/home$ ls newby/
/usr/bin/ls: newby/: Permission denied
james@impaler:/home$ ls -dl newby
drwx--x--x  2 newby users 4096 2005-09-21 19:30 newby/

james@impaler:/home$ cd newby
james@impaler:/home/newby$ ls
/usr/bin/ls: .: Permission denied
james@impaler:/home/newby$ cd ..
james@impaler:/home$ sudo chmod 755 newby/
Password:
james@impaler:/home$ ls newby
public_html@

james@impaler:/home$ cd newby
james@impaler:/home/newby$ ls
public_html@

Check the folder's permissions, 'tard.
Title: Re: FD: LS where not allowed?
Post by: Joe on April 20, 2006, 11:02:52 PM
Just like you to have both james and newby. =p
Title: Re: FD: LS where not allowed?
Post by: Newby on April 20, 2006, 11:29:50 PM
The only reason I have newby is so when I give out a link on my home HTTP server, I can link them to ~newby instead of ~james.

And james I just wrote in place of my real user name (which includes my last name). Props to whoever can figure it out.
Title: Re: FD: LS where not allowed?
Post by: Quik on April 21, 2006, 12:04:22 AM
~jklinckttzz or whatever.
Title: Re: FD: LS where not allowed?
Post by: Newby on April 21, 2006, 08:58:25 AM
Quote from: Quik on April 21, 2006, 12:04:22 AM
~jklinckttzz or whatever.

Close enough. :P
Title: Re: FD: LS where not allowed?
Post by: Joe on April 21, 2006, 05:08:55 PM
Klinket!
Title: Re: FD: LS where not allowed?
Post by: MyndFyre on April 22, 2006, 03:17:46 PM
Incidentally (and I only bring this up since you asked "should" you be able to navigate a folder but not list its contents), I have an FTP server folder that allows writing of new files but not listing of contents (this is set through NTFS permissions).  Meaning, anonymous users (people who aren't impersonating, say, me) can upload, can't overwrite, and can't see what files are there.
Title: Re: FD: LS where not allowed?
Post by: Joe on April 22, 2006, 05:42:21 PM
Kinda like iago's upload script?
Title: Re: FD: LS where not allowed?
Post by: Sidoh on April 22, 2006, 07:08:26 PM
Quote from: MyndFyrex86] link=topic=5644.msg66247#msg66247 date=1145733466]
Incidentally (and I only bring this up since you asked "should" you be able to navigate a folder but not list its contents), I have an FTP server folder that allows writing of new files but not listing of contents (this is set through NTFS permissions).  Meaning, anonymous users (people who aren't impersonating, say, me) can upload, can't overwrite, and can't see what files are there.

http://sidoh.dark-wire.net/upload/files
Title: Re: FD: LS where not allowed?
Post by: MyndFyre on April 24, 2006, 06:54:50 PM
Quote from: Joe on April 22, 2006, 05:42:21 PM
Kinda like iago's upload script?

Yes, but no programming required; it's a feature of the filesystem.