logging as root using python script

max.derkachev at gmail.com max.derkachev at gmail.com
Thu Apr 7 06:41:11 EDT 2005


Unixish system won't let You execute a setuid script with the setuid
privileges. Only real machine code can be executed so.
But of course, there are workarounds. When, say, you have a perl script
with setuid bit set, and sperl (setuid root perl) is installed, the
perl interpreter choses  sperl to interpret your script (sperl makes it
impossible to execute a symlink attak, which is the reason why UNIX
does not leverage privileges for setuid scripts).
So, You may write a perl suid wrapper for your python script, and let
sperl execute it.




More information about the Python-list mailing list