exploit the possibilities
Home Files News &[SERVICES_TAB]About Contact Add New

rsshscponly.txt

rsshscponly.txt
Posted Dec 12, 2004
Authored by Jason Wies

Although rssh and scponly were designed to limit the use of a shell on a remote host, various underlying programs that they are allowed to use may allow for arbitrary command execution.

tags | advisory, remote, arbitrary, shell
SHA-256 | 221d90a3802c19d25ff31131746e485e622f1afce6b8ffef9f1934ead0f4784b

rsshscponly.txt

Change Mirror Download
Vulnerable applications:

rssh
All versions
All operating systems
scponly
All versions
All operating systems

Not vulnerable:

Discussion:

rssh and scponly are restricted shells that are designed to allow execution
only of certain preset programs. Both are used to grant a user the ability
to transfer files to and from a remote host without granting full shell
access. Due to the fact that most of the preset programs offer options that
execute other programs, arbitrary command execution on the remote host is
possible.

rssh allows any of five predefined programs to be executed on the remote
host depending on the configuration. Those that are known to be vulnerable
in combination with the techniques described in this posting are marked with
an asterisk.
- scp*
- sftp-server
- cvs
- rdist*
- rsync*

scponly allows a number of predefined programs to be executed on the remote
host depending on compile-time options. Those that are known to be
vulnerable when used with scponly:
- scp
- rsync
- unison (*untested)

The program execution options that these programs offer:

rdist -P <program>
rsync -e <program>
scp -S <program>
unison -rshcmd <program>
unison -sshcmd <program>

These options allow the user to specify the location of the shell to use
when connecting to the remote host. No restriction is placed on what
programs may be specified by these options, and rssh and scponly do not
filter these options out. The end result is that although a user may be
restricted by rssh or scponly to running e.g. only /usr/bin/scp, they can
in fact execute any program using /usr/bin/scp -S <program>.

The problem is compounded when you recognize that the main use of rssh and
scponly is to allow file transfers, which in turn allows a malicious user to
transfer and execute entire custom scripts on the remote machine.

rssh with sftp-server does not appear to be vulnerable. rssh with cvs is
also not vulnerable using these techniques. However, it is quite probable
that a malicious user could check out a carefully crafted CVS repository and
execute arbitrary commands using CVS's hooks interface.

Examples:

ssh restricteduser@remotehost 'rsync -e "touch /tmp/example --" localhost:/dev/null /tmp'

scp command.sh restricteduser@remotehost:/tmp/command.sh
ssh restricteduser@remotehost 'scp -S /tmp/command.sh localhost:/dev/null /tmp'

Solution:

There are no workarounds for this problem.

I have talked with the author of rssh, Derek Martin. He is currently
indisposed for an indefinite period of time due to changing countries and
having no permanent home at the present moment. Moreover he has other
priorities and has lost interest in maintaining the program. He has offered
to assist anyone who would like to take over maintainership of rssh, but he
does not intend to provide a fix for the current problem. Given this fact,
I would strongly recommend against using rssh at this time.

The author of scponly, Joe Boyle, has prepared a new release, version 4.0,
that addresses the current problem.

Distributor updates have been coordinated with this posting and should be
available soon.

I think the long-term solution for those needing a highly secure restricted
shell is to allow granular configuration by administrators of which options
and arguments, if any, are allowed to be specified for which programs. In
the most restricted case entire command lines would be stored on the remote
host and the client would be allowed only to select from the list of
available command lines. I'm not aware of any software that offers these
capabilities today.

References:
http://www.pizzashack.org/rssh/index.shtml
http://www.sublimation.org/scponly/
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    45 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close