f



FTP and SSH file access question

Hi All,
I am working on a RedHat 9 machine remotely (in a lab environment),
trying to access a file owned by root (permissions: -r--------) on the
remote machine. I have root FTP access (upstream) but only user-level
access via SSH.

The FTP data port (20) is closed, so I can't get the file with FTP. I
can't use SSH (or SCP) to view/download the file, because root is
disabled from connecting to SSH (even locally).

Does anyone have any ideas? I figure the combination between root FTP
access and standard SSH access can be used in some way. The remote
machine also has web services running, and the user account I can use
via SSH has access to a personal web page directory.

Any help is much appreciated.

Thanks,
c3dy8911r
0
c3dy8911r (15)
11/30/2004 8:06:12 PM
comp.os.linux.misc 33599 articles. 1 followers. amosa69 (78) is leader. Post Follow

7 Replies
619 Views

Similar Articles

[PageSpeed] 23

c3dy8911r <c3dy8911r@yahoo.com> wrote:
: Hi All,
: I am working on a RedHat 9 machine remotely (in a lab environment),
: trying to access a file owned by root (permissions: -r--------) on the
: remote machine. I have root FTP access (upstream) but only user-level
: access via SSH.

: The FTP data port (20) is closed, so I can't get the file with FTP. I
: can't use SSH (or SCP) to view/download the file, because root is
: disabled from connecting to SSH (even locally).

: Does anyone have any ideas? I figure the combination between root FTP
: access and standard SSH access can be used in some way. The remote

Why not log in via SSH as normal user, su over to root, copy the file
and change permissions ( or just change the permissions )- then download via SSH?

Stan


-- 
Stan Bischof ("stan" at the below domain)
www.worldbadminton.com 
0
essteeaenn (208)
11/30/2004 8:17:35 PM
  c3dy8911r@yahoo.com (c3dy8911r),
  In a message on 30 Nov 2004 12:06:12 -0800, wrote :

c> Hi All,
c> I am working on a RedHat 9 machine remotely (in a lab environment),
c> trying to access a file owned by root (permissions: -r--------) on the
c> remote machine. I have root FTP access (upstream) but only user-level
c> access via SSH.
c> 
c> The FTP data port (20) is closed, so I can't get the file with FTP. I
c> can't use SSH (or SCP) to view/download the file, because root is
c> disabled from connecting to SSH (even locally).

This is proper.

c> 
c> Does anyone have any ideas? I figure the combination between root FTP
c> access and standard SSH access can be used in some way. The remote
c> machine also has web services running, and the user account I can use
c> via SSH has access to a personal web page directory.

Is sudo installed on the remote machine?  Are you in the /etc/sudoers
file?  If so, you can connect as your normal (unpriv account) using
SSH, and then use sudo to access the file in question.  I'm presuming
that you are a (trustworthy) system admin for the machine in question. 
Otherwise, I presume that file's ownership and permissions are the way
they are for a good reason.

c> 
c> Any help is much appreciated.
c> 
c> Thanks,
c> c3dy8911r
c>                                                                                                        

                                     \/
Robert Heller                        ||InterNet:   heller@cs.umass.edu
http://vis-www.cs.umass.edu/~heller  ||            heller@deepsoft.com
http://www.deepsoft.com              /\FidoNet:    1:321/153






                                                
0
heller (3031)
11/30/2004 8:22:21 PM
On 30 Nov 2004 12:06:12 -0800, c3dy8911r staggered into the Black Sun
and said:
> I am working on a RedHat 9 machine remotely (in a lab environment),
> trying to access a file owned by root (permissions: -r--------) on the
> remote machine. I have root FTP access (upstream) but only user-level
> access via SSH.

Clarify this.  Did you mean, "On localmachine, I have the root password.
On remotemachine, I don't."  If this is the case, you can't access a
root-owned file with 0400 permission, end of story.  Contact the
sysadmin if this is the case and explain your problem; maybe she'll be
able to help in some way.

> can't use SSH (or SCP) to view/download the file, because root is
> disabled from connecting to SSH (even locally).

If you meant, "I have the root password for remotemachine, but I can't
do anything because 'ssh -l root remotemachine' doesn't work", then you
work around it, like so:

localmachine:~$ ssh remotemachine
remotemachine:~$ su -
remotemachine:~# cp /file/i/need ~username/file && chown username
~username/file
remotemachine:~# exit
remotemachine:~$ exit
localmachine:~$ scp username@remotemachine:/home/username/file .

> Does anyone have any ideas? I figure the combination between root FTP
> access and standard SSH access can be used in some way.

If ftpd isn't running on remotemachine, FTP access will not buy you
anything at all.

-- 
Matt G|There is no Darkness in Eternity/But only Light too dim for us to see
Brainbench MVP for Linux Admin /    mail: TRAP + SPAN don't belong
http://www.brainbench.com     /                Hire me! 
-----------------------------/ http://crow202.dyndns.org/~mhgraham/resume
0
11/30/2004 8:31:48 PM
Thanks for all the replies. Let me clarify: I don't have the root
password, otherwise I could sudo (as suggested). This is a legitimate
test environment (completely authorized) and I have inserted a
trojaned version of the vsftp daemon. This gives me root FTP access,
but I am limited by the upstream FTP commands (I can't download, as
stated).

Is there a work-around to the permissions problem that would allow me
to access the file remotely via SSH given the limited root FTP access
I have?

Thanks again,
c3dy8911r
0
c3dy8911r (15)
12/1/2004 5:30:49 AM
c3dy8911r wrote:
> Thanks for all the replies. Let me clarify: I don't have the root
> password, otherwise I could sudo (as suggested). This is a legitimate
> test environment (completely authorized) and I have inserted a
> trojaned version of the vsftp daemon. This gives me root FTP access,
> but I am limited by the upstream FTP commands (I can't download, as
> stated).
> 
> Is there a work-around to the permissions problem that would allow me
> to access the file remotely via SSH given the limited root FTP access
> I have?
> 
> Thanks again,
> c3dy8911r

This sounds suspiciously near like asking for break-in
instructions. You could get a bit more detailed responses
if you can convince us that you're not planning a crack.

-- 

Tauno Voipio
tauno voipio (at) iki fi

0
12/1/2004 7:17:58 AM
You're right, this sounds sketchy at best.

This exercise is part of a university lab project. One team, the
hacking team (myself and two colleagues) was allowed access to the
system to open holes (that's how the trojaned FTP program was
inserted). The following week, the defending team hardened the system
to keep us from accessing a particular file.

I used the authorized_keys file (uploaded via my root FTP access) to
get access to the user account via SSH. Now, I can't change the
permissions via FTP -- not sure why.

Any ideas would be great. I assure you this is completely legitimate.
If I wanted to hack a system, I certainly wouldn't post any intention
to a newsgroup.

Thanks,
c3dy8911r
0
c3dy8911r (15)
12/1/2004 9:23:57 PM
In article <f6b96d9f.0412011323.6a57659b@posting.google.com>,
 c3dy8911r@yahoo.com (c3dy8911r) wrote:

>This exercise is part of a university lab project.
>
>I assure you this is completely legitimate.
>If I wanted to hack a system, I certainly wouldn't post any intention
>to a newsgroup.

Nevertheless, sounds like you're asking for help for an assignment 
you're supposed to be doing yourself.
0
ldo (2177)
12/4/2004 1:41:30 AM
Reply: