Latest / CyberCode Academy / Course 27 - Hacking Web Applications, Penetration Testing, CTF | Episode 2: Linux Fundamentals and Command Injection Basics
Transcript
- 0:00Speaker 1: You know, there is this specific moment in almost every
- 0:04Speaker 1: tech thriller movie.
- 0:05Speaker 2: Oh, I know exactly what we're going to say, right.
- 0:07Speaker 1: The protagonist it's down at a computer. The screen is
- 0:10Speaker 1: totally black with just scrolling green texts, and they just
- 0:13Speaker 1: start typing at absolute lightning speed, no mouse.
- 0:16Speaker 2: No icons, just pure hacker mode.
- 0:19Speaker 1: Exactly, just pure rapid fire code. And for you know,
- 0:24Speaker 1: most people, that black screen the terminal is absolutely terrifying.
- 0:28Speaker 2: Well, it really is.
- 0:28Speaker 1: It feels like you've accidentally walked into the cockpit of
- 0:31Speaker 1: a jet midflight and you have no idea which a
- 0:34Speaker 1: button ejects the seat.
- 0:35Speaker 2: That is a great way to put it, But the
- 0:37Speaker 2: reality is that blinking cursor runs the world, the Internet, servers,
- 0:41Speaker 2: your Android phone, the entire backbone of modern cybersecurity.
- 0:46Speaker 1: It's all Linux, it is, and that's exactly why we're
- 0:48Speaker 1: doing this deep dive today. Avoiding the terminal is like
- 0:52Speaker 1: trying to be a mechanic who refuses to ever open
- 0:54Speaker 1: the hood of the car.
- 0:55Speaker 2: Sure you can drive it, you can fill it with gas,
- 0:57Speaker 2: but you can't fix it, and you certainly can't too
- 1:00Speaker 2: it for high performance.
- 1:01Speaker 1: Right, So our mission today is stripping away that intimidation factor.
- 1:05Speaker 1: We aren't just going to memorize a laundry list of commands.
- 1:08Speaker 2: No, we want to understand the actual logic behind the system,
- 1:11Speaker 2: the power moves that Cissimin's developers and hackers use to
- 1:16Speaker 2: navigate that black screen.
- 1:17Speaker 1: Because we want to take you, the listener, from you know,
- 1:21Speaker 1: just typing blindly and hoping for the best, to actually
- 1:24Speaker 1: understanding the conversation you're having with the operating system mastery.
- 1:28Speaker 2: The command line is really the closest you can get
- 1:31Speaker 2: to the machine's actual brain.
- 1:33Speaker 1: Now, before we get into the syntax, I have to
- 1:35Speaker 1: ask about the ecosystem. Because you hear about Ubuntu, Debian, Fedora,
- 1:40Speaker 1: Arch CentOS, and of course Kali Linux for the security crowd.
- 1:44Speaker 2: Right the flavors of Linux, it.
- 1:45Speaker 1: Feels like the Tower of Babbel Sometimes do these all
- 1:48Speaker 1: speak the same language? Or do I need to learn
- 1:50Speaker 1: ten different dialects.
- 1:52Speaker 2: That is probably the single most common misconcession out there.
- 1:55Speaker 2: People think if they learn Ubuntu, they won't understand Fedora.
- 1:59Speaker 2: But that's not true.
- 2:00Speaker 1: Really, they seem so different on the surface.
- 2:03Speaker 2: On the surface, yes, the paint job, the desktop environment,
- 2:06Speaker 2: the wallpaper, maybe this specific package manager that might change.
- 2:11Speaker 1: But the engine is identical, the engine being the kernel exactly.
- 2:15Speaker 2: They all run on the Linux kernel, and they all
- 2:18Speaker 2: follow something called the FAHS.
- 2:20Speaker 1: The File System Hierarchy Standard.
- 2:22Speaker 2: You got it. So, if you learn the structure we
- 2:24Speaker 2: were discussing today, you can sit down at a Callie
- 2:26Speaker 2: machine or a red Hat server and totally know your
- 2:29Speaker 2: way around. You were learning the universal grammar of Linux.
- 2:34Speaker 2: Once you know where the files live and how to
- 2:36Speaker 2: talk to them, the specific distribution doesn't really matter.
- 2:39Speaker 1: Well, that is a huge relief. Let's start with that grammar.
- 2:42Speaker 1: Then the lay of the land. In Windows. I'm super
- 2:44Speaker 1: used to C drives and D drives, but Linux doesn't
- 2:47Speaker 1: do drive letters.
- 2:48Speaker 2: That's it, No, it doesn't. In Linux, everything is a tree,
- 2:52Speaker 2: and like any tree, it starts at the root, the
- 2:54Speaker 2: root directory, right, and it's represented by just a single
- 2:57Speaker 2: forward slash. Every file, every directory, even your physical hard
- 3:01Speaker 2: drives themselves, they all hang off this one branch. It's
- 3:04Speaker 2: essentially an inverted tree structure.
- 3:06Speaker 1: So the root is the absolute anchor.
- 3:09Speaker 2: It's the anchor. Everything grows from that single forward slash. Now,
- 3:12Speaker 2: navigating this tree relies on two concepts that you really
- 3:16Speaker 2: have to internalize.
- 3:17Speaker 1: Absolute paths and relative.
- 3:19Speaker 2: Paths exactly break down absolute paths. First, think of an
- 3:22Speaker 2: absolute path as a GPS coordinate. It always always starts
- 3:28Speaker 2: with the root slash, so.
- 3:29Speaker 1: Like slash home, slash user, slash.
- 3:32Speaker 2: Documents perfect example, it doesn't matter where you are currently
- 3:35Speaker 2: standing in the system, that absolute address will always take
- 3:39Speaker 2: you to the exact same place because it describes the
- 3:42Speaker 2: full journey from the very root of the.
- 3:44Speaker 1: System, whereas a relative path is giving directions based on
- 3:47Speaker 1: where I'm standing.
- 3:48Speaker 2: Right now right It's like saying go back one room
- 3:50Speaker 2: in Lennox back or parent. Directory is represented by two dots,
- 3:54Speaker 2: just dot dot.
- 3:55Speaker 1: So if you type cdspace dot dot, you aren't telling
- 3:58Speaker 1: the computer a specific geographical location.
- 4:01Speaker 2: No, You're just saying take me up one level towards
- 4:03Speaker 2: the route.
- 4:04Speaker 1: That makes perfect sense. Absolute is the permanent address. Relative
- 4:07Speaker 1: is the immediate direction. So let's tour the neighborhoods of
- 4:09Speaker 1: this tree. If root is the city center, what are
- 4:12Speaker 1: the burrows?
- 4:13Speaker 2: The fahs defined some really critical ones you'll see constantly. First,
- 4:17Speaker 2: you have slash bin and slash spin.
- 4:19Speaker 1: Bin and s spin. They sound like twins.
- 4:22Speaker 2: They are definitely related. Bin stands for binaries. It holds
- 4:25Speaker 2: the essential user commands the programs that everyone uses, things
- 4:29Speaker 2: like LS to list files or creak to copy them.
- 4:33Speaker 1: Okay, and Slash spin.
- 4:35Speaker 2: The S stands for system. These are binaries, usually reserved
- 4:39Speaker 2: for the super ruser or the system administrator.
- 4:41Speaker 1: So bin is like the public library where everyone can
- 4:44Speaker 1: check out books, and spin is the restricted maintenance room.
- 4:46Speaker 2: Where only the building manager has the key. Exactly, got it.
- 4:50Speaker 1: Then there's slash boot, which I assume is just the
- 4:52Speaker 1: startup files.
- 4:53Speaker 2: It is. It contains the bootloader and the kernel itself.
- 4:56Speaker 2: Pro tip generally, don't touch anything in there unless.
- 4:59Speaker 1: You really know it you you're doing, or your computer
- 5:01Speaker 1: might not wake up next time you turn it on.
- 5:03Speaker 2: Yeah, you will have a very bad day.
- 5:05Speaker 1: Good advice. Now, the one that always trips people up
- 5:07Speaker 1: is slash dev ah.
- 5:09Speaker 2: Yes, dev stands for devices, and this leads us to
- 5:13Speaker 2: the ultimate Linux mantra.
- 5:14Speaker 1: Everything is a file.
- 5:16Speaker 2: Everything is a file.
- 5:17Speaker 1: Yeah.
- 5:17Speaker 2: In Windows, your mouse is a piece of hardware managed
- 5:20Speaker 2: by a driver wizard buried deep in the settings. In Linux,
- 5:23Speaker 2: your mouse is literally a file sitting right there in
- 5:26Speaker 2: the slash dev directory.
- 5:27Speaker 1: So my hard drive is a file. My webcam is
- 5:30Speaker 1: a file. All files, which means I can technically read
- 5:33Speaker 1: and write to my mouse just like I would a
- 5:35Speaker 1: standard text document.
- 5:36Speaker 2: Precisely, And that's why Linux is so incredibly powerful for
- 5:40Speaker 2: scripting and cybersecurity. You can pipe data directly into hardware
- 5:44Speaker 2: interfaces because the system treats them just like data streams.
- 5:47Speaker 1: You can literally copy your entire hard drive to a
- 5:50Speaker 1: file just by reading the device file.
- 5:51Speaker 2: Yep, it is wild, but it's brilliant.
- 5:54Speaker 1: Okay, moving on to slash et cetera. And no, it
- 5:57Speaker 1: is not where I buy handmade crafts.
- 5:58Speaker 2: Definitely not. Right. Etc is the nervous system of the machine.
- 6:02Speaker 2: It holds the host specific configuration files.
- 6:04Speaker 1: So if you need to change your DNS settings or
- 6:07Speaker 1: user permissions.
- 6:09Speaker 2: Or how a web server behaves, you are almost certainly
- 6:11Speaker 2: editing a text file inside slash etc.
- 6:14Speaker 1: And then we have the living quarters slash home and
- 6:17Speaker 1: Slash Root, and.
- 6:18Speaker 2: This distinction is vital for security. Slash Home is where
- 6:22Speaker 2: regular users live. If you log in as Alice, your files,
- 6:27Speaker 2: your downloads, your desktop, they are all in Slash Home
- 6:30Speaker 2: Slash Alice.
- 6:31Speaker 1: But the root user, the god mode administrator, they don't
- 6:34Speaker 1: mix with the commoners.
- 6:35Speaker 2: They do not. They have a penthouse suite simply called
- 6:38Speaker 2: slash rout.
- 6:39Speaker 1: So if I'm hacking around or maybe just auditing a system,
- 6:41Speaker 1: and I see I'm in slash home slash alice, I
- 6:44Speaker 1: know I'm just a standard user, right, but if I
- 6:46Speaker 1: land in slash root, I completely own the box exactly.
- 6:49Speaker 2: And finding your way from slash home to slash root
- 6:51Speaker 2: is usually the primary goal of any attacker privilege escalation.
- 6:55Speaker 1: Two other directories stood out to me before we move
- 6:57Speaker 1: on to commands, slash teamp and slash var.
- 7:01Speaker 2: Slash teap is the scratch pad temporary files. Crucially, on
- 7:05Speaker 2: most systems, this directory is completely cleared out every single
- 7:09Speaker 2: time you reboot. It's a volatile space.
- 7:11Speaker 1: Which I imagine makes it a favorite hiding spot for malware.
- 7:14Speaker 2: Oh absolutely, It's usually ritable by everyone, and the evidence
- 7:17Speaker 2: literally disappears if the server restarts.
- 7:19Speaker 1: Sneaky y and slash var.
- 7:21Speaker 2: Var stands for variable data. These are files that are
- 7:24Speaker 2: expected to grow and shrink dynamically. The most important thing
- 7:28Speaker 2: here for you to know is logs.
- 7:29Speaker 1: So if you're debugging why a server crashed or investigating
- 7:33Speaker 1: a break in, you.
- 7:34Speaker 2: Are heading straight to slash var slash log.
- 7:38Speaker 1: Okay, so that's the map we know the layout of
- 7:40Speaker 1: the city. Let's talk about actually driving the car, basic operations,
- 7:44Speaker 1: those to it. The very first thing I usually do
- 7:46Speaker 1: on a new Linux setup is update it. But I
- 7:48Speaker 1: always see people, especially beginners, confusing APT update and APT upgrade.
- 7:53Speaker 1: They sound like the exact same thing.
- 7:55Speaker 2: Huge distinction here and a very common rookie mistake. Assuming
- 7:59Speaker 2: we're talking about Debian based systems like Ubuntu or Collie.
- 8:03Speaker 2: App to update does not change your software.
- 8:05Speaker 1: It doesn't install anything nothing.
- 8:07Speaker 2: It just updates the list. It calls out to the
- 8:09Speaker 2: repository and ask Kati you have anything new. It just
- 8:11Speaker 2: downloads the catalog.
- 8:12Speaker 1: Oh, I see, it's checking the menu, not ordering the food.
- 8:15Speaker 2: That is the perfect analogy. App upgrade is actually ordering
- 8:19Speaker 2: the food. Upgrade downloads and installs the new versions based
- 8:22Speaker 2: on the list you just updated, so.
- 8:24Speaker 1: You almost always run them in a chain. Update first
- 8:27Speaker 1: to find out what's new, then upgrade to actually apply
- 8:29Speaker 1: it precisely.
- 8:30Speaker 2: Now, let's look at file manipulation. We have key for copy,
- 8:34Speaker 2: MV for move, but MV is also the rename command.
- 8:37Speaker 1: Yeah. That always felt so weird to me. Why isn't
- 8:40Speaker 1: there just a dedicated rename command.
- 8:41Speaker 2: It's actually very logical. If you think about the absolute
- 8:44Speaker 2: filepath we talked about earlier. How so, if I move
- 8:47Speaker 2: a file from slide home slash file dot txt to
- 8:51Speaker 2: slash home slash new name dot txt, I haven't changed
- 8:56Speaker 2: its physical location on the.
- 8:57Speaker 1: Disc, right, you just changed its label in the director structure.
- 9:00Speaker 2: Exactly to the filesystem itself. Renaming a file and moving
- 9:03Speaker 2: it to a new folder are essentially the exact same operation.
- 9:06Speaker 2: You are just changing the path string.
- 9:08Speaker 1: That makes a lot of sense when you put it
- 9:09Speaker 1: that way. And then there's the dangerous one dot RM
- 9:12Speaker 1: RM remove.
- 9:14Speaker 2: Listeners really need to tattoo this on their brain right now.
- 9:17Speaker 2: Linux has no recycle bin in the command line, none
- 9:20Speaker 2: at all. None. If you run rmimportant data dot txt,
- 9:25Speaker 2: it is gone. The space is marked as free immediately.
- 9:28Speaker 1: There's no are you sure pop up?
- 9:30Speaker 2: Not by default.
- 9:30Speaker 1: No.
- 9:31Speaker 2: You can add the dash I flag for interactive to
- 9:34Speaker 2: force it to ask you, but most pros just learn
- 9:37Speaker 2: to be very very careful, especially when using wildcards.
- 9:40Speaker 1: Speaking of wildcards and looking around, let's talk about l's
- 9:44Speaker 1: dash lists files. But typing just l's alone doesn't actually
- 9:48Speaker 1: tell you much.
- 9:48Speaker 2: No, you rarely use l's naked You want flags. L's
- 9:52Speaker 2: dash al gives you the long listing that's your permissions, ownership,
- 9:56Speaker 2: file size, date modified.
- 9:57Speaker 1: And l's dash ah shows all FI files, including the
- 10:00Speaker 1: hidden ones right.
- 10:01Speaker 2: And hidden files and Linux. Just start with a dot like.
- 10:04Speaker 1: Dot bash history or dot canfig files exactly.
- 10:07Speaker 2: If you don't use dash a, you're missing half the picture.
- 10:10Speaker 2: A lot of security checks actually fail simply because someone
- 10:12Speaker 2: forgot to look for the hidden files.
- 10:14Speaker 1: Add the dash ash flag too right for human readable
- 10:17Speaker 1: file sizes, so it says megabytes instead of just a
- 10:19Speaker 1: massive string of bytes.
- 10:20Speaker 2: Yes, dash ash is a life saver.
- 10:22Speaker 1: Let's move to the next segment. I call this the
- 10:24Speaker 1: detective kit. Say I've lost a file, or maybe I'm
- 10:27Speaker 1: an intruder looking for passwords. How do I find what
- 10:30Speaker 1: I need?
- 10:30Speaker 2: You have three main tools for this, effectively ranging from
- 10:34Speaker 2: a magnifying glass to a citywide drag net, Find, locate,
- 10:39Speaker 2: and grip.
- 10:39Speaker 1: Let's start with find.
- 10:41Speaker 2: Find is the heavy lifter. It crawls the directory structure
- 10:44Speaker 2: in real time. You tell it, start it root and
- 10:48Speaker 2: find anything named secret.
- 10:49Speaker 1: So it's extremely accurate.
- 10:51Speaker 2: Very accurate, but it can be slow because it's physically
- 10:55Speaker 2: checking every single directory on the drive right then and there.
- 10:58Speaker 1: And locate is the faster option.
- 11:00Speaker 2: Locate is practically instant, but it searches a pre built
- 11:03Speaker 2: index database. The catch is, if you created a file
- 11:05Speaker 2: ten seconds ago, locate won't.
- 11:07Speaker 1: Find it because the database hasn't updated yet exactly.
- 11:09Speaker 2: You usually have to run pseudo updated a guy first
- 11:12Speaker 2: to refresh that index if you're looking for something very recent.
- 11:14Speaker 1: So find is real time and thorough, Locate is cased
- 11:17Speaker 1: and fast. What about GREP? I feel like grep is
- 11:20Speaker 1: the command that gives people superpowers.
- 11:21Speaker 2: Grip is totally indispensable. While Find and locate look for
- 11:25Speaker 2: file names, grep looks for text inside the file.
- 11:28Speaker 1: So if I want to know if my username appears
- 11:30Speaker 1: anywhere in a giant log file.
- 11:32Speaker 2: You'd run rep your username, slash far slash logs slash cyslock.
- 11:36Speaker 2: It will filter thousands of lines in milliseconds and spit
- 11:39Speaker 2: out only the ones that match.
- 11:40Speaker 1: It's the ultimate filter.
- 11:41Speaker 2: It really is. You can search code for variables, search
- 11:44Speaker 2: logs for specific errors, search configs for IP addresses. It's endless.
- 11:49Speaker 2: Add dash in for line numbers, or dash c just
- 11:52Speaker 2: to count how many times a word appears.
- 11:54Speaker 1: Now, speaking of users and permissions, sometimes when you drop
- 11:57Speaker 1: into a shell. You need to know who you actually are.
- 12:00Speaker 2: Wooman very simple command. It just returns your current user name.
- 12:04Speaker 2: It seems basic, but when you are pivoting between accounts
- 12:08Speaker 2: or logged into remote servers, it is crucial to confirm
- 12:11Speaker 2: your identity.
- 12:11Speaker 1: And to change accounts.
- 12:12Speaker 2: We use sue switch user. Yeah, Sue Bob makes you Bob.
- 12:17Speaker 2: If you just type Sue with no name, it defaults
- 12:19Speaker 2: to trying to make you root.
- 12:20Speaker 1: But usually you don't want to fully log in as
- 12:22Speaker 1: another user, right, You just need their powers for one
- 12:25Speaker 1: specific task.
- 12:27Speaker 2: That is where Pseudo comes in. Super user do this
- 12:31Speaker 2: lets you execute just one single command with root privileges
- 12:34Speaker 2: without actually logging in as the root user.
- 12:37Speaker 1: It's like flashing a badge for one specific.
- 12:39Speaker 2: Entry exactly, and it's much safer because it leaves an
- 12:42Speaker 2: audit trail the system logs that you specifically use pseudo
- 12:45Speaker 2: to do something, rather than just having everyone share the
- 12:48Speaker 2: root password.
- 12:48Speaker 1: Let's talk about when things go wrong, a program crashes
- 12:52Speaker 1: or something is eating one hundred percent of your CPU.
- 12:55Speaker 1: How do we manage the chaos?
- 12:56Speaker 2: You need visibility first, that's PS process status. The standard
- 13:00Speaker 2: command everyone memorizes here is psh O.
- 13:03Speaker 1: Break that down. What does the AUX actually give us?
- 13:07Speaker 2: It shows processes for all users, including the user that
- 13:10Speaker 2: owns them, and even processes that aren't attached to a terminal.
- 13:14Speaker 1: That's the x SO, background services and demons.
- 13:16Speaker 2: Right. It gives you a complete snapshot everything running. And
- 13:19Speaker 2: most importantly, it gives you the PID or process ID.
- 13:22Speaker 1: And once we have that PID, we can kill it.
- 13:24Speaker 2: With a kill command. But here's where we get into
- 13:27Speaker 2: this secret sauce of Linux signals. You'll often hear veterans
- 13:30Speaker 2: sissed men say just kill nine.
- 13:32Speaker 1: It kill dash nine. It sounds pretty lethal.
- 13:35Speaker 2: It is. See, when you run kill, you're sending a
- 13:37Speaker 2: signal to the process. The default signal is fifteen, which
- 13:41Speaker 2: is sigterm.
- 13:42Speaker 1: And what does that do.
- 13:43Speaker 2: It's the plate kill. It basically taps the program on
- 13:45Speaker 2: the shoulder and says, hey, please save your work, clean
- 13:49Speaker 2: up your temporary files, and close down.
- 13:51Speaker 1: And the program can just ignore that.
- 13:53Speaker 2: It absolutely can. If it's frozen, hung, or just badly written,
- 13:58Speaker 2: it might just stare at you. Yeah, that is when
- 14:00Speaker 2: you use signal nine cigit kill the hard kill right.
- 14:03Speaker 2: This doesn't talk to the process at all. It talks
- 14:05Speaker 2: directly to the kernel. It says, discard this process immediately.
- 14:09Speaker 1: Wow. So the program gets no chance to save, no
- 14:12Speaker 1: chance to clean up. It just ceases to exist exactly.
- 14:15Speaker 2: So fifteen is appliight. Request nine is an absolute order
- 14:18Speaker 2: from the kernel. Use fifteen first, use nine when you
- 14:21Speaker 2: have no other choice.
- 14:23Speaker 1: We're in the home stretch here, and this is the
- 14:24Speaker 1: part I am most excited about advanced control operators, the
- 14:27Speaker 1: fun stuff. This is where we stop typing commands one
- 14:30Speaker 1: by one and start chaining them together like a programmer.
- 14:32Speaker 2: This is truly the difference between a standard user and
- 14:35Speaker 2: a power user. It's all about logic. Flow allows you
- 14:39Speaker 2: to build really complex workflows on a single line of text.
- 14:43Speaker 1: Let's walk through the symbols, starting with the semicolon.
- 14:45Speaker 2: The semicolon is just a simple separator. It basically means
- 14:49Speaker 2: do this, then do that. It doesn't care if the
- 14:52Speaker 2: first command worked or failed. It just blindly executes the
- 14:55Speaker 2: next one.
- 14:55Speaker 1: So like MK dear test semicolon CD test make the directory,
- 15:00Speaker 1: then move into it exactly. But sometimes you do care
- 15:02Speaker 1: if the first one worked. That's the double ampersan, right.
- 15:05Speaker 2: This is the logical A and D run command A
- 15:08Speaker 2: if and only if it succeeds, then run command B.
- 15:11Speaker 1: This is why we use it for updates, right appt update,
- 15:14Speaker 1: double ampersand APT upgrade exactly.
- 15:16Speaker 2: You don't want to try to install updates if the
- 15:18Speaker 2: initial download of the list failed. The double ampersand protects
- 15:22Speaker 2: you from that cascading error.
- 15:23Speaker 1: And what about the opposite, the double pipe.
- 15:25Speaker 2: That's the logical oar Run command A. If it fails,
- 15:28Speaker 2: then run command B. It's great for error handling.
- 15:31Speaker 1: Like trying to copy a file. Double pipe echo an
- 15:35Speaker 1: error message if it didn't work, spot on. And then
- 15:37Speaker 1: we have the most iconic Linux operator of all, the pipe,
- 15:40Speaker 1: just the single vertical bar.
- 15:42Speaker 2: The pipe is the glue of the entire Linux world.
- 15:45Speaker 2: It takes the output of the command on the left
- 15:47Speaker 2: and pushes it directly as the input to the command
- 15:50Speaker 2: on the right.
- 15:51Speaker 1: It lets you chain tools together. Give us a real
- 15:53Speaker 1: world scenario for the listener.
- 15:55Speaker 2: Okay, say you have a massive log file with ten
- 15:59Speaker 2: thousand and you want to see the last ten people
- 16:02Speaker 2: who failed to log in. Okay, you could cat the
- 16:05Speaker 2: file to read it, pipe it to g rep to
- 16:07Speaker 2: search for the word failure, and then pipe that output
- 16:10Speaker 2: to tail to catch just the last ten lines.
- 16:12Speaker 1: So cat pipep pipe tail. You're building a custom data
- 16:16Speaker 1: processing plant.
- 16:17Speaker 2: On the fly exactly, and you could do it in
- 16:19Speaker 2: seconds without writing a single line of actual code.
- 16:22Speaker 1: Now you mentioned earlier that understanding these operators is actually
- 16:26Speaker 1: a crucial security skill too.
- 16:28Speaker 2: Why is that because of something called command injection. Imagine
- 16:32Speaker 2: a website has a simple form where you enter your username.
- 16:35Speaker 2: The webserver might take that input and put it into
- 16:37Speaker 2: a system command to create a folder for you.
- 16:39Speaker 1: Okay, seems normal, But if.
- 16:40Speaker 2: The developer wasn't careful to sanitize that input, a hacker
- 16:43Speaker 2: could enter a username like admin, but then add a
- 16:46Speaker 2: semicolon and another.
- 16:48Speaker 1: Command like admin's semi colon woemie.
- 16:50Speaker 2: Right, the system reads Admin, finishes that command, seze the semicolon,
- 16:55Speaker 2: and then just executes womy oh wow.
- 16:57Speaker 1: And if the server replies with root, you know you've
- 17:00Speaker 1: completely compromised the system.
- 17:02Speaker 2: You just trick the server into running your arbitrary code
- 17:05Speaker 2: just by using basic Linux logic operators.
- 17:08Speaker 1: That is both terrifying and fascinating. It really highlights why
- 17:12Speaker 1: you can't just be a GUI user if you want
- 17:14Speaker 1: to understand cybersecurity, you really can't.
- 17:16Speaker 2: The command line is the truth of the system. If
- 17:19Speaker 2: you don't understand how the shell parses commands, you can't
- 17:21Speaker 2: secure the application.
- 17:23Speaker 1: All right, Before we wrap up, let's do a quick
- 17:25Speaker 1: pop quiz for you, the listener, based on what we
- 17:28Speaker 1: discussed today. Try to answer these in your head.
- 17:30Speaker 2: Let's do a rapid fire. Number one, how do you
- 17:33Speaker 2: teleport street back to your home directory or move up
- 17:36Speaker 2: one level without typing the full absolute path?
- 17:40Speaker 1: Number two, you need to find a file named temp
- 17:43Speaker 1: dot x and then delete it. What two commands would
- 17:46Speaker 1: you combine to do that safely?
- 17:48Speaker 2: Number three, you've popped a shell on a remote server.
- 17:51Speaker 2: What's the very first command you run to see exactly
- 17:53Speaker 2: which user permissions you have? And?
- 17:55Speaker 1: Number four, you have a Chrome process that is frozen
- 17:59Speaker 1: solid is completely ignoring the polite kill signal. What is
- 18:03Speaker 1: the specific hard kill signal number you send to the kernel.
- 18:07Speaker 2: If you can answer those, you are already way ahead
- 18:10Speaker 2: of most people starting out in tech.
- 18:11Speaker 1: It has been an incredible refresher. The terminal definitely feels
- 18:14Speaker 1: a little less like a cockpit with no manual.
- 18:16Speaker 2: Now, just remember you can't break the physical hardware with
- 18:19Speaker 2: a command, well mostly, so don't be afraid to open
- 18:22Speaker 2: it up, types l's d A and see what's actually
- 18:25Speaker 2: hidden in there.
- 18:26Speaker 1: That's it for this deep dive. Thanks for listening, and
- 18:28Speaker 1: keep exploring Happy coding.