Transcript for:
Essential Linux Skills for Hackers

If you wanna become a hacker, you need to know Linux. It's a required foundational skill. It's actually a prerequisite to doing anything in hacking. Like you have to know it. So that's why in this series, I'm gonna teach you Linux.

Welcome to my Linux for Hackers series. Now while the series is Linux for hackers, most of what I'm covering is Linux for everyone. And I do mean everyone, if you're in it or anything, you need to learn and know Linux.

This series will teach you the Linux foundations you need to start hacking. And we're not going to waste any time. Like you're going to start using Linux right now. I'm not kidding. Like right this moment in your browser, check the link in the description, you're getting access to a free Linux lab.

Thanks to my partnership with hack the box Academy. They're actually the official sponsor of this entire series. So let's go, let's get you using Linux right now. And by the way, I'm having my two oldest daughters do the same thing.

You ready to start hacking? Cool. You ready to start hacking? Sure.

They are 10 and seven. They're signing up for hack the box Academy. So if you're thinking, man, I can't learn Linux. That's too hard. Bullcrap.

Yes, you can. Let's go right now. So once you click the link and you signed up, which by the way you should, this entire series will use this lab.

So do it. You can go through the introduction or just click skip like I am no big deal. Now notice one thing real quick, right under your username, you'll have 30 of whatever the junk that is.

Those are cubes. Cubes are through what you need to unlock whatever course you wanna take through hack the box academy. You can also purchase more, but Hey, we've already got 30. We're good. So next click on modules and then all modules.

I'm gonna scroll down just a bit until I see Linux fundamentals right here. It costs 10 cubes. We got 30. 30, we're good. We're gonna click on unlock, but real quick, before you do that, notice this right here. What this plus 10 means is that if we finish this Linux fundamentals course, like we actually complete it, hack the box academy will give us 10 cubes back.

So it's basically free. As long as you do it, which you're going to, right? Not a big deal. So let's click on, click on unlock. Yes.

Let's do this thing and let's not waste any time. Let's click on start right now. And on this page, what we're gonna do is scroll all the way to the very, very bottom, all the way here until you see this, your workstation. This is your Linux box.

Let's go ahead and click on start, start instance, coffee break. Perfect time. It's good stuff. What are you drinking today? Let me know in the comments.

And it's ready. And this is pretty cool. Watch this. All you gotta do is click interact and it's going to launch the sucker in your browser. Click go.

So here we go. Your very own Linux machine, your playground. Hack the box will call this your pwn box.

And I love that. So now that we're here inside our Linux box, we're going to accomplish two things first. What is this? I understand this may be your first time ever using Linux. You might be wondering, what do I do?

I don't even know what this is. We'll cover that. And then two, we're going to start using it right now. I'm going to get you started with your first Linux terminal commands and I'll cover what that means. So first what the junk is this?

So this computer you're using right now here in your browser, which is crazy. This is Linux, but to be specific and technical, this is actually a distribution of Linux called parrot OS, which is an operating system built for hacking. Now the OS and parrot OS stands for operating system like windows, Mac OS, iOS, Android.

It's the software that we that we interact with to make our computer do things. So if someone were to ask you, hey, what operating system are you running right now? It would be Parrot OS. And Parrot OS is using Linux, and more specifically, the Linux kernel.

And I wanted to point that out because Linux is technically not an operating system. Linux is a kernel. And we build operating systems on top of it. So Parrot OS is not the only flavor or distribution of Linux.

There'll be Kali Linux, Ubuntu, CentOS, Debian, and they'll all use a version of the Linux kernel, which is actually part of the OS, but it's not. It's not the OS. Now what does the Linux kernel do?

It has a very important job. It interfaces with our hardware, CPU, Ram, hard drive, et cetera. When we, as the hacker wants to run our favorite, hacking tool, let's say in map or something. We tell parrot OS click, let's run in map pair of OS.

We'll say, Hey, Linux kernel, can we get some hardware resources here? Can you tell them and the Linux kernel gets the hardware resources set up. He's kind of the middleman between the application, the OS and the hardware.

But to simplify things, we just call it. about Linux and we say, what flavor of Linux? And we say, well, parrot OS.

Now the bigger question might be why Linux? I mean, we got windows, we got Mac OS what's wrong with those guys? Well, nothing and everything. You see what's great about Linux. I'll explain what's great about Linux is that it's open source, which means a lot, but it basically means that it's open and free to use and redistribute.

So people can make awesome distributions like parrot OS. The other benefit of Linux is that it's traditionally faster and more secure. which is why most websites and servers in the world use Linux as their operating system. And it's also why hackers use Linux. Most of the hacking tools out there are Linux based.

So that's what Linux is and this is why we use it. But now how do we use it? That's a more interesting question because you might be looking at this screen here, your computer desktop, and you may be thinking, wow, I didn't know Linux had a pretty gooey like this, a graphical user interface.

icons and a dock and menus and stuff like that's cool. And you can use Linux like this, but it wasn't meant to be used like this. So slow down. To truly wield the power of Linux, you don't use GUI. You're gonna use the Linux terminal, the command line, this guy right here.

