miércoles, 24 de marzo de 2021

Words are not the price for your flag

 Well, I was fine doing this room (https://tryhackme.com/room/linuxagency) until I faced the challenge for mission25 flag.

 We have a binary file named bribe and the clue says:

mission24@linuxagency: ~$ ./bribe

There is a guy who is smuggling flags

Bribe this guy to get the flag

Put some money in his pocket to get the flag


Words are not the price for your flag

Give Me money Man!!!


It doesn't say too much information at the first glance, so I tried many options to find the flag but nothing worked. The hint says "send money to other country" in the THM room for that mission.


TBH I tried some writeups over there only for that mission but none of them had the right answer, at least this day the answer weren't in the way other found it, so I decided to try harder (these writeups for mission25 password said that it is in .viminfo file).


Then I used the strings command ant tried to understand what is inside, and I saw things like:

AWAVI

AUATL

[]A\A]A^A_

pocket  

money

Here ya go!!!

Don't tell police about the deal man ;)

init    (personal note, look at this)

There is a guy who is smuggling flags

Bribe this guy to get the flag

Put some money in his pocket to get the flag

export init=abc (another personal note, look at this too)

Money

MONEY

Words are not the price for your flag

Give Me money Man!!!

;*3$"

GCC: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0


The "personal notes" are not part of the strings command's output, so I suggest to put attention on that because that is the way how to solve it.

So I tried to change the value of init with export command and when I did that the message changed to something shorter:

Words are not the price for your flag.

Give Me money Man!!!

Look how I beautifully failed... lol


Nothing worked but something told me that I was near of the solution, so after trying many values I read carefully the strings command output and noticed 2 strings: money and pocket.

As it said in the clue originally: Put some money in his pocket to get the flag.

When I did: export (look at image below) that gave me the flag when I ran again the ./bribe binary


Takeways: Try to understand what you have in front before to just copy and paste the answers, in real life scnearios there is no chance to look for flags. In this case, the behavior of bribe binary depended of the value of the existence and value from pocket variable. Suggestion: reading more about GNU/Linux basics like env, set, export commands. Try to get comfortable with the use of the most used Operating System in the world (I bet some people don't realize where a variation of GNU/Linux is used).


Bytes & C ya!




0 comentarios:

 

Copyright © El igloo de Tux Design by O Pregador | Blogger Theme by Blogger Template de luxo | Powered by Blogger