 Hello everybody, my name is John Hammond, and I'm coming back at you on a YouTube video now showing off some of the LASSA CTF Which is currently running at least while I'm recording this I guess this is a capture flag competition that I'm participating in by high schoolers for high schoolers Myself being a college student. I guess it's not kind of directed towards me Regardless, it's a computer science competition run from liberal arts and science Academy in Austin, Texas So it's just a regular CTF I just got started on some of the problems so I figured I'd show off what I have solved so far Which I'm just gonna make a video on the Shifty letters the challenge, which is a real simple just Caesar Cypher Cal got his letters confused help him out and it gives you this prompt here And we can see very clearly This is insanely likely to be a flag because of those braces and underscores So it looks like this is just a simple Caesar Cypher We just have to shift it and figure out what it shifted by We could do this with an online tool But since we have already written some code in a previous video We can go ahead and use that. I am currently listening to a little bit of music right now I hope that's okay I just actually turn it back on because right now I'm just kind of doing this on my own So the code that I have is actually Caesar cypher dot pi put it in my code folder So I'm just gonna fire that back up and see if I can I'll get sublime text visible for you guys I'll drag that down here And I'll find That Caesar Cypher script the rotate function was just all that we had that would actually kind of do this for us So what I normally when I'm in the middle of a CTF. I will go ahead and save a file in Where I normally save all the stuff that I work with for when it comes to competitions I'll create a folder specifically for it and then I would have a folder for each challenge Show I already have a shifty letters complete folder, but I guess for the purpose of demonstration I'll just show this one to you and I always name my scripts initially ape dot pie Ape being that I throw stuff at stuff It just became a joke between my friends and and the team the cyber team that I that I that I play all the CTF So on and with so let's get a pie done script going. Let's import Let's just paste in that rotate function Which pretty much does the Caesar Caesar cypher for us Well, I already wrote all that code in a previous video that I will try and link to but it's pretty much just an easy Caesar Caesar cypher in Python. So let's actually get that string that we need that is a challenge string anyway And this is all code. I've already written. I'm just kind of doing it again to make a demonstration and show you how to do it So we can just call that the challenge string and I'll actually put that down here Okay, so what I would normally do is I would do a for I in length Actually, sorry, it should be range because we want to get a number here because that's what we're gonna offset by what we're gonna Try and do is brute force every single possibility of all the 26 letters or key offsets we can shift this The Caesar cypher by so this is what I would normally do I would just do for I in range length of strained ASCII Upper case or lower case whatever the case may be doesn't really matter in this case It's just gonna be the alphabet. I'm doing this to loop through zero to 26 I could have just put in range of 26 But I don't know just for programmable need whatever the heck I just put this in and then we'll just go ahead and print out the current offset They were printing on by and then rotate the string. Oh, I'm sorry Rotate by the function name rotate by the challenge string by I and if we run this I'll make this pep 8 Appropriate. Well, if I run this it said to look through all of these Blah blah blah look for English and I see number 12. I see some English characters there Romeo fall but Cypher will remain take this flag in remembrance. So it's because I know I got that to work What I'm gonna do is I'm just gonna put that in brute force Cypher's And I'll just kind of put all that in there and since um What I would normally do it's just kind of coming out with the steps of what I've done and Then kind of make more function specifically to it. So show answer Or I guess get answers as I'm not gonna print it out, but I will now return What we've just found because we've already got the flag this one I just want to make it so all my scripts can get it that well So I'll put a rotate challenge string and then we know 12 is now the offset by and then We would use another I want to use a get flag function. Just so It's good for us. I would run that get answer script that we just I actually should return Being visible and get answer I'll return and get answer and I will split it by Space character so it doesn't really need any arguments and I'll just get the last one of it So I know that it's the very last part of the challenge scripts the challenge prompts string Which is just this flag here So I'm returning that as the last word and then all we do as the actual code We can just print to get flag and run that function and now we get last the CTF be shifted no more We actually got the flag for this the CTF job, so I'd put that in and I submit it and I get my 10 points whatever and we're done but just showing the steps of what I did I would look for whatever Key offset has English and I do that with brute force cypher and then Get answer Would get the full text Get flag displays only the text and then we're good We submit that flag and we're good and we're all done with that challenge and simple Caesar cypher But we had already written the code for it So all we have to do is put it to use and actually get a flag for a CTF challenge now Normally, I would just save this as a get flag dot pi so I will know that it has actually done and then in that folder that actually contains everything of That I've using for the competition Last CTF I would rename this folder to that challenge name underscore complete Just like I had over here and you can see these are the stuff that I already did And it's pretty much identical code. I Just don't have my comments. Actually, I actually like this code better and I'll save it over But yeah, we're done. We just got that simple challenge and that's how I did it I hope to do more similar videos like this and to show you how I get other solutions to the CTF and Future CTFs, but thanks for watching guys. Hope to see you in the next tutorial