So this challenge made me feel really stupid lol.
I have a really bad habit(or good???) of over complicating while doing pen test challenges.
To get the first answer all I had to do is put in “sudo -su user2” and I would have been logged in.
But nowhere on the material did it say that was the answer.
So I ended up using ‘sudo -u user2 /bin/bash ./test.sh’ with ‘test.sh’ containing File Read (a) for bash from GTFOBins.
I was able to get the flag for user2 and id_rsa for root easily after that, but I feel really dumb for not knowing the intended way of getting in.
What lesson should I learn from this? Git gud? At least I solved it in an interesting way? I’m cooked?
I genuinely do not know… ;_;