taint: system vs. backticks and permissions

From: Kristina Clair (kclair_at_gmail.com)
Date: 08/27/04


Date: Fri, 27 Aug 2004 11:54:15 -0400

Hi,

I have a perl script running suid root (thus running in taint mode), and
I'm trying to execute a shell command. Usually I do this using
backticks so I can get the output, and usually it is not a problem.

However, in this instance I am trying to execute a python script, and
the python script does not seem to be running as root, but as the apache
user.

Interestingly, using system() changes this and the python script runs
appropriately as root. But, I'm having the following problems:

- if I use system("/python/command args") then the python script
executes appropriately but the output from the python script is being
sent to httpd and i'm getting an internal server error due to malformed
headers

- if I use system("/python/command args >/dev/null") perl does not like
this at all and it seems to not only not execute the python script, but
it runs the perl script again from the beginning (!?!?!?!)

So I'm very confused by this behavior. Does anyone have any ideas about
what is going on? What is the difference between using backticks and
system() in terms of how the perl script is calling the python script?
And is there a way for system() to be happy but not send output to httpd?

Thanks for any help.
Kristina



Relevant Pages

  • RE: Lexar JumpDrive mount problem
    ... report that Alexandre Ganso published and Jason Cortezzo came up ... It clearly is mounting as the current user vs. root as ... perhaps it can be adapted to the usb-storage script to work around ... necessary even though it is needed to get the usb-storage script to execute ...
    (Fedora)
  • Re: Executing python script stored as a string
    ... how to execute a python script stored as a string? ... You can pass in a global and local namespaces to exec as arguments: ... the script in string should behave just like any other ordinary python ... If you want it to execute in a separate *process*, ...
    (comp.lang.python)
  • Re: Will Linux become as vulnerable as MS ??
    ... > beeing vulnerable to viruses. ... > that they know are executable, and execute intentionally. ... >> Linux, each distro is a little different, and even within the distro, ... > Since clicking on a script is easier than typing it's name, ...
    (comp.os.linux.security)
  • Re: Help a sudo newbie
    ... execute one shell script /example/script.sh. ... What kind of sudo configuration can I have to let that joeblow execute ... can execute that you have to run it as root or a reasonable facsimile. ...
    (comp.os.linux.misc)
  • Re: [Full-Disclosure] ColdFusion cross-site scripting security vulnerability of an error page
    ... > execute the arbitrary javascript and HTML code which the attacker ... > It is possible to display the contents transmitted from the client ... > cross-site scripting attack can be executed. ... the script will be executed when the script for an attack ...
    (Full-Disclosure)