in reply to Re^3: perl pre-execution hook
in thread perl pre-execution hook

(note: the original post was changed significantly after my reply)

$ foo -bash: ./foo: /usr/bin/perl: bad interpreter: Permission denied

yes, but you can always say

$ /usr/bin/perl foo

(which would run without problem)

Replies are listed 'Best First'.
Re^5: perl pre-execution hook
by ikegami (Patriarch) on Jan 04, 2011 at 20:27 UTC

    Yeah, I've elaborated on that point while you were posting.

    yes, but you can always say

    But can the attacker? Again, it comes down to the threat model.

      But can the attacker?

      Why not?  If the attacker can run ./foo, s/he can almost certainly also run /usr/bin/perl /tmp/foo.  Actually, it's more than likely that someone uploading something to /tmp (which can be expected to be mounted noexec) would try this in the first place...

        he can almost certainly also run /usr/bin/perl /tmp/foo.

        No, it completely depends on the bug being exploited.

        You're approaching this from the point of view that the attacker can run arbitrary commands. If so, why are you ok with just protecting perl?

        I'm assuming the OP isn't silly, so that means he's trying to defend against some specific attack.

        And as i hinted below, executing "perl /tmp/whatever" actually happens alot. I did the no-exec thing years ago, but it doesnt solve the perl-bot problem.