 What's going on everybody? My name is John Hammond and welcome back to another YouTube video. We're looking at the Sunshine CTF. This is a challenge in their Michelinius category. It's called BrainMeat. It says I'm having a beef with someone that is so bad I can't even think. He sent me a message but I think he was having a stroke. Please decipher the message while I beat him up. Alright cool. So BrainMeat.tex is the file that's given to us. Let's go ahead and copy that link location and let's W get it so we can work with it. I've created a directory already for us so we have a BrainMeat.tex. Let's go ahead and see what it actually is. I'm going to open it up in sublime text. I'll bring it down here so you can see it. And we have a lot of nonsense. The pattern of capital letters and numbers and lowercase letters kind of reminds me of base 64 but I see some characters that aren't normally base 64 in there. Like the opening square brace. I don't normally see hyphens in there. Arrows, greater than symbols, less than symbols, waka waka is whatever you want to call them. So what we could do and I tried to do this was actually cut it up. I tried to cut it up on hyphens but what you can do if you want to do that is cut out BrainMeat and then TR so replace everything that is a hyphen with a new line. So now you get all the new line characters then you can do a little wow read line if you want to go through each of those lines and go ahead and decode them with base 64 but you know even then you're not going to get that to work because it's you still got all those stray characters in there so you see all of those will actually yeah all of those will fail. Okay so back to the drawing board eventually it hit me that the characters that are in the way or the things that it hasn't normally seen are brain fuck characters and the title of the challenge being BrainMeat I was like oh epiphany obviously that's it if they're trying to hide some brain fuck language in this garbage the in that maybe there's just muddled in base 64 randomness so what I decided to do then is to go ahead and create a script that will loop through these because we know let's say user in environment Python just get a little shebang line in there. The brain fuck characters brain foot characters are and you might not know these off the top of your head and that would that's perfectly fine if you don't but it's kind of just random characters and then their representative copy so plus minus period comma and the greater than less than symbols so that should be the brain fuck characters so let's open up brainmeat.txt and then in a dirty way let's just read from it so we've got the content so let's say for C in content if that character is in the possible brain foot characters let's actually keep track of it so let's just say BF or something to have an array that we can keep track of all that in so let's just do bf.append that character and then at the very very end we can print out that BF all put together so let's see what we got here and that looks like quite possibly brain fuck in my opinion I would go ahead and put that in just a little tio.run because I know that that tried online utility again mentioned ctf katana I'm sorry I just bumped the microphone I'm sorry that might have that might have sounded bad brain fuck not Brian brain fuck there you are I have my mouse over all along space that in there and son fuck the brain we got beef cool cool so that is that flag I took a little bit of staring at this for a long time to realize that oh those characters are there purposefully and it's ruining it because the challenge is called brain meat so that was the epiphany it took a little bit of time but hey you stare at long enough eventually you'll try everything and that is the lesson that I've learned through many capital flag competitions is try everything even if you have an idea and you know it's going to take some effort and some time to like write it out to like write the script do not let that stop you try everything that might be the flag might be under a rock that you just didn't check but you knew that you you had the idea to do so so you'll beat yourself up for that a lot and I've done that over the years so alright cool that's that there is going to be a brain fuck interpreter as part of the automated version of katana it actually is already written but it's not functioning right right now with the framework so I would show that to you but the brain fuck code is already in there in python so enough of me talking about katana enough of me talking let's just close the video out thanks for watching guys if you did like this video please do like comment subscribe if you liked the video join our discord server links in the description love to see on patreon love to see on paypal get out of youtube