Subject: Pine question

From: Hue Codo <[email-masked]>
Date: Tue, 21 Oct 2003 09:57:13 -0700 (PDT)

I posted a question earlier and have not received any
responce yet.
We have a script that executes in user's .profile to
allow user only using Pine. One of my user seems to
break through the Pine to get to his unix prompt
level.

Can User break through Pine to get to Unix prompt? If
so, how do I stop it? Thanks.

Hue

__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
-- 
-----------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/pine/pine-info/
-----------------------------------------------------------------

---

From: "Brian Bruns" <[email-masked]>
Date: Tue, 21 Oct 2003 13:03:35 -0400

Hello,

Try this:
In your /etc/pine.conf (or whereever it might be depending on what you setup
during build), add under:

feature-list=

disable-suspend

That should solve it nicely.
--------------------------
Brian Bruns
The Summit Open Source Development Group
Open Solutions For A Closed World / Anti-Spam Resources
http://www.sosdg.org
ICQ: 8077511

---

From: Andy Malato <[email-masked]>
Date: Tue, 21 Oct 2003 13:28:47 -0400 (EDT)

If you are trying to prevent user access to shell services and only want
users to be able to execute a handful of selected programs, such as
pine, then you should consider assigning a menu based shell.  By writing
a script that will display a menu and making it the user's shell you
will have complete control over what they can do.  Modifying a user's
.profile to prevent shell services is not good practice, it also means
that it would have to be modified for each user.  Also, this method does
not do much when you want to restrict ftp services to the box, if the
shell you currently assign to the user is located in /etc/shells then
he/she will have ftp access.

Regards,

         ---Andy

On Tue, 21 Oct 2003, Hue Codo wrote:

! I posted a question earlier and have not received any
! responce yet.
! We have a script that executes in user's .profile to
! allow user only using Pine. One of my user seems to
! break through the Pine to get to his unix prompt
! level.
!
! Can User break through Pine to get to Unix prompt? If
! so, how do I stop it? Thanks.
!
! Hue
!
!
!
! __________________________________
! Do you Yahoo!?
! The New Yahoo! Shopping - with improved product search
! http://shopping.yahoo.com
! --
! -----------------------------------------------------------------
!  For information about this mailing list, and its archives, see:
!  http://www.washington.edu/pine/pine-info/
! -----------------------------------------------------------------
!

---

From: Gopi Sundaram <[email-masked]>
Date: Tue, 21 Oct 2003 13:07:28 -0500 (CDT)

On Tue, 21 Oct 2003, Hue Codo wrote:

> We have a script that executes in user's .profile to allow user only
> using Pine. One of my user seems to break through the Pine to get to
> his unix prompt level.

Unless the user's shell is set to Pine, any user should be able to break
out by hitting ^C immediately after authentication. It's only a matter
of timing.

> Can User break through Pine to get to Unix prompt?

Yes, but that is separate from above.

> If so, how do I stop it? Thanks.

Tough. Pine has many hooks for calling other programs or shells. Here's
what I can think of:

suspend
spellcheck
attachment viewers
url viewer
sending filters
display filters
printers
signature

I don't think that is a complete list, but any of those features could
be abused to get shell access through Pine. Can anyone think of more?

Disabling them would be a pain to users and administrators, will not be
easy to do, and may not work.

-- 
Gopi Sundaram
http://www.zrox.net/Mail/Pine/

---

From: "Brian Bruns" <[email-masked]>
Date: Tue, 21 Oct 2003 14:16:46 -0400

You can kill the ctrl-c problem easily (if its a bash compatible shell) by
putting in right at the beginning of the profile/bashrc file systemwide:

trap '' 2

Thats two single quotes with no space.  That stops ctrl-c from working.
--------------------------
Brian Bruns
The Summit Open Source Development Group
Open Solutions For A Closed World / Anti-Spam Resources
http://www.sosdg.org
ICQ: 8077511

---

From: Douglas Kline <[email-masked]>
Date: Tue, 21 Oct 2003 14:49:51 -0400 (EDT)

/etc/shells lists the shells that are permitted for users *receiving* ftp
connections, not out-going.

There are restricted shells available like rsh (same name as the
remote-shell command but completely unrelated) and rksh, the Korn shell
version.  These might meet the requirements.

Douglas

---

From: Douglas Kline <[email-masked]>
Date: Tue, 21 Oct 2003 14:52:42 -0400 (EDT)

You probably want to trap other signals too.  Rather than the null string
of empty quotes, you might prefer an exit command.  That could permit the
user to abort a non-responsive session, although that depends on how pine
interprets the signal too.  This will work for sh and ksh and other shells
which, like bash, are super-sets of the Bourne shell sh.