Go ahead and click on that. I can't tell if that's green or yellow, I'm colorblind, but go ahead and click on that icon there. This is the Linux terminal, and this is how you are supposed to use Linux.

Now, if you're coming from the GUI only world, where all you use is a graphical user interface. This might seem a little scary. I totally get it, but don't worry. We're gonna walk through this.

We're gonna teach you a few commands here. I'm gonna slowly wean you off the graphical user interface. I'll pull it up side by side. Actually, watch, here we go. We're gonna teach you your first few commands.

So follow along with me. Go ahead and have your Linux terminal open and also at the same time, open up your home directory right here. Double click that sucker, double click.

I'm gonna teach you your first few commands by doing something here in the GUI and then doing that same thing here in the Linux terminal. Now here's the first thing. What I love about the GUI is that you always kind of know where you are, right?

Because you can see it right now. I'm in my user directory, my home directory, because I can see it right there. And there's all my stuff now over here. I don't see anything.

How do I know where I am? We're going to solve that. Our first command type it in with me right now.

Three letters, P W D P W D stands for print working directory. And it basically does what we see here and here. It tells us where we're at.

Hey, where am I? Oh, I'm right here. Let's try it out.

Go ahead and hit enter. Bam. It shows us the full path of where we are right now, the home directory.

And then even further in drilling down our user directory. So right now we're actually in the same spot as our GUI, same location. Okay, cool.

We know where we are, but we still don't see the same stuff in our GUI. Like right now where I'm at, I can actually see my, my desktop and templates and documents, folders and downloads folders. I don't see that here.

How do I see that next command type it with me? It's going to be our L S command L S L S stands for list. And it's pretty simple what it does.

It'll simply list the contents of your current working directory. It's gonna list what we see right here. You wanna see let's do it. Go ahead and hit enter and boom.

It did it. Everything we see here, desktop downloads, templates, documents, postman is also right here. See you can do anything in the terminal and it's faster. I'll convince you.

Don't worry. Let's keep going. Let's say we wanna take a peek inside of our desktop folder right here in the GUI.

I know I can just click on that folder, double click. Jump in there and I can see my stuff. How do we do that? And in the terminal, our next command, here we go. The command is C D very simple.

CD stands for change directory, and it's going to do exactly what we just did here. Watch let's do it right now. Just after CD, I'll hit space and then tell it what directory I want to go to. Let's go to desktop.

So I'll type in desktop and go. Oh, did it work? I don't know.

Let's let's see. Let's print our working directory. P WD. Let's see if we actually changed to that directory. We did.

There's a current working directory and we did indeed drill down right into the desktop folder. And then to see what's on our desktop, as we can see in the GUI, we'll just simply type in LS to list the contents. Bam.

There it all is. Right there. Now we're going to learn one more command.

So hang with me, but so far we've done a lot. The PWD command to see where we are, the LS command to see what's around us, what's in our directory and the CD command. to change where we are, but now how do we go back?

Because like in the GUI here, it's pretty intuitive. We got a back button up here. We just go back. And suddenly we're back to our directory.

We started it, our home directory. How do we do that same thing over here in the terminal? It's actually super easy.

So again, we're going to type in CD. We're going to change our directory because we actually are changing our directory and then we'll do a space. And all we're going to put in is dot dot. So CD space, dot dot hit enter. And let's see what happens.

Boom. What happened? Let's type in PWD and see if it changed our directory. Totally did. So again, we were in home user eight, nine, seven, eight, six desktop.

We entered the CD command with dot dot, and that dropped us back to home user eight, nine, seven, eight, six. Now just for fun, I wonder what will happen if we keep going backwards. If we type in CD dot dot again, I type in PWD where am I at? I'm at slash home now.

Let's do CD once more. Where am I at now? PWD.

Ooh, now instead of home, I'm simply at forward slash. And what this is, is actually the root of the file system. It's the end.

We reached the end. And we'll talk more about that later. But just for fun, again, it's all for fun.

Right here, enter the command LS. Let's list the contents of the root directory. Huh?

A lot of interesting files here. We'll talk about all this later. Now real quick quiz for you. Let's see what you remember right now.

Again, if I print my working directory, PWD, I'm at the root forward slash, what command or commands would I enter to get back? Here, where we were to start with. Now, there are two options, really. You can do it with one command, or you can do it with two commands. Comment below with what you got.

Now, here, we just scratched the surface. We're going deeper into Linux. We're gonna get you prepped and ready to become a hacker, but don't let that diminish the fact that you did a lot today in this video, we covered what Linux is. It's both a kernel and an operating system, similar to windows and Mac, but it's faster, more powerful and more secure, and way more popular. It wins that contest hands down, especially with hackers.

We love it. And we also covered some Linux terminal commands. We started to move away from the GUI weaning ourselves of the GUI and started typing away PWD L S C D more to come.

And again, massive shout out to the spa. sponsor of the series hack the box academy, hack the box academy, which is obviously tied to hack the box. It's different in that it's more of a guided it security platform.

And by the way, all the commands I mentioned in this video will be covered in depth on hack the box academy. And of course, don't forget to hack the YouTube algorithm today. Hit that like button subscribe notification bell comment.

Let's hack YouTube. Ethically of course. Yeah, that's all I got. I'll catch you guys next time.