Sujet : Re: Simple way for web to execute root shell script.
De : fritz (at) *nospam* spamexpire-202505.rodent.frell.theremailer.net (Fritz Wuehler)
Groupes : comp.os.linux.miscDate : 24. May 2025, 22:34:48
Autres entêtes
Organisation : dizum.com - The Internet Problem Provider
Message-ID : <554abf986e89bab937f0f6061f61122f@msgid.frell.theremailer.net>
References : 1 2
Andrew Smallshaw <
andr...@sdf.org> [AS]:
AS> I have a vague memory of an "shc" package which describes itself
AS> as a shell script compiler. In reality it isn't but it does
AS> package up the script in a directly executable format (i.e. ELF)
AS> and pass it to the shell at runtime. That would allow a SetUID
AS> flag to work.
Nope.
The 'shc' generated executable will first decrypt/validate itself and
then launch behind the scenes whatever shell was specified as
its option (or the default shell), feeding it with the original
shell script. The kernel will still not honour the setuid bit.
'shc' was written as a way to obfuscate/ensure the integrity of
released shell scripts, it doesn't parse/understand the script
commands itself, thus it's useless in the OP's scenario.