 Hey, YouTube, a video right up for the challenge. It's magic from Codefest CTF 2018. The challenge from here is repair the given corrupt file to get the flag, download file here, and is actually a Google Drive link that you can download. I've gone ahead and downloaded it. It's called filename.extension. So we have no idea what it could be, given data here, interesting thing. I opened it up in a hex editor and I figured, okay, what do we actually have in here to work with? It says author over here and given some information, whatever is in name here. Also looks like ICC profile. So thought whatever, maybe this is an image, right? Text noted here, copyright Adobe Systems Incorporated, Adobe RGB, so definitely gotta be a picture. I figured, well, let's try some low hanging fruit. Is this a JPEG image? Let's try it. So what I did was I went ahead and copied this filename to like something called something.jpeg and then I Googled around for the JPEG magic bytes in that, okay, this is the challenge titled, it's magic and we have a broken or a corrupt picture or file. So maybe it is just a JPEG file with the wrong information set up. It gives us a little bit of information here as to what this thing looks like as it starts with. XX, I don't particularly know. Maybe, is there, I try actually, I actually got JPEG at like file header and that was what I had searched for and I found a good thing on Wikipedia. Actually, I had a good thing at active file recovery. This one seemed to work just fine. I thought it was, yeah, okay, it gives me some good example code here and that FFD8, FFX, hex information is fine to change and work with. So I actually ended up just throwing this when I solved this originally, I was working with the team in the Discord server which you should also do, join our Discord server link in the description, shameless plug. We threw it on an online tool, like I think it's Office Recovery Online or something that would end up fixing the file for us and that was pretty neat. It got it just fine, but it put on some watermark. So I figured that probably was not the intended solution and after talking with other individuals, shout out to you and El Pixel. Thank you for being fantastic. We figured, well, it's just probably a simple magic bytes change here. So yeah, let's go ahead and correct these to what they should be. Given the example on the left-hand side, FFD8, FF, E0, et cetera, we can go ahead and change these in HexEdit. If you don't have HexEdit, you can go ahead and install it. It should just be sudo apt install if you're on Ubuntu or something that actually has mediocre package repository, saves, et cetera, file name, blah, blah, blah. Will this save? Yeah, okay, cool. Control-O, it's tough to work with it and then Control-X to exit. Now I have something.jpeg. If I run file on it, it tells me it is in fact a jpeg image so we can I've known EOG it and it will load. The flag is magic bytes. Handy, let's mark that as complete. Take note of that flag.text. Let's keep that EOG open and then nano flag.text. So we can just write it. Wrap it in the correct flag format. Mac, capital G, I'm sorry, capital A, magic underscore BY, capital T, ES bytes. So we mark this as complete and we have that challenge done. Shout out to the people that support me on Patreon. Thank you guys so much. Can't say it enough. $1 more a month on Patreon will give you a special shout out just like this on every video. $5 or more on Patreon will give you early access to everything that are released on YouTube before the videos go live. If you did like this video, please do like, comment, and subscribe. I forget the next tidbit. Oh yeah, Discord. I already mentioned that, whatever. Please do join our Discord server. Link in the description. It's an awesome community full of CTF players, programmers and hackers. Cool place to hang out with me when I'm actually able to talk and not free, wasting my life away. And we're gonna play ICTF, Nox CTF, and I'll either come and capture the flag competitions. It's a really cool team and nice community. So please do join. It'd be awesome to see you on there. I'll welcome you personally. All right. Hey, I'd love to see you guys on Patreon. Love to see you in the next video. Thanks for watching.