 Hey everyone and welcome back to more Pico CTF getting started in cybersecurity capture flag and hacking So we just finished up another previous challenge the Piazza challenge It's a lot like an internet relay chat or slack channel for support now Let's move on to another kind of quick challenge 20 points here Before we get into some of the hardcore stuff like 50 challenges 50 or 40 point challenges, etc, etc So let's check out leaf of the tree. We found this annoyingly named directory tree starting at problems Blah blah blah blah blah it would be pretty lame to type all those out directory names But maybe there's something in there worth finding maybe we don't need to type out all those names Follow the trunk using cat and LS What hints tab completion is a wonderful wonderful thing. Okay, huh? So there are no links here There's nothing to particularly like click on or go to or go see just like in the either in the previous ones So I think we're back in the shell right back to this black box right over on the right-hand side so let's connect and this Directory thing this directory tree starting at blah blah blah Problems a lot of hex characters a lot of hex values. This is a folder in the file system So if I were to go to the shell, right? Let's zoom in a little bit so you can see this a little bit better We have a command prompt and I see I am at the till day here. So if I run PWD or a command to print working directory, it'll tell me I mean forward slash home Forward slash underscore underscore John Hammond. So that's me. That's my home directory but that looks kind of similar to this forward slash problems forward slash 10 0 f7 blah blah blah Because that is a directory or a folder or a location in the file system so in Linux and remember we're in Linux in this black box all of Folders in all directories and all paths are separated by these forward slats forward slashes you may be used to them in the windows like C colon backslash windows backslash System 32 blah blah blah they use backslashes in windows, but in Linux we care about forward slashes and really normally like shorthand quick and easy Path locations like my home directory forward slash home forward slash John Hammond is synonymous to my user profile or like my Documents folder in windows and that's normally like the C users John Hammond forward slash my space documents Blah blah blah, but this is just home my username. So it's home John on my home computer on my regular laptop so if I were to change directory or CD we can change directory to the Maybe the top level or the root directory the furthest back the furthest most Path or folder in the file system. So that forward slash is the very very tippy top of the of the tree the trunk here so LS they said to list things or to See what is available in the current directory that you're in in this case if I ran PWD again It'll tell me okay print working directory. My current working directory is the forward slash It's the root directory because I change directory there I see deed into that location and the prompt change correspondingly So you can see in that output when we try to list all the stuff you can see that problems Is in this directory and that makes sense right because it it builds off each other the forward slash forward slash problems blah blah blah if I were to CD into problems If I try an LS, oh, I can't read everything in there because there's some hidden files Probably write some some hidden directories that are maybe for for other users or for other people trying to play the game So but we've we've got this location. We got this big one. That's random seemingly So that's probably for our protection if we wanted to we could CD to that in a relative path Just like we've been doing into CD problems because that is the location relative to the root directory So now that we're in problems we can CD into paste from browser paste that in Cool now we're in that directory but if you wanted to use an absolute path rather than a relative path Let's say I hit CD with no parameters no arguments. Remember nothing following a space if I ran PWD I'm back in home But if I wanted to use an absolute path to get to that directory, I could just copy that whole thing and CD paste it in paste from browser and It knows where to go because we like specify the absolute path from the very very back of the file system from the root Directory we go all the way there now. Let's LS and see what we're doing. What we've got here Oh, okay trunk follow the trunk and using cat and LS. Okay, so let's CD into trunk LS Oh There's more let's CD to trunk D091 blah blah blah LS again. Oh geez it does this over and over and over again, right? Let's CD to trunk Bf10 LS. Oh goodness gracious Follow the trunk using cat and LS and they say use tab completion. What does that mean? So if I were to CD TR? Oh, if you hit tab, it'll autocomplete where you're moving. Let's zoom out here so you can see stuff Get one directory closer. I guess let's LS. Oh, I'm back in the trunk. I got another one there Let's tab autocomplete. I'll keep following the trunk Looks like there are a lot of branches, but the trunk is what they said to follow. So oh, oh, cool We've got flag that must be what we were looking for. Let's cat Cat is another command. And again, if you need help with any of these things, you can run man cat to check out the manual pages man and then the argument or the parameter is whatever command you want to learn more about So this is can catnate files and print them on the standard output. Oh, okay So print on the center output means go to your terminal screen. So cat Will normally put files together if you specify multiple files But if you only cat one file, all it does is it puts it out on center output. It prints it to the screen It dumps the contents of that file. So let's cat flag and Oh This looks a little messy But we can see a flag in here, right? Because the at that that username right here The two underscores are denoting my username and they made denote yours too at Web shell blah blah blah the prompt that we're in but everything up to the start of our username is the flag Because maybe there's just no new line character or something to denote that it's the end of the file No, like space following it, but we know that okay eight eight six three Whatever all these hex values hex because they go from zero through nine and then a through F Maybe that's a flag. Let's try and submit it Pace it in hit submit and yes, we did it challenge solve your up 20 points just like that Okay, cool. We can solve more challenges if we want to but let's again CD to get back to our home directory But I want to show you a little bit more because let's go take that prompt again. I want to Copy this path and I want to paste it in There's another command we could use and I want to get used to showing you these commands or more things you can do I hit control l just then to clear the screen and that will clear the buffer up to where we've what we've seen so far So if I hit control l that will clear the screen also typing in the command clear will do the same thing in Linux So another command we can run is called find You can check out the man page for it find search for files in a directory hierarchy So find will by default just list out all the files that it sees in the current directory And then it'll be recursive. It'll keep looking through more and more and more Files in all the other subfolders it will travel through all of the branches off of that original trunk And even keep following the trunk. It'll it'll go through all of them So hit Q to break out of that if I just run find no Arguments no parameters because it'll work in the current directory It'll work in this problems directory that we're in right now and it'll just list them out So find enter. Whoa looks like there's a lot of stuff here I'm gonna kind of follow this Over here looks like it shows all the trunks and then remember the forward slashes denote another Path or another folder so you can see flag here right over here Cool, and that must be the location. We were at so we can cat out that file if we wanted to cat We'll copy that cat and paste from browser Paste that in enter. We've got the same flag we had last time perfect and If you wanted to you could cd into any of these directories to change directory to get there But find it will at least just dump out all of the Subdirectories and recursively travel through the directories and folders in a given location If you wanted to you could do it in any directory or specify a directory as an argument again Check out the man page to see some of the other interesting and cool points You can do with that, but we did it. We solved leaf of the tree and now we can move on Let's see what else we can do, but before we get started with some of the other things Let's let's take a little adventure Let's try and get Linux set up on our own computer or a means that we can actually use a command line That's not just this shell. So cool. Thank you guys for watching Hey, I have to give a little shout-out to my supporters people that helped me out on patreon Spencer Clark Gal Horowitz Says okay Attila or Gal off the Unrelenting Troy World's Bachelors here Look, I may be butchering your name. So if I am please let me know I want to give you the love you deserve guys Thank you so much for supporting the channel. I'm so happy and flattered to know that you're willing to go on this adventure with me Hey, if you did like the video, please do leave a like If you'd like to have your name up here at the end of every video It's just $1 for patreon Maybe every month and $5 and more on patreon will get you early access to the videos that I record whenever they're ready Not when YouTube releases them because I normally release gradually And I record in bulk, but I will slowly release things on YouTube So if you want the content right when it's hot right when it's ready for your faces Just that's all $5 on patreon. Hey, if you're willing to maybe leave me a comment Let me know what you think what else you'd like to see what we can do better how else you solve this and If you're willing to subscribe if you really want to help me out check me out on patreon soon the next video guys We'll install Linux