<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body dir="ltr" bgcolor="#ffffff" text="#000000">
Noam Rathaus wrote:
<blockquote
cite="mid:6a2b811d0904230333r3bf08ac1r10172d323b77c6bf@mail.gmail.com"
type="cite">
<pre wrap="">Hi Shachar,
Thanks for the response.
I am using here Debian 5.0 and I still get the problem even if I:
1) setuid the file to be setuid root
2) change the perl interpreter at the top of the script from perl to
suidperl (they are the same symbloic link, but I tried it anyhow)
So I guess something is wrong with my apache, or script, or both
</pre>
</blockquote>
On my Debian Lenny:<br>
Installed perl-suid<br>
Installed apache2<br>
Put, in /usr/lib/cgi-bin, a file called "test" that read:<br>
<blockquote type="cite">#!/usr/bin/perl<br>
<br>
print "Content-Type: text/plain\n";<br>
print "\n";<br>
<br>
while(<>) {<br>
print $_;<br>
}<br>
</blockquote>
<br>
Changed owner to root and added suid.<br>
<br>
>From a broser, ran:<br>
<a class="moz-txt-link-freetext" href="http://localhost/cgi-bin/test?%2fetc%2fshadow">http://localhost/cgi-bin/test?%2fetc%2fshadow</a><br>
<br>
Result: /etc/shadow was dumped to the browser window.<br>
<br>
Shachar<br>
<pre class="moz-signature" cols="72">--
Shachar Shemesh
Lingnu Open Source Consulting Ltd.
<a class="moz-txt-link-freetext" href="http://www.lingnu.com">http://www.lingnu.com</a>
</pre>
</body>
</html>