 Hey everyone welcome back to the YouTube video My name is John Hammond and welcome to our new Ubuntu desktop our Linux distribution that we are using and we can Use to really take advantage of what we want to learn and what we're gonna know to jump in the CTF scene So you can open up Firefox get your web browser going and just log back into Pico CTF so we're looking at that long challenge for 20 points and The challenge problem that we saw earlier was okay I heard you have some delusions of grandeur about your typing speed How fast can you go at this host and port number so we can like select that and copy it and Just like we've been using that web shell over on the right hand side of the screen that gave us like a Linux command line But now that we are running Linux we can just use the Linux command line Easily on our own computer if you move your mouse to the very top left of the screen You can go to activities and you can type in terminal if you want to and you'll get one result here I have a couple of others because I am running now on my host computer Not the virtual machine that I was showing you guys how to install You can click terminal and then that will pop up this this shell here this little command line that we can use So I'm gonna increase the font size here So you can see a little bit better and then we can net cat. I'm gonna hit Control shift V to actually paste in here The command line uses the same control C control V hotkeys that you're used to but it adds a shift in there To actually control shift C control shift V to copy and paste and the control arrow keys will let you jump between words or special characters So that's what I do to move quickly in the shell So if I net cat to this it gives me that same prompt that we've seen before Please give me a certain character however many times followed by a single something and to make things interesting You only have a certain amount of time so the challenge hints here said you can use a net cat can't command to connect and They recommend using Python and it may help to have multiple windows open So since we are in Linux Python is installed by default You could have even used it in the web shell But you'll have a little bit of difficulty keeping the connection and all so since we can have multiple windows open now I Can use the control windows key and left arrow key to dart this to one side of the screen left to put it like shifted to the left side of the screen and I'll hit control alt and T at the same time to open up a new window a new terminal Okay, so let's use the up arrow to Netcat shell into this and then you can use Python in the other shell and Just like that. It's a command. We've invoked the interpreter or the program to run Python code and If they want the capital N character 581 times we can actually take that string just the character n and multiply that 581 times Cool copy that Control shift C remember paste it in and then the single four at the end So I'll hit enter and they say all right you got it That was super quick right because we able to use Python to generate it for us so The new line character kind of got in the way of our flag here But we do see it with some recognition and trainings delusions become glimpses and then a lot of hex So Pico CTF will use that random hex bit at the end because mine will certainly be different than yours And they'll use that to make sure that we aren't flag sharing or whatever the case may be Because you will have a unique flag specific to your rendition of the game so what I like to do is whenever I solve a challenge or actually in playing capture the flag competition I create a folder to actually put all of the challenges in and I normally try and write a get flag script But this one will be a little bit more difficult because it's dynamic We won't get into writing a get flag script soon because we could have automated this entire process of connecting to that shell Connecting to that console service Actually being able to read out the character that they want multiplying it sending it etc We'll do that once we get into a little bit more of Python But for now I wanted to show you this we've got the flag, but now let's go ahead and save it somewhere So let's make a directory or MK dir to make directory and then we'll call the folder whatever we particularly want I'll call this Pico CTF and then you can CD to change directory into Pico CTF cool LS to show stuff, but there's nothing in there currently So let's make another directory called long CD into that you can hit tab to auto complete if you start to type something and there's not Anything else with that same set of characters at the start if you tab it'll auto complete what you're trying to talk to control L to clear the screen and then we can use a Program called nano which is just a command line and text editor You can also use VI Vim if you're some lead hacker and you like them It may actually be better for me to kind of point you to Vim and start you off on that But I'll admit I use nano more than Vim. I'm a baby So nano and then that's the command line like command you want to run the program You're trying to invoke a file name can be passed as an argument So if you wanted to say Flag dot text just to keep track of that you can paste in the flag that you've got Because now you're inside nano this command line text editor tells you what file you're in it tells you whether or not you've changed the buffer and then it shows you some like actual commands you can use with the control modifier that up arrow that uh Kind of carried at the very start of this will notify like a control character Which may be like like the control key or the alt key. It may be different, but in this case, it's control I can use control O to write out like it said in the bottom file name to write We'll hit enter because we do want to save it as the current file name and then control X to exit just like that Cool. So LS now our flag dot text is in that directory We can CD up by using a period and another period to denote the parent directory So we move up the file structure. You can see my prompt change in the blue here. I'm no longer in pico CTF long I'm just in pico CTF in that directory cool So let's LS here see we have long and if you wanted to pass an LS tack a It'll show you all of the files here and that may be able to to see more hidden files that you wouldn't normally see in a regular Listing you'll see our folder here, but you'll also see other characters or other digits here I'm not digits, but a period right the period itself recurs to Refers to the current directory that you're in so CD period won't move you anywhere because that just means the Current directory and the dot-dot just as you saw before it means the parent directory So that is always displayed when you LS tack a you list everything the it'll Display the current directory and parent directory as the period and two periods So now that we have completed that long challenge. Let's mark it as complete. So I like to do that in the folder name I like to just change the name of the folder and rename it So you can do that in Linux with there's not particularly like a rename command But you can use the move command just to move it to the same location, but with a different name That's essentially renaming it. So if I move along again, I use tab to autocomplete to long Remove the trailing forward slash because it's trying to use that to denote that it's a directory I'll change it to complete Like mark with the underscore and capitalize complete. So now if I LS long complete We can go into that directory and we can cat the flag or display it out on the screen whenever we want to cool So we have saved our solution And if you wanted to we can take note of our solution without actually writing a get flag script. So use Python to multiply a string of the original character they wanted and then add on the single character and Then control O control X to save an exit and we should be good cool Let's go ahead and take this flag and go and submit it in Pico CTF down here at the very bottom submit and Awesome challenge solved you're up 20 points cool So I want to give a quick shout out and some love to the people that support me. I can't say this enough That's why I said at the end of every video Every everything that you give everything that you're willing to donate does help me grow help this channel grow And I'm really really grateful you're willing to go on this adventure with me one dollar a month on patreon We'll give you just shout out at the very end of the video just like this can't wait for number 10 $5 a month and we'll give you early access to what I upload on YouTube But before I release it because normally I'll record in bulk and maybe I'll let YouTube Gradually like on a day-by-day basis slowly make things go live if you want the content right away as soon as it's ready That's how you can do it Hey, thank you so much for watching guys if you did like the video Please do press that like button maybe leave me a comment if you're willing to subscribe and if you really want to check me out Support me head over to patreon. Thanks