I've been battling with one school task for a couple of days and can't seem to find any idea how to solve it. The task is pretty simple:
On the server there is a secret.txt file in the /root folder, which is owned by root. The task is to read the contents of this file, which contains the answer. To solve the task, use one of the programs with SUID privileges to access the root account.
First I check which programs do have SUID privileges by using command find / -perm /4000
which returns these programs:
/usr/bin/chfn
/usr/bin/umount
/usr/bin/passwd
/usr/bin/mount
/usr/bin/chsh
/usr/bin/date
/usr/bin/gpasswd
/usr/bin/newgrp
/usr/bin/procmail
/usr/lib/openssh/ssh-keysign
/usr/lib/dbus-1.0/dbus-daemon-launch-helper
/usr/sbin/sensible-mda
And I don't have any idea how to proceed with it.
Is there any way to use procmail
to read the file while sendmail
or mail
don't have the privileges? I've tried to send a mail to myself with the file attached but every time I either had to use some sort of basic Linux command like cp
or cat
inside .procmailrc
which resulted in Permission Denied
, or had to use sendmail
or mail
which don't have the privileges for the file. Of course I don't have sudo rights. I'm just completely out of ideas on this one.
date
andsensible-mda
seem suspicious to me...date
is not normally a SUID tool, that makes it stand out in your list.