9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: "andrey mirtchovski" <mirtchovski@gmail.com>
To: "Fans of the OS Plan 9 from Bell Labs" <9fans@cse.psu.edu>
Subject: Re: [9fans] a challenge
Date: Fri, 22 Feb 2008 11:23:57 -0700	[thread overview]
Message-ID: <14ec7b180802221023j472a7953v70c31da9ed1c0563@mail.gmail.com> (raw)
In-Reply-To: <13426df10802220953q3af4a1aarf93acaaebfedc9b@mail.gmail.com>

well, i checked the source. turns out bash 3.2 drops privileges if uid
!= euid and requires the -p flag to allow itself to run in setuid
mode:

$ cp /bin/bash .
$ sudo chown root bash
$ sudo chmod 4755 bash
$ ./bash -p
# id
uid=500(andrey) gid=500(andrey) euid=0(root) groups=500(andrey)
# whoami
root
#

that doesn't make me like Plan 9 any less, you know :)

On Fri, Feb 22, 2008 at 10:53 AM, ron minnich <rminnich@gmail.com> wrote:
> here is a challenge. I realize it's linux but I think this is the
>  right group to ask anyway; I think you'll appreciate the humor in it.
>  So far few I have talked to have gotten it.
>
>  There is a file, called /bin/bash.
>
>  You are allowed to do this as root.
>  cp this file to /tmp. Do something to it to make it so that, when you
>  are not root, you can run the file in /tmp and get a root shell.
>
>  Don't assume the obvious. And please don't post "that's trivial" until
>  you have actually done it.
>
>  ron
>


  parent reply	other threads:[~2008-02-22 18:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-22 17:53 ron minnich
2008-02-22 17:57 ` Pietro Gagliardi
2008-02-22 18:03   ` Pietro Gagliardi
2008-02-22 17:59 ` john
2008-02-22 18:23 ` andrey mirtchovski [this message]
2008-02-22 18:33   ` ron minnich
2008-02-22 18:57     ` lucio
2008-02-22 20:02     ` Charles Forsyth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=14ec7b180802221023j472a7953v70c31da9ed1c0563@mail.gmail.com \
    --to=mirtchovski@gmail.com \
    --cc=9fans@cse.psu.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).