Douglas

---

From: Birl <[email-masked]>
Date: Wed, 22 Oct 2003 13:11:24 -0400 (EDT)

As it was written on Oct 21, thus Douglas Kline typed:

Douglas:  Return-Path: <[email-masked]>
Douglas:  Sender: [email-masked]
Douglas:  Date: Tue, 21 Oct 2003 14:52:42 -0400 (EDT)
Douglas:  From: Douglas Kline <[email-masked]>
Douglas:  To: Pine Discussion Forum <[email-masked]>
Douglas:  Subject: Re: Pine question
Douglas:
Douglas:
Douglas:
Douglas:  You probably want to trap other signals too.  Rather than the null string
Douglas:  of empty quotes, you might prefer an exit command.  That could permit the
Douglas:  user to abort a non-responsive session, although that depends on how pine
Douglas:  interprets the signal too.  This will work for sh and ksh and other shells
Douglas:  which, like bash, are super-sets of the Bourne shell sh.
Douglas:
Douglas:  Douglas
Douglas:
Douglas:
Douglas:  On Tue, 21 Oct 2003, Brian Bruns wrote:
Douglas:
Douglas:  > You can kill the ctrl-c problem easily (if its a bash compatible shell) by
Douglas:  > putting in right at the beginning of the profile/bashrc file systemwide:
Douglas:  >
Douglas:  > trap '' 2
Douglas:  >
Douglas:  > Thats two single quotes with no space.  That stops ctrl-c from working.
Douglas:  > --------------------------
Douglas:  > Brian Bruns
Douglas:  > The Summit Open Source Development Group
Douglas:  > Open Solutions For A Closed World / Anti-Spam Resources
Douglas:  > http://www.sosdg.org
Douglas:  > ICQ: 8077511
Douglas:  > ----- Original Message -----
Douglas:  > From: "Gopi Sundaram" <[email-masked]>
Douglas:  > To: "Pine Discussion Forum" <[email-masked]>
Douglas:  > Sent: Tuesday, October 21, 2003 2:07 PM
Douglas:  > Subject: Re: Pine question
Douglas:  >
Douglas:  >
Douglas:  > > On Tue, 21 Oct 2003, Hue Codo wrote:
Douglas:  > >
Douglas:  > > > We have a script that executes in user's .profile to allow user only
Douglas:  > > > using Pine. One of my user seems to break through the Pine to get to
Douglas:  > > > his unix prompt level.
Douglas:  > >
Douglas:  > > Unless the user's shell is set to Pine, any user should be able to break
Douglas:  > > out by hitting ^C immediately after authentication. It's only a matter
Douglas:  > > of timing.
Douglas:  > >
Douglas:  > > > Can User break through Pine to get to Unix prompt?
Douglas:  > >
Douglas:  > > Yes, but that is separate from above.
Douglas:  > >
Douglas:  > > > If so, how do I stop it? Thanks.
Douglas:  > >
Douglas:  > > Tough. Pine has many hooks for calling other programs or shells. Here's
Douglas:  > > what I can think of:
Douglas:  > >
Douglas:  > > suspend
Douglas:  > > spellcheck
Douglas:  > > attachment viewers
Douglas:  > > url viewer
Douglas:  > > sending filters
Douglas:  > > display filters
Douglas:  > > printers
Douglas:  > > signature
Douglas:  > >
Douglas:  > > I don't think that is a complete list, but any of those features could
Douglas:  > > be abused to get shell access through Pine. Can anyone think of more?
Douglas:  > >
Douglas:  > > Disabling them would be a pain to users and administrators, will not be
Douglas:  > > easy to do, and may not work.
Douglas:  > >
Douglas:  > > --
Douglas:  > > Gopi Sundaram
Douglas:  > > http://www.zrox.net/Mail/Pine/

I doubt there is a real need to trap signals, etc if /etc/shells contains
the full path to Pine AND the user's shell is set to pine in /etc/passwd.

Thus when one tries to break out of pine, Pine should terminiate and the
user's connection would be dropped.  If the user tries to ^C before Pine
is spawned, the connection is dropped.

Unless the .pinerc is configured to call a specific shell, there should be
no way of leaving Pine.  And even it IS possible to configure a specific
shell to leave Pine, file ACLs on that shell can prevent execution for
that user.

 Scott Birl
 Senior Systems Administrator            Computer Services   Temple University
 1805 North Broad Street  Philadelphia   Pennsylvania 19122  United States
====*====*====*====*====*====*====*====+====*====*====*====*====*====*====*====*