I will share a solution for LootStash challenge of the CTF tryout.
I tried two approaches. Simple one and the simpler one. I will start with the simple one.
simple solution
First of all, download the file and check the file type.
file stash
stash: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=817b1311ae44bdc6ed8a9b563159616844e59c64, for GNU/Linux 3.2.0, not stripped
It is an ELF file. Let’s execute it and see the result.
Diving into the stash - let's see what we can find.
.....
You got: 'Soulsiphon, Satchel of Suffering's End'. Now run, before anyone tries to steal it!
Diving into the stash - let's see what we can find.
.....
You got: 'Mirage, Stone of the Wind'. Now run, before anyone tries to steal it!
Diving into the stash - let's see what we can find.
.....
You got: 'Delusion, Whisper of Justice'. Now run, before anyone tries to steal it!
I repeated the file several times and every time I got different replies.
It seems it stores strings and prints them out randomly.
So, I checked the read-only data of the file.
readelf -t stash
If my guess is right, strings should be stored from the offset 0x3000.
And yes, I can see prepared strings.
I found the flag at 0x3c50.
the simpler solution
strings stash | grep -i htb
duh