Latest / CyberSecurity Summary / Learn Ethical Hacking from Scratch: Your stepping stone to penetration testing
Transcript
- 0:00Speaker 1: Have you ever wondered what truly goes on behind the
- 0:03Speaker 1: digital curtain? How the very best defenders learn to think
- 0:06Speaker 1: like whoa malicious actors all to keep our online world safer. Today,
- 0:11Speaker 1: we're taking a deep dive into the fascinating realm of
- 0:14Speaker 1: ethical hacking and penetration testing. Our mission to unpack the
- 0:18Speaker 1: core concepts, the practical techniques, and the essential tools that
- 0:22Speaker 1: empower individuals to understand and secure digital systems from the
- 0:26Speaker 1: inside out.
- 0:27Speaker 2: Really yeah, and our guide for this journey is the
- 0:30Speaker 2: comprehensive book Learn Ethical Hacking from Scratch by Zaid Sabi.
- 0:34Speaker 2: What's great is that this resource assumes no prior knowledge.
- 0:37Speaker 2: It offers a truly ground up approach, which makes it
- 0:40Speaker 2: perfect for our exploration today.
- 0:41Speaker 1: Absolutely so, whether you're simply curious about cybersecurity, maybe looking
- 0:45Speaker 1: to fortify your own digital defenses, or just love to
- 0:48Speaker 1: understand how things work at the deepest level, this deep
- 0:51Speaker 1: dive will give you a shortcut to being well informed
- 0:54Speaker 1: and honestly with some truly surprising facts along the way.
- 0:58Speaker 1: Get ready for some illuminating in sites, because we're about
- 1:01Speaker 1: to unpack how ethical hackers learn to protect systems by
- 1:05Speaker 1: understanding how to test their security just like well, real
- 1:08Speaker 1: attackers do. Okay, So the term ethical hacking it almost
- 1:11Speaker 1: sounds like an oxymoron to some people. Could you really
- 1:14Speaker 1: break down for us how hacking can truly be ethical
- 1:17Speaker 1: and what that critical distinction means, especially when we talk
- 1:19Speaker 1: about black hat versus white hat hackers.
- 1:22Speaker 2: Absolutely, it's a good question. At its core, ethical hacking
- 1:25Speaker 2: is about learning to test the security of systems exactly
- 1:29Speaker 2: as real attackers would. But and this is key, with
- 1:32Speaker 2: explicit permission. Always it's all in the service of strengthening
- 1:37Speaker 2: those systems, finding the holes before the bad guys do.
- 1:39Speaker 2: To critical distinction, so we differentiate between black hat hackers
- 1:43Speaker 2: who operate maliciously, you know, for criminal gain or disruption.
- 1:47Speaker 2: Then there are gray hat hackers who kind of blur
- 1:49Speaker 2: the lines, sometimes maybe finding a flaw and disclosing it,
- 1:52Speaker 2: but maybe not always with permission first. And then white
- 1:54Speaker 2: hat hackers, the ethical professionals we're focusing on today. Their
- 1:57Speaker 2: intent is always to secure.
- 1:59Speaker 1: Right, good guys using the same skills exactly.
- 2:02Speaker 2: Yeah, and this raises an important question. Yeah, why should
- 2:05Speaker 2: you listening right now learn about hacking even if you
- 2:09Speaker 2: never intend to be a penetration tester. The fundamental reason
- 2:12Speaker 2: is to truly understand vulnerabilities, you need to know how
- 2:16Speaker 2: things break to build stronger, more resilient defenses. The book
- 2:21Speaker 2: highlights a crucial point here. Any electronic device you interact with,
- 2:24Speaker 2: your phone, your smart TV, your laptop, even web servers
- 2:27Speaker 2: and routers, Yeah, they're all at their heart computers running
- 2:31Speaker 2: operating systems and programs h as. The concepts we're discussing
- 2:35Speaker 2: today are broadly applicable to pretty much anything in your
- 2:38Speaker 2: digital life.
- 2:39Speaker 1: One aspect that really opened my eyes when exploring this
- 2:41Speaker 1: was the absolute necessity of a dedicated lab environment. You
- 2:45Speaker 1: can't just go testing these techniques out on like your
- 2:48Speaker 1: neighbor's WiFi.
- 2:49Speaker 2: Right, Definitely not. That's illegal and unethical. This is where
- 2:52Speaker 2: virtual box comes in. It's a program, it's free, and
- 2:54Speaker 2: allows you to install virtual machines. Think of them as
- 2:57Speaker 2: completely separate, isolated computers inside your main machine. This is
- 3:01Speaker 2: incredibly important for penetration testing because well, first it avoids
- 3:06Speaker 2: needing multiple physical computers, save space and money. And second,
- 3:10Speaker 2: it completely isolates your hacking activities from your main system,
- 3:14Speaker 2: so you can experiment break things, really push the limits.
- 3:18Speaker 1: Without damaging your actual computer.
- 3:20Speaker 2: Exactly, and then you can easily revert back if something
- 3:22Speaker 2: goes wrong, no harm done to your primary setup.
- 3:25Speaker 1: So what does this typical lab look like? What machines
- 3:28Speaker 1: are we talking about?
- 3:29Speaker 2: Yeah? In a typical setup, we work with three main
- 3:31Speaker 2: virtual machines. First, our tacker machine. This usually runs Collie.
- 3:35Speaker 1: Linux Collie, right, I've heard of that.
- 3:37Speaker 2: Yeah. Collie is a specialized distribution of Linux based on Debian.
- 3:41Speaker 2: It comes pre installed with i mean pretty much all
- 3:43Speaker 2: the necessary penetration testing tools you'd need. Running it as
- 3:47Speaker 2: a virtual machine is ideal for isolation, like we said,
- 3:50Speaker 2: and makes it super easy to recover if things go sideways.
- 3:53Speaker 1: Okay, attacker machine Collie. What else?
- 3:56Speaker 2: Then we need victims. Our first victim is usually metasploid.
- 4:00Speaker 2: It's another Linux machine. But here's the crucial detail. It's
- 4:03Speaker 2: designed to be highly.
- 4:04Speaker 1: Vulnerable, ah intentionally weak.
- 4:07Speaker 2: Precisely, it's built specifically for learning penetration testing. It has
- 4:12Speaker 2: numerous known weaknesses built right in for you to practice
- 4:15Speaker 2: finding and exploiting.
- 4:16Speaker 1: Got it, and the second victim.
- 4:18Speaker 2: The second victim is usually a standard Windows machine, maybe
- 4:22Speaker 2: Windows ten or something similar. This is used for scenarios
- 4:25Speaker 2: that mimic a normal user browsing the internet, clicking links,
- 4:29Speaker 2: opening files.
- 4:30Speaker 1: Makes sense simulating a realistic target exactly.
- 4:33Speaker 2: And Microsoft actually offers free virtual machine versions for developers
- 4:38Speaker 2: and testers, which is really convenient for setting up these
- 4:40Speaker 2: realistic attack simulations.
- 4:42Speaker 1: Okay, attacker two victims. What about that recovery feature you
- 4:45Speaker 1: mentioned right.
- 4:46Speaker 2: That's snapshots a core feature of Virtual Box. It becomes
- 4:49Speaker 2: absolutely invaluable. Think of snapshots like instant bookmarks for your
- 4:53Speaker 2: virtual machine.
- 4:54Speaker 1: State, like a safe point in a game, kind of
- 4:56Speaker 1: like that.
- 4:56Speaker 2: Yeah, they allow you to save the exact state of
- 4:59Speaker 2: a virtual machine at any point in time. So let's
- 5:02Speaker 2: say you're trying to exploit and you completely mess up
- 5:04Speaker 2: the victim machine, maybe crash the operating system or something.
- 5:07Speaker 2: If you took a snapshot beforehand, you can instantly revert
- 5:11Speaker 2: right back to that previous working state.
- 5:14Speaker 1: Wow, Okay, that sounds essential for learning It really is.
- 5:18Speaker 2: A common practice is to take a fresh install snapshot
- 5:21Speaker 2: right after setting everything up. Then if an update breaks
- 5:24Speaker 2: something or an experiment goes totally wrong, boom, You're back
- 5:28Speaker 2: to that clean slate in seconds, ready to try again,
- 5:31Speaker 2: no reinstalling needed.
- 5:32Speaker 1: Okay, that makes setting up a lab feel much less daunting. Now,
- 5:35Speaker 1: Collie Linux, I know it has a graphical interface, but
- 5:38Speaker 1: I hear you quickly move past that.
- 5:40Speaker 2: Yeah, Collie has a nice graphical interface. GUI looks familiar
- 5:43Speaker 2: like Windows or macOS. But you're right, you quickly pitt
- 5:46Speaker 2: to the terminal the command line.
- 5:48Speaker 1: Why is that? Why is the terminal so central?
- 5:50Speaker 2: Well, the Linux terminal is just incredibly powerful. It lets
- 5:53Speaker 2: users do far more than the GUI in many cases,
- 5:56Speaker 2: and often it's much easier and quicker for specific tasks
- 6:00Speaker 2: once you.
- 6:00Speaker 1: Get the hang of it, faster than clicking around definitely
- 6:02Speaker 1: for many things.
- 6:03Speaker 2: But more importantly, in many real world penetration tests, you
- 6:08Speaker 2: might only gain access via command prompt on the target,
- 6:11Speaker 2: may through SSH or some other remote shell. If you
- 6:14Speaker 2: don't know the commands, you can't do anything. So mastering
- 6:17Speaker 2: the terminal is absolutely essential for controlling compromise systems effectively.
- 6:21Speaker 1: Makes sense. So what are some basic commands people should know?
- 6:24Speaker 2: Let's touch on a few foundational ones. The al's command,
- 6:27Speaker 2: for instance, it lists files and.
- 6:29Speaker 1: Directories like Dirt and Windows.
- 6:32Speaker 2: Exactly like Dirt and Windows, and you can add options
- 6:35Speaker 2: like ls L gives you a long listing with more detail, permissions, dates, file, sizes, etc.
- 6:41Speaker 2: If you're ever unsure about any command, man which stands
- 6:44Speaker 2: for manual, or just adding help or ad H after
- 6:46Speaker 2: the command, those are your best friends.
- 6:48Speaker 1: Ah built in help yep, they'll.
- 6:50Speaker 2: Give you comprehensive information on how to use almost any command.
- 6:53Speaker 2: It's a critical earning tool and a huge time saver.
- 6:56Speaker 2: Almost a reflex for experienced users is the tab button
- 7:00Speaker 2: for what for autocompletion? Start typing a command or a
- 7:04Speaker 2: file name, Hit tab and the system will try to
- 7:06Speaker 2: complete it for you or show you the possibilities if
- 7:09Speaker 2: there's more than one.
- 7:09Speaker 1: Oh. Nice safe typing and avoids typos.
- 7:12Speaker 2: Huge time saver. Yeah, makes complex commands feel much more intuitive.
- 7:16Speaker 2: Then there's CD for changing directories navigating around the filesystem,
- 7:20Speaker 2: and PUD prints your current working directory so you know
- 7:23Speaker 2: where you are. We also use app to get or
- 7:26Speaker 2: just appt now. Usually that's for managing software, updating the
- 7:29Speaker 2: list of available software, installing new programs, upgrading existing ones.
- 7:33Speaker 2: Keeps your COLLY set.
- 7:34Speaker 1: Up fresh, got it basics covered? Lab set up understood?
- 7:38Speaker 1: Where do we go first?
- 7:39Speaker 2: Okay, with our virtual lab ready, The first frontier and
- 7:42Speaker 2: ethical hacker typically explores is the network itself. You know,
- 7:45Speaker 2: the invisible pathways connecting all our devices. Network penetration testing
- 7:49Speaker 2: could be broadly divided into let's say four main sections.
- 7:53Speaker 2: There's pre connection stuff you do before even connecting, then
- 7:56Speaker 2: gaining access, then post connection what you do once you
- 8:00Speaker 2: are in, and finally detection and security aspects.
- 8:03Speaker 1: Okay, logical steps, and we're starting with wireless.
- 8:05Speaker 2: Yeah, let's focus on wireless networks initially. To start cracking
- 8:09Speaker 2: Wi Fi, you'll first need to get your wireless adapter
- 8:11Speaker 2: properly connected and configured inside your Colli Virtual Machine.
- 8:15Speaker 1: How does that work? The VM is software, the adapter
- 8:18Speaker 1: is hardware.
- 8:18Speaker 2: Good point. This often requires installing the Virtual Box Extension
- 8:22Speaker 2: pack first that enables better USB device support. Then you
- 8:27Speaker 2: can essentially pass through your physical USB Wi Fi adapter
- 8:31Speaker 2: to the COLLIVM so Collie can see it and control
- 8:34Speaker 2: it directly. Not all adapters work well for this, mind you,
- 8:37Speaker 2: some are better than others for hacking.
- 8:39Speaker 1: Okay, so you need the right hardware and setup. Now.
- 8:41Speaker 1: Something fundamental about networks is MSS addresses. You mentioned them earlier.
- 8:45Speaker 1: Every network card has this unique physical static media access
- 8:49Speaker 1: control address right assigned by the manufacturer. Why is the
- 8:52Speaker 1: static identify or important?
- 8:54Speaker 2: Here it's fundamental because MIC addresses are used for device
- 8:58Speaker 2: identification and packet transfer at the very lowest level of
- 9:01Speaker 2: the local network layer two for the technical folks. But
- 9:04Speaker 2: here's the kicker, the surprising part for many. You can
- 9:07Speaker 2: change your MSSEA.
- 9:08Speaker 1: You can change a physical address.
- 9:10Speaker 2: Well, you change what your operating system reports as your
- 9:13Speaker 2: Mac address. It's called spoofing. This allows you to do
- 9:17Speaker 2: a couple of things. You can avoid being easily traced
- 9:20Speaker 2: while performing tests, making your activity less obvious. Or you
- 9:24Speaker 2: could potentially impersonate a legitimate white listed device on a network,
- 9:28Speaker 2: maybe a printer or an authorized laptop to bypass MAAC
- 9:33Speaker 2: filtering security and gain access.
- 9:35Speaker 1: Wow. Okay, so even fundamental identifiers aren't always fixed. That's insightful.
- 9:40Speaker 2: It highlights that many things we assume are fixed in
- 9:42Speaker 2: networking can actually be manipulated.
- 9:44Speaker 1: Okay, so we understand how devices identify themselves and that
- 9:47Speaker 1: we can even spoof that. What's the next step? Listening
- 9:50Speaker 1: in exactly?
- 9:51Speaker 2: The next logical step is to actually listen in on
- 9:54Speaker 2: the digital conversations happening on the airwaves around you, even
- 9:57Speaker 2: if you're not part of the chat. This is packets new.
- 10:00Speaker 1: How do you do that with Wi Fi, you need
- 10:02Speaker 1: to put.
- 10:02Speaker 2: Your Wi Fi card into what's called monitor mode. Normal
- 10:06Speaker 2: Wi Fi mode only pays attention to trafficman for your
- 10:08Speaker 2: device or the network you're connected to. Monitor mode is different.
- 10:12Speaker 2: It allows you to capture any compatible Wi Fi packet
- 10:15Speaker 2: within your physical range, regardless of who it's for, even
- 10:18Speaker 2: if you're not connected to any network at all, like.
- 10:21Speaker 1: A radio scanner for Wi Fi signals.
- 10:23Speaker 2: That's a great analogy. Yeah, And a powerful tool for
- 10:25Speaker 2: this is aero dumping. It's part of the popular air
- 10:28Speaker 2: cracking suite. You're run aero dumping and it starts capturing
- 10:31Speaker 2: all the packets at seas, showing you all the Wi
- 10:33Speaker 2: Fi networks around you, their names, esds, their hardware addresses, bssids,
- 10:39Speaker 2: the channel thereon, the type of encryption they're using, lots
- 10:43Speaker 2: of useful info.
- 10:44Speaker 1: And what do you do with all those captured packets.
- 10:46Speaker 2: Well, aero dumping captures them, often saving them to a file.
- 10:49Speaker 2: Then you can use another tool like the incredibly powerful
- 10:51Speaker 2: wire shark to open that file and analyze the packets
- 10:54Speaker 2: in detail.
- 10:55Speaker 1: Wire Shark that sounds familiar.
- 10:57Speaker 2: It's a standard tool for a network analysis used by
- 11:00Speaker 2: network admins. And security pros alike. It gives you a
- 11:03Speaker 2: graphical view of every single packet, lets you filter, search,
- 11:06Speaker 2: and dissect the traffic, even if the data payload is encrypted.
- 11:10Speaker 2: Just seeing the patterns of communication can sometimes be revealing.
- 11:14Speaker 1: So we can listen. Can we also actively disrupt things?
- 11:18Speaker 1: I read about diuthentication attacks? What are those?
- 11:20Speaker 2: Yes? Absolutely? De Authentication attacks are interesting. They allow you
- 11:24Speaker 2: to selectively disconnect specific devices, or even all devices from
- 11:29Speaker 2: a Wi Fi network. You do this by sending specially
- 11:32Speaker 2: crafted authentication packets that look like they came from the
- 11:35Speaker 2: access point. The router telling the target device you're no
- 11:38Speaker 2: longer authorized, please.
- 11:39Speaker 1: Disconnect, and the device just disconnects.
- 11:42Speaker 2: Usually yes, it obeys the command. Now, this isn't about
- 11:44Speaker 2: gaining access to the network's data yourself. It's purely about disruption.
- 11:48Speaker 2: Or sometimes it's used tactically, as we'll see later.
- 11:51Speaker 1: Okay, disruption. What about tricking people fake networks?
- 11:54Speaker 2: Ah? Yes? Building on that, we learn about setting up
- 11:57Speaker 2: fake access points, often called evil to wins. This involves
- 12:01Speaker 2: creating a rogue Wi Fi network, maybe with the same
- 12:04Speaker 2: name as a legitimate nearby network like airport free Wi
- 12:08Speaker 2: Fi or coffee shop Guests.
- 12:10Speaker 1: To lure people into connecting to your network instead of
- 12:13Speaker 1: the real one.
- 12:13Speaker 2: Precisely, you trick users into connecting, and when they do,
- 12:17Speaker 2: all their Internet traffic flows directly through your Collie machine.
- 12:20Speaker 2: You effectively become their router. Tools like the Manna toolkit
- 12:25Speaker 2: used to be popular for automating this, making it easier
- 12:27Speaker 2: to set up sophisticated fake aps.
- 12:29Speaker 1: And once you're their router.
- 12:31Speaker 2: Once you're the man in the metal, you can capture
- 12:33Speaker 2: and analyze all their unencrypted traffic. Using wire Shark, you
- 12:36Speaker 2: can see websites they visit, maybe capture credentials entered on
- 12:39Speaker 2: insecure sites. It gives you a lot of visibility into
- 12:42Speaker 2: their activity.
- 12:43Speaker 1: That sounds incredibly powerful and quite scary from a user perspective.
- 12:47Speaker 2: It is. It highlights the danger of connecting to unknown
- 12:50Speaker 2: or unsecured Wi Fi networks.
- 12:52Speaker 1: Okay, so disruption observation. Let's talk about actually gaining access
- 12:57Speaker 1: to encrypted networks. Most networks today use WPA two, maybe
- 13:01Speaker 1: WPA three. Now, how do you get the password right?
- 13:04Speaker 2: Getting the key is the main goal for accessing recruited networks.
- 13:07Speaker 2: The strategy depends on the encryption type. For the really
- 13:10Speaker 2: old WBP encryption well, it's fundamental broken. There are attacks
- 13:14Speaker 2: that can recover the wpke relatively quickly, sometimes even if
- 13:16Speaker 2: no one is actively using the network. It's just not
- 13:18Speaker 2: secure at all anymore.
- 13:20Speaker 1: So avoid WEP at all costs.
- 13:22Speaker 2: Absolutely. WPA and especially WPA TOWPA three are much stronger.
- 13:27Speaker 2: The evolution from wp wasn't just about better encryption algorithms.
- 13:31Speaker 2: It was about fixing fundamental flaws in the connection process.
- 13:35Speaker 2: But even WPA two isn't impenetrable yet. These techniques expose
- 13:38Speaker 2: is that even robust encryption can sometimes be bypassed by
- 13:41Speaker 2: exploiting the connection process itself, not necessarily the encryption algorithm directly.
- 13:46Speaker 2: How So, for WPPA two, the main attack focuses on
- 13:49Speaker 2: capturing the handshake. This is a crucial four way exchange
- 13:52Speaker 2: of cryptographic messages that happens only when a device connects
- 13:55Speaker 2: or reconnects to the network.
- 13:57Speaker 1: The handshake contains information related to the passwords exactly.
- 14:00Speaker 2: It doesn't contain the password directly, but it contains information
- 14:04Speaker 2: derived from the password that can be used to verify
- 14:06Speaker 2: if a guest password is correct. So the goal is
- 14:10Speaker 2: to capture that handshake. You just wait for someone to
- 14:13Speaker 2: connect naturally or you can use those do authentication attacks.
- 14:17Speaker 1: We talked about, AH force someone to disconnect.
- 14:19Speaker 2: So they automatically try to reconnect moments later, allowing you
- 14:24Speaker 2: to reliably capture that handshake as they do. It's a
- 14:28Speaker 2: tactical use of the death attack.
- 14:30Speaker 1: Okay, clever, So you've captured the handshake file. Now what
- 14:33Speaker 1: how do you get the actual password?
- 14:35Speaker 2: Now comes the cracking part. The handshake itself doesn't give
- 14:38Speaker 2: you the password. You need to perform an offline brute
- 14:41Speaker 2: force or dictionary attack against the captured handshake data. This
- 14:45Speaker 2: is where tools that generate password possibilities come in, like
- 14:48Speaker 2: crunch Crunch.
- 14:49Speaker 1: What does it do?
- 14:50Speaker 2: Crunch is a flexible tool for creating custom word lists.
- 14:54Speaker 2: You don't just have to use pre made dictionaries of
- 14:56Speaker 2: common passwords. You can tell Crunch, for instance, generate all
- 15:00Speaker 2: possible passwords between eight and ten characters long using only
- 15:03Speaker 2: lowercase letters and the numbers one, two, three, or define
- 15:07Speaker 2: more complex patterns.
- 15:08Speaker 1: So you create massive lists of potential.
- 15:10Speaker 2: Password potentially massive yes. Then you take the captured handshake
- 15:14Speaker 2: file and you feed it, along with your generated word
- 15:16Speaker 2: list or a banner dictionary file into a cracking tool
- 15:20Speaker 2: like air cracking. Air cracking down then tries each password
- 15:23Speaker 2: from the list against the handshake data. If it finds
- 15:26Speaker 2: a password that successfully validates the handshake, you found.
- 15:30Speaker 1: The network key, which really just highlights the importance of
- 15:32Speaker 1: having a strong, complex Wi Fi password absolutely.
- 15:36Speaker 2: The difficulty of cracking depends entirely on the strength and
- 15:39Speaker 2: length of the password. A shirt simple password might be
- 15:42Speaker 2: cracked in minutes or hours, A long, complex, random one
- 15:45Speaker 2: could take years, decades, or even centuries with current technology.
- 15:50Speaker 1: Okay, so that covers gaining access. Now let's talk about
- 15:53Speaker 1: what happens after you're connected to a network. Man in
- 15:56Speaker 1: the middle attacks. You mentioned them with fake aps, but
- 16:00Speaker 1: they apply once you're on a legitimate network too, right.
- 16:03Speaker 2: Yes, Man in the middle or mitm IT attacks are
- 16:07Speaker 2: incredibly powerful. Once you're on the same local network as
- 16:10Speaker 2: your target, maybe you crack the Wi Fi or you
- 16:13Speaker 2: plugged into the same wired network, you can potentially redirect
- 16:16Speaker 2: their traffic through your machine.
- 16:18Speaker 1: So you sit between the target user and the router.
- 16:21Speaker 2: Essentially, yes, you become the invisible intermediary. This allows you
- 16:25Speaker 2: to read, modify, or even drop their network packets, and crucially,
- 16:28Speaker 2: it often allows you to capture sensitive information like usernames
- 16:31Speaker 2: and passwords entered on websites.
- 16:33Speaker 1: How does that redirection actually work? Technically? How do you
- 16:36Speaker 1: trick their computer into sending traffic to you instead of
- 16:39Speaker 1: the real router.
- 16:40Speaker 2: What's fascinating and maybe a bit alarming, is how this
- 16:43Speaker 2: often works due to the inherent simplicity and trust built
- 16:47Speaker 2: into a fundamental network protocol called ARP, the Address Resolution
- 16:51Speaker 2: Protocol ARP.
- 16:52Speaker 1: What's its job?
- 16:53Speaker 2: Think of ARP as the network's local address book. On
- 16:57Speaker 2: local network devices use IP addresses ninety two point one
- 17:01Speaker 2: sixty eight point one one zero zero to talk to
- 17:03Speaker 2: each other, but the actual data transfer at the lowest
- 17:05Speaker 2: level uses those physical MQ addresses we discussed. AARP's job
- 17:09Speaker 2: is simply to ask, hey, who has IP address one
- 17:11Speaker 2: ninety two point one sixty eight point one one zero zero,
- 17:13Speaker 2: Tell me your AMC address, and the device with that
- 17:16Speaker 2: IP responds with its MK. It's designed for efficiency.
- 17:19Speaker 1: But that simplicity makes it vulnerable.
- 17:21Speaker 2: Exactly, It's largely based on trust. There's no built in verification,
- 17:25Speaker 2: so using a technique called ARP spoofing or AIRP poisoning,
- 17:28Speaker 2: your attacking machine can send out unsolicited ARP replies. You
- 17:32Speaker 2: basically tell the target computer, hey, the router's IP address
- 17:34Speaker 2: like one hint two point one six eight point one
- 17:36Speaker 2: point one, that's my MSA address now, and simultaneously you
- 17:39Speaker 2: tell the router, hey, the target's IP address one ninety
- 17:41Speaker 2: two point one six eight point one one zero zero,
- 17:43Speaker 2: that's my MAAC address.
- 17:44Speaker 1: So you trick both of them into sending traffic meant
- 17:46Speaker 1: for each other to you instead.
- 17:48Speaker 2: Precisely you insert yourself into the conversation. Tools like the
- 17:52Speaker 2: MTMF the Man in the Middle framework automate this whole
- 17:55Speaker 2: process beautifully. MITMS performs the AARP poisoning to redirect trap,
- 18:00Speaker 2: and automatically starts various sniffing and attack plugins for you.
- 18:04Speaker 2: The book provides a compelling example using MITMF to capture
- 18:07Speaker 2: usernames and passwords submitted to plane HTTP websites like a
- 18:11Speaker 2: test site called hack dot me. Just by being the
- 18:14Speaker 2: MITM the credentials pop right up on your screen as
- 18:16Speaker 2: the victim logs.
- 18:17Speaker 1: In plan HTTP. That's the key there, right. What about
- 18:20Speaker 1: secure sites HTTPS?
- 18:22Speaker 2: Ah? Yes, that's the big hurdle HTTPS. When you try
- 18:25Speaker 2: an MITM attack on a site using HTTPS, the encryption
- 18:28Speaker 2: kicks in the browser. Expect the valid digital certificate from
- 18:31Speaker 2: the website signed by a trusted authority. Your MITM tool
- 18:35Speaker 2: can't provide that genuine certificate.
- 18:36Speaker 1: So the browser throws up a warning.
- 18:38Speaker 2: Exactly, the user gets a big, scary warning message saying
- 18:41Speaker 2: that connection is in private, the certificate is invalid. Most
- 18:44Speaker 2: users hopefully would back away.
- 18:45Speaker 1: At that point, so HTTTS works. But is there a
- 18:48Speaker 1: way around that warning?
- 18:49Speaker 2: Well, this is where a clever tool called SSL strip
- 18:52Speaker 2: comes in and understanding this is a truly illuminating insight
- 18:55Speaker 2: into how some attacks work. SSL strip works during the
- 18:58Speaker 2: initial connection attempt. If a user types, say example, dot
- 19:02Speaker 2: Com into their browser, the browser might first try to
- 19:05Speaker 2: connect via HTTP before being redirected to the HTTPS. SSL strip,
- 19:10Speaker 2: running on the MITM machine, intercepts that initial HTDP request.
- 19:14Speaker 2: It then connects to the real server over eahttps itself,
- 19:17Speaker 2: but it presents the website back to the victim over PLANEAHTTP.
- 19:20Speaker 1: It strips away the SSLTLS layer.
- 19:23Speaker 2: Effectively yes for the connection between the victim and the attacker.
- 19:26Speaker 2: The victims browser thinks it's talcking HGTP, so it doesn't
- 19:29Speaker 2: expect a certificate and therefore no warning appears, but the
- 19:32Speaker 2: attacker is still getting the data securely from the real
- 19:34Speaker 2: server and decrypting it or passing it along.
- 19:36Speaker 1: Wow, so it downgrades the connection silently.
- 19:38Speaker 2: Yes, it makes sniffing the traffic trivial again, even if
- 19:41Speaker 2: the original site uses HTTPS. Interestingly, MITMF often starts sslstrip
- 19:47Speaker 2: or its successor SSL strip plus for you automatically when
- 19:50Speaker 2: you run it.
- 19:50Speaker 1: That sounds like a huge security hole. Is there a
- 19:53Speaker 1: defense against SSL strip?
- 19:55Speaker 2: Yes, thankfully, there's a crucial limitation that highlights the ongoing
- 19:59Speaker 2: security evolution HSTS, which stends for HTTP strict transport security.
- 20:05Speaker 2: Websites like Google, Facebook, Banks, etc. Use HSTS. They send
- 20:09Speaker 2: a special header to your browser the first time you
- 20:11Speaker 2: connect securely. This header tells you browser, for the next
- 20:14Speaker 2: x months only ever connect to me using HTTPS, never
- 20:18Speaker 2: even try HTTP.
- 20:20Speaker 1: So the browser doesn't even make that initial insecure request
- 20:22Speaker 1: that SSL strip relies on exactly.
- 20:25Speaker 2: The browser has HSTS rules pre loaded for major sites,
- 20:28Speaker 2: and it remembers the HSTS policy for others after the
- 20:31Speaker 2: first visit. This means that on modern browsers, visiting sites
- 20:35Speaker 2: that use HSTS properly, SSL strip is largely ineffective. It's
- 20:39Speaker 2: a great example of security measures evolving to counter new attacks.
- 20:42Speaker 1: Okay, that's reassuring, But what if the target isn't typing
- 20:44Speaker 1: a password. Say they logged into a site yesterday and
- 20:47Speaker 1: click remember Me. They're authenticated by cookies then, right, not passwords.
- 20:51Speaker 2: That's a very important point. Yes, users are often authenticated
- 20:55Speaker 2: for ongoing sessions using cookies, not by re entering their
- 20:58Speaker 2: password every time they click a link, and these cookies
- 21:01Speaker 2: can also be captured during an MITM attack, even over
- 21:03Speaker 2: eahttps if SSL strip is working or if the cookie
- 21:06Speaker 2: wasn't properly secured by the website.
- 21:09Speaker 1: So you grab their session cookie exactly.
- 21:11Speaker 2: The technique is to sniff out those session cookies using
- 21:14Speaker 2: your MITM tools. Then you can take that cookie value
- 21:18Speaker 2: and inject it into your own browser's cookie storage for
- 21:21Speaker 2: that website. If you then visit the website, the server
- 21:25Speaker 2: sees the valid session cookie and thinks you are the
- 21:28Speaker 2: already authenticated.
- 21:29Speaker 1: User, so you can bypass the login process entirely and
- 21:32Speaker 1: just hijack their existing session.
- 21:33Speaker 2: Precisely, you log into their account without ever needing their password.
- 21:37Speaker 2: It's a powerful demonstration of how seemingly innocuous pieces of
- 21:40Speaker 2: data like cookies can hold the keys to a user's
- 21:43Speaker 2: online identity. If not handled securely.
- 21:46Speaker 1: Okay, this MITM stuff is powerful. You mentioned wire Shark
- 21:49Speaker 1: earlier for analyzing captured packets. How does it fit into
- 21:51Speaker 1: this MITM scenario? Is it just for Wi Fi sniffing?
- 21:55Speaker 2: Oh? No, wire shark is essential throughout well. Tools like
- 21:59Speaker 2: MITMF might show you the important stuff like castured passwords automatically.
- 22:03Speaker 2: Wireshort gives you the full raw picture of everything going
- 22:07Speaker 2: through your network interface during the MITM attack. Everything everything,
- 22:11Speaker 2: every DNS request, every HTTP request and response, every weird
- 22:15Speaker 2: protocol you didn't know was running. You select your network
- 22:19Speaker 2: interface in wire shark, the one MITMF is using to
- 22:22Speaker 2: pass traffic, and it logs all the traffic flowing through it.
- 22:26Speaker 2: Then you can use its powerful graphical interface and filtering
- 22:28Speaker 2: capabilities to dissect that traffic. You can filter specifically for
- 22:33Speaker 2: HTTP traffic, or look for packets containing HTTP dot cookie,
- 22:37Speaker 2: or filter for PUST requests which often carry log inform
- 22:40Speaker 2: data so.
- 22:41Speaker 1: You can find credentials or cookies that maybe in my
- 22:44Speaker 1: TMF didn't automatically flag exactly.
- 22:46Speaker 2: Or you can analyze other protocols, troubleshoot why something isn't working,
- 22:49Speaker 2: or just get a much deeper understanding of what's happening
- 22:51Speaker 2: under the hood. It captures everything flowing through that interface,
- 22:55Speaker 2: giving you a comprehensive view, not just the highlights. It's
- 22:57Speaker 2: an indispensable tool for both offense and defense.
- 23:00Speaker 1: Right it seems like understanding these tools is crucial for
- 23:03Speaker 1: anyone serious about security. Okay, let's shift gears a bit.
- 23:07Speaker 1: We've been talking a lot about network level attacks. Let's
- 23:10Speaker 1: move towards gaining direct access to the computer devices themselves.
- 23:14Speaker 1: The book details two main approaches here, server side attacks
- 23:17Speaker 1: versus client side attacks. What's the fundamental difference between those?
- 23:20Speaker 2: Good transition The core difference lies in whether user interaction
- 23:25Speaker 2: is required. Server side attacks target vulnerabilities and software running
- 23:29Speaker 2: on the remote server, the operating system itself or services
- 23:32Speaker 2: like web server, database server, FTP server, etc. The key
- 23:36Speaker 2: here is no user interaction is needed on the target's part.
- 23:40Speaker 1: You just attack the service directly exactly.
- 23:42Speaker 2: You find a flaw, maybe a known vulnerability and an
- 23:45Speaker 2: outdated piece of software, a default password that was never changed,
- 23:48Speaker 2: a misconfiguration, or complex flaws like SQL injection or buffer
- 23:52Speaker 2: overflows will discuss later, and you exploit it directly over
- 23:55Speaker 2: the network, for example, using a framework like metasploit. You
- 23:59Speaker 2: might explore a known backdoor in an old version of
- 24:02Speaker 2: an FTP server like vsftpd to gain full control.
- 24:06Speaker 1: Okay, so that's server side. What about client side?
- 24:09Speaker 2: Client side attacks, on the other hand, do require some
- 24:12Speaker 2: form of user interaction. The vulnerability isn't necessarily on a
- 24:17Speaker 2: server waiting to be attacked. It's often exploited when the
- 24:20Speaker 2: user performs an action like clicking a link exactly like
- 24:24Speaker 2: clicking a malicious link, opening an infected email attachment, installing
- 24:28Speaker 2: a fake software update, maybe even just visiting a compromise
- 24:31Speaker 2: website that exploits a browser vulnerability. Because of this human element,
- 24:37Speaker 2: information gathering about the person, their habits, their interests, the
- 24:40Speaker 2: software they use becomes incredibly important for crafting a successful
- 24:45Speaker 2: client side attack. This is where social engineering really comes
- 24:48Speaker 2: into play.
- 24:48Speaker 1: Okay, service side targets the machine software. Client side often
- 24:52Speaker 1: targets the user's actions. You mentioned metasploit again, it sounds
- 24:55Speaker 1: like a key tool. Can you elaborate on it.
- 24:58Speaker 2: Metasplate is huge. It's arguably the most widely used framework
- 25:02Speaker 2: for penetration testing and exploit development. Think of it as
- 25:04Speaker 2: a massive toolkit and database for finding, crafting, and launching exploits.
- 25:09Speaker 1: How is it structured.
- 25:10Speaker 2: It's organized into various components or modules. You have exploits,
- 25:14Speaker 2: which are the actual pieces of code that take advantage
- 25:17Speaker 2: of a specific vulnerability in a system or application. There
- 25:21Speaker 2: are thousands of exploits in metasploit for all sorts of software. Then,
- 25:25Speaker 2: once an exploit successfully breaches a system, it typically delivers
- 25:29Speaker 2: a payload.
- 25:30Speaker 1: Payloads What are they?
- 25:31Speaker 2: Payloads are the small pieces of malicious code that actually
- 25:35Speaker 2: execute on the target after the vulnerability has been exploited.
- 25:38Speaker 2: They define what you want to do once you get in.
- 25:41Speaker 2: Do you want a simple command show? Do you want
- 25:43Speaker 2: a more advanced remote control agent? That's what the payload determines.
- 25:46Speaker 1: Are there different tins of payloads?
- 25:48Speaker 2: Yes. Broadly speaking, there are two main types, based on
- 25:51Speaker 2: how the connection is established. Bind payloads. These open a
- 25:54Speaker 2: specific network port on the target machine, listening for an
- 25:57Speaker 2: incoming connection. The attack then connects to the compromise target.
- 26:01Speaker 1: Okay, the target listens, the attacker connects.
- 26:04Speaker 2: Right, but that often gets blocked by firewalls protecting the
- 26:07Speaker 2: target machine because figure walls are usually configured to block
- 26:10Speaker 2: unexpected incoming connections. So the other type is often more
- 26:14Speaker 2: effective reverse.
- 26:15Speaker 1: Payloads reverse, so the target connects back to the attacker exactly.
- 26:20Speaker 2: The payload on the target machine initiates an outgoing connection
- 26:23Speaker 2: back to a listening port on the attacker's machine.
- 26:26Speaker 1: Why is that more powerful.
- 26:27Speaker 2: Because firewalls are typically much more permissive at allowing outgoing
- 26:31Speaker 2: connections from the machines they protect. People need to browse
- 26:34Speaker 2: the web, check email, et cetera. So an outgoing connection
- 26:37Speaker 2: from the target back to the attacker often bypasses firewall rules.
- 26:42Speaker 1: Clever sneaking out instead of breaking in precisely.
- 26:45Speaker 2: For example, using a payload like Windows mitrepre reverse TTP,
- 26:49Speaker 2: or reverse TTPs is very common. These make the backdoor
- 26:53Speaker 2: connection look like standard web traffic using ports eighty or
- 26:56Speaker 2: four to forty three, making it even harder to detect
- 26:59Speaker 2: amongst legitimate web browsing.
- 27:00Speaker 1: Interpreter is that a specific type of payload.
- 27:03Speaker 2: Yes, Interpreter is an advanced payload within metasploit. Instead of
- 27:08Speaker 2: just giving you a basic command shell, it provides a
- 27:11Speaker 2: powerful extensible command and control agent with lots of built
- 27:14Speaker 2: in capabilities for post exploitation, which we'll get to later.
- 27:18Speaker 1: Okay, metasploit sounds critical Before you can exploit though you
- 27:21Speaker 1: need to find vulnerabalities, how do ethical hackers scan for weaknesses?
- 27:26Speaker 2: Right? Reconnaissance and scanning are crucial first steps. You need
- 27:30Speaker 2: to know what doors are open before you try to
- 27:31Speaker 2: pick the locks. There are various tools. One approach integrated
- 27:35Speaker 2: with metaploit itself is using MSFC, the Metaploit Community Interface
- 27:39Speaker 2: or similar commercial versions. This provides a web based UI
- 27:43Speaker 2: for metaploit. You can point it at a target IP
- 27:46Speaker 2: address or range and it will perform scans to discover
- 27:48Speaker 2: open ports, identify the services running on those ports like
- 27:51Speaker 2: web server, FTP, SSH, and often even identify the specific
- 27:55Speaker 2: software versions.
- 27:56Speaker 1: And it links those findings to exploits.
- 27:58Speaker 2: Yes, that's the really useful part. It often maps the
- 28:02Speaker 2: discovered services and versions directly to known exploits available within
- 28:05Speaker 2: the metasploid framework. In some cases, for well known vulnerabilities
- 28:10Speaker 2: on unpatched systems like our Metasploitable Victim machine, it might
- 28:14Speaker 2: even allow for one click exploitation directly from the web interface.
- 28:18Speaker 1: Makes it sound easy.
- 28:20Speaker 2: For known simple vulnerabilities, it can be, but real world
- 28:23Speaker 2: systems are often more complex and patched. That's where more
- 28:26Speaker 2: advanced scanners come in. Like Nextpose from rapid seven, who
- 28:30Speaker 2: also manage metasploit or nessis from tenable.
- 28:32Speaker 1: How is next pose different?
- 28:34Speaker 2: Nextpose is a more comprehensive vulnerability management framework. It goes
- 28:38Speaker 2: beyond just finding open ports and services. It performs deeper scans,
- 28:43Speaker 2: identifies vulnerabilities with associated risk scores, and crucially, it often
- 28:47Speaker 2: attempts to enumerate all installed software on the target system,
- 28:50Speaker 2: not just network services.
- 28:52Speaker 1: Why is knowing all installed software.
- 28:54Speaker 2: Important because sometimes the initial exploit only gives you limited access.
- 28:58Speaker 2: Knowing about other software installed on the machine might reveal
- 29:01Speaker 2: opportunities for local privilege escalation, using a flaw in a
- 29:06Speaker 2: locally installed program to gain higher administrative rights after you've
- 29:09Speaker 2: already got a foothold. Nexpose also generates much more detailed
- 29:13Speaker 2: and professional reports, which are essential for documenting findings in
- 29:16Speaker 2: a professional penetration test.
- 29:18Speaker 1: Okay, so scanning finds potential entry points. But what if
- 29:22Speaker 1: the target is well protected no obvious server side flaws.
- 29:26Speaker 1: That's when client side attacks and social engineering come back in.
- 29:29Speaker 2: Exactly when direct server side attacks fail, or maybe the
- 29:32Speaker 2: target isn't even directly reachable on the network behind multiple
- 29:36Speaker 2: layers of firewalls, client side attacks become the primary vector,
- 29:40Speaker 2: and these almost always involve some element of social engineering
- 29:44Speaker 2: manipulating the human user.
- 29:45Speaker 1: How do you make malware that works for this? Doesn't
- 29:48Speaker 1: antivirus catch most things?
- 29:50Speaker 2: Antivirus is a challenge, definitely. That's where tools like Veil Evasion,
- 29:54Speaker 2: now part of the larger Veil framework, become relevant. Veil
- 29:57Speaker 2: was specifically designed to generate payloads metasploit payloads in ways
- 30:01Speaker 2: that attempt to evade detection by common antivirus solutions. It
- 30:06Speaker 2: uses various techniques like encryption, code obfuscation, and different programming
- 30:10Speaker 2: language wrappers.
- 30:11Speaker 1: So you use VEIL to create an undetectable backdoor.
- 30:14Speaker 2: That's the goal. Yes, you use VEIL to generate a
- 30:17Speaker 2: malicious executable file, maybe backdoor, dot exe or something more
- 30:21Speaker 2: convincingly named. This file contains your chosen payload, like a
- 30:25Speaker 2: reverse interpreter shell. Then you need to get the user
- 30:27Speaker 2: to run that file. While Veil tries to handle the
- 30:30Speaker 2: antivirus evation, you still need the social engineering part, and
- 30:34Speaker 2: on your end you set up metasploits multi handler exploit
- 30:37Speaker 2: multi handler to listen for the incoming connection from that
- 30:40Speaker 2: back door. Once the victim runs.
- 30:41Speaker 1: It, right, the social engineering part how deep does that go?
- 30:45Speaker 2: It can go very deep. At its heart, social engineering
- 30:48Speaker 2: is the art or maybe science, of manipulating people to
- 30:51Speaker 2: perform actions they shouldn't or divulge confidential information. This is
- 30:56Speaker 2: where detailed information gathering about the person or the organization
- 31:00Speaker 2: it really shines. You need to understand your target to
- 31:03Speaker 2: craft a believable pretext.
- 31:05Speaker 1: What tools help with gathering info on people?
- 31:07Speaker 2: Maltago is a classic and incredibly powerful tool for open
- 31:11Speaker 2: source intelligence gathering oh SINT. You start with a piece
- 31:14Speaker 2: of information, maybe a Poston's name and email address, a
- 31:17Speaker 2: company name, a website, and Maultago automatically queries numerous public
- 31:21Speaker 2: data sources, search engines, social media, DNS records, whose databases, etc.
- 31:26Speaker 2: To find related information. It then visually maps out the
- 31:30Speaker 2: connections between people, websites, companies, email addresses, phone numbers, social
- 31:33Speaker 2: media profiles like Twitter, LinkedIn Facebook documents they've shared. It
- 31:37Speaker 2: can build a very detailed picture from publicly available data.
- 31:40Speaker 1: So you use Multago to find out about your target,
- 31:43Speaker 1: then what then you use.
- 31:44Speaker 2: That information to build a plausible attack strategy or pretext.
- 31:48Speaker 2: For example, if Maltago shows your target works at company
- 31:52Speaker 2: X and frequently uses say WordPress. You might craft an
- 31:56Speaker 2: attack pretending to be from WordPress support, offering them a
- 31:59Speaker 2: link to download a new beta security plug in, which
- 32:02Speaker 2: is actually your veil generated.
- 32:04Speaker 1: Back door ah, making it relevant and seem legitimate exactly.
- 32:08Speaker 2: The more tailored and believable the pretext, the higher the
- 32:11Speaker 2: chance of success. Other practical techniques include things like changing
- 32:15Speaker 2: the icon of your back door executable to make it
- 32:17Speaker 2: look like a harmless file like a PDF or an image.
- 32:20Speaker 2: Tools like auto it can help compile scripts that drop
- 32:23Speaker 2: and run the real back door while maybe displaying a
- 32:25Speaker 2: decoy document so.
- 32:26Speaker 1: It looks like they opened a picture, but malware runs
- 32:28Speaker 1: in the background precisely.
- 32:30Speaker 2: There's even a trick. Using a special Unicode character called
- 32:32Speaker 2: the right to left override RL character, you can name
- 32:36Speaker 2: a file something like report augustrlo cod dot ex in
- 32:40Speaker 2: Windows Explore. The ROL character reverses the order of the
- 32:43Speaker 2: characters that follow it, so the file name might appear
- 32:46Speaker 2: as report agustext dot dios hiding thereal dot ex extension
- 32:50Speaker 2: can fool less cautious users.
- 32:51Speaker 1: Wow, that's sneaky, it is.
- 32:54Speaker 2: And another potent technique is email spoofing, sending an email
- 32:58Speaker 2: that appears to come from someone the target nos and
- 33:00Speaker 2: trust their boss, a colleague, a friend. If the email
- 33:04Speaker 2: looks legitimate and comes from a trusted source, the target
- 33:07Speaker 2: is far more likely to click a link or open
- 33:10Speaker 2: an attachment containing your back door.
- 33:12Speaker 1: It really underscores how much trust we place in digital
- 33:15Speaker 1: communications and how that trust can be exploited.
- 33:18Speaker 2: Absolutely, the human element is often the weakest link in
- 33:21Speaker 2: the security chain.
- 33:22Speaker 1: Okay, let's explore another angle of client side attacks. What
- 33:26Speaker 1: if the target doesn't download or run anything, but simply
- 33:29Speaker 1: browses a webpage you control or have compromised. Can you
- 33:32Speaker 1: attack them through their browser?
- 33:34Speaker 2: Yes? Definitely. This is where the BEEF tool comes in.
- 33:37Speaker 2: BEEF stands for the Browser Exploitation Framework Browser exploitation.
- 33:41Speaker 1: How does that work?
- 33:42Speaker 2: BEEF allows you to hook a target's web browser and
- 33:46Speaker 2: then run various commands and attacks directly within their browser context,
- 33:50Speaker 2: often without them noticing immediately.
- 33:51Speaker 1: How do you hook their browser?
- 33:53Speaker 2: A target browser becomes hooked when it executes a small
- 33:56Speaker 2: piece of JavaScript code provided by BEEF. You can achieve
- 34:00Speaker 2: this in several ways. You could embed this JavaScript hook
- 34:03Speaker 2: into a web page you control, maybe even a blank page.
- 34:07Speaker 2: Then you use social engineering. Heycheck out this cool site
- 34:10Speaker 2: or perhaps DNS spoofing during an MITM attack to redirect
- 34:13Speaker 2: the victim to your page containing the hook. Or if
- 34:16Speaker 2: you find a cross site scripting EXSS vulnerability on a
- 34:20Speaker 2: legitimate website. We'll talk more about XSS later, you could
- 34:23Speaker 2: inject the beef hook script there, hooking anyone who visits
- 34:26Speaker 2: the compromise legitimate page.
- 34:27Speaker 1: Okay, so their browser runs your JavaScript hook. What can
- 34:30Speaker 1: you do then? Via beef?
- 34:32Speaker 2: Once a browser is hooked, Beef offers a surprisingly vast
- 34:35Speaker 2: array of commands and modules, all controlled from your attack
- 34:38Speaker 2: or interface. You can gather information what browser and version
- 34:42Speaker 2: are they using, what plugins are installed like Flash, Java
- 34:45Speaker 2: often vulnerable. What's the internal IP address of their computer?
- 34:48Speaker 2: What other websites do they have open in other tabs?
- 34:51Speaker 2: Can you grab cookies for the current site.
- 34:53Speaker 1: Just from them visiting a page if it's.
- 34:55Speaker 2: Hooked, Yes, and then you can launch browser based attacks.
- 34:59Speaker 2: You can display fake notification pop ups you do install
- 35:02Speaker 2: this update, you can execute arbitrary JavaScript in their browser.
- 35:05Speaker 2: You can attempt to redirect their browser to other malicious
- 35:08Speaker 2: sites or fake login pages. There's a particularly nasty module
- 35:12Speaker 2: called pretty theft. It can display very convincing fake login
- 35:16Speaker 2: pop ups that float over the current page asking for
- 35:19Speaker 2: credentials for sites like Facebook, LinkedIn, Gmail, generic webmail, hoping
- 35:24Speaker 2: the user will type their password into your fake box.
- 35:26Speaker 1: Wow, that's purely social engineering within.
- 35:29Speaker 2: The browser exactly. But BEEF can go even further. It
- 35:32Speaker 2: can act as a stepping stone to gain full system access.
- 35:36Speaker 2: There are modules designed to, for example, display a fake
- 35:39Speaker 2: notification bar at the top of the browser window, maybe
- 35:41Speaker 2: mimicking a flash update or a browser plugin update. If
- 35:44Speaker 2: the user clicks install update.
- 35:46Speaker 1: It downloads and runs your back door.
- 35:48Speaker 2: Precisely, BEEF can serve up your veil generated executable, tricking
- 35:52Speaker 2: the user into installing it, and if they do, boom,
- 35:54Speaker 2: you get a full mature procession back give you complete
- 35:56Speaker 2: control over their computer, not just their browser.
- 35:59Speaker 1: It's truly by opening how a simple web browser, something
- 36:02Speaker 1: we use constantly can become such a powerful attack factor.
- 36:05Speaker 2: It really is browser security. Keeping it updated and being
- 36:09Speaker 2: cautious about what you click are incredibly important.
- 36:12Speaker 1: Okay, this is all fascinating, but so far everything we've discussed,
- 36:15Speaker 1: the lab set up, the network attacks, the client side
- 36:18Speaker 1: stuff seems to assume everything is happening within your own
- 36:21Speaker 1: local network inside that virtual box. Environment. How do you
- 36:25Speaker 1: take these attacks out into the real world. How do
- 36:27Speaker 1: you attack a target that's somewhere else entirely on the
- 36:30Speaker 1: Internet outside your local network.
- 36:32Speaker 2: That's a critical question for simulating realistic scenarios. You're right.
- 36:36Speaker 2: Your virtual machines usually have local IP addresses like one
- 36:39Speaker 2: ninety two point one, six eight dot x or ten
- 36:42Speaker 2: dot xixodx that are directly reachable from the public Internet.
- 36:46Speaker 2: The key technology here is port forwarding on your Internet router,
- 36:50Speaker 2: the box your ISP gives you that connects your home
- 36:52Speaker 2: network to the wider Internet.
- 36:54Speaker 1: Port forwarding. How does that work?
- 36:56Speaker 2: First, you need to know your network's public IP address.
- 36:59Speaker 2: This is the address the rest of the Internet sees
- 37:01Speaker 2: for your entire home network. You can usually find it
- 37:03Speaker 2: easily by just searching what is my IP on Google
- 37:07Speaker 2: from a computer on your network. Then you log into
- 37:10Speaker 2: your router's administration interface. Somewhere in the settings there will
- 37:13Speaker 2: be a section for port forwarding, or sometimes called virtual
- 37:16Speaker 2: servers or application forwarding. Here you create rules. You tell
- 37:20Speaker 2: a router, hey, if any traffic comes in from the
- 37:22Speaker 2: Internet directed at my public IP address on a specific
- 37:25Speaker 2: port number, say port eighty eighty, please forward that traffic
- 37:29Speaker 2: inward to the local IP address of my Collie Linux
- 37:32Speaker 2: virtual machine on that same port or a different one.
- 37:35Speaker 1: So the router acts like a receptionist, directing incoming calls
- 37:38Speaker 1: to the right internal extension.
- 37:40Speaker 2: Perfect analogy. Yes, you're mapping an external port on your
- 37:43Speaker 2: public IP to an internal port on your specific Callie
- 37:46Speaker 2: machines local IP. You'd set up different rules for different
- 37:49Speaker 2: services you want to expose. Maybe port eighty eighty for
- 37:51Speaker 2: your backdoor listener port eighty if you're hosting a malicious
- 37:54Speaker 2: website on Collie, Port three thousand for the beef UI
- 37:57Speaker 2: if you want to hook external browsers.
- 37:59Speaker 1: Okay, So forwarding makes your internal Collie services reachable via
- 38:03Speaker 1: your public IP. How does that apply to backdoors?
- 38:06Speaker 2: Right, let's talk about external backdoors. When you create your
- 38:10Speaker 2: back door using a tool like veil evasion, you need
- 38:13Speaker 2: to configure the payload. Specifically, you set the l host option.
- 38:18Speaker 2: LOS tells the back door where to connect back to.
- 38:21Speaker 2: For internal attacks within your lab, you set LOS to
- 38:23Speaker 2: your Collie machine's local IP, but for an external attack,
- 38:27Speaker 2: you set l host to your network's public IP address.
- 38:30Speaker 1: Ah, so the backdoor tries to connect to your public
- 38:33Speaker 1: IP from outside.
- 38:34Speaker 2: Exactly the back door running on a victim machine somewhere
- 38:37Speaker 2: else on the Internet attempts to initiate that reverse connection
- 38:40Speaker 2: back to your public IP address on the port you
- 38:42Speaker 2: specified Tree eighty eighty. Your router sees this incoming traffic
- 38:46Speaker 2: on Court eighty eighty, your port forwarding rule kicks in
- 38:49Speaker 2: the router force that connection inward to your Collie machine's
- 38:52Speaker 2: local IP address, where your metasploit multi handler is listening,
- 38:55Speaker 2: and you.
- 38:56Speaker 1: Get the shell connecting the dots from external target through
- 38:59Speaker 1: the Internet, through your router to your COLLIVM.
- 39:01Speaker 2: Precisely, as an alternative to setting up individual port forwarding rules,
- 39:06Speaker 2: some routers support putting a specific internal IP address into
- 39:10Speaker 2: the DMZ or demilitarized zone. Putting your Collie machine's IP
- 39:14Speaker 2: in the DMZ essentially forwards all incoming ports from the
- 39:18Speaker 2: public IP directly to that internal machine. It's simply to
- 39:21Speaker 2: set up, but less secure as exposes all of Collie's ports.
- 39:24Speaker 2: Port Forwarding specific ports is generally safer.
- 39:26Speaker 1: Okay, that makes sense, and seeing it work must be
- 39:28Speaker 1: quite the moment.
- 39:29Speaker 2: It really is, the truly insightful moment. The real aha
- 39:33Speaker 2: comes when you demonstrate this end to end. Imagine you
- 39:36Speaker 2: set up port forwarding from port eighty to your Collie machine,
- 39:39Speaker 2: which is running a web server hosting your backdoor dot ex.
- 39:43Speaker 2: Then you go to a completely separate computer on a
- 39:46Speaker 2: totally different network, maybe using your phone's hotspot or at
- 39:48Speaker 2: friend's house, open a browser typing your home network's public
- 39:52Speaker 2: IP address, and download backdoor dot ex from your Collie
- 39:55Speaker 2: web server. You run the back door on that external
- 39:58Speaker 2: Windows machine and back on you your calling machine. You
- 40:01Speaker 2: see the interpreter session open up, showing the connection coming
- 40:04Speaker 2: from that truly external public IP address. That's when you
- 40:07Speaker 2: really grasp how these attacks bridge the gap from the
- 40:09Speaker 2: local lab to the global internet.
- 40:11Speaker 1: That definitely paints a clear picture. Okay, so let's assume
- 40:14Speaker 1: you've succeeded. You've used an exploit, maybe delivered a payload
- 40:18Speaker 1: bypass the fire wall with a reverse connection. You've gained
- 40:21Speaker 1: initial access to a system. What's next? What happens in
- 40:24Speaker 1: the post exploitation phase.
- 40:26Speaker 2: Right Getting access is often just the beginning. Post exploitation
- 40:30Speaker 2: is all about what you do after you compromise a system.
- 40:33Speaker 2: The main goals are usually to understand the system better,
- 40:36Speaker 2: escalate your privileges if needed. Maintain your access persistently and
- 40:40Speaker 2: potentially use this machine to attack others.
- 40:43Speaker 1: Let's start with understanding the system you mentioned Interpreter earlier.
- 40:47Speaker 2: Yes, if your payload was Interpreter, you get a very
- 40:50Speaker 2: powerful interactive shell. It has lots of built in commands,
- 40:54Speaker 2: specifically for post exploitation. You can run basic commands like
- 40:57Speaker 2: sits info to get detailed information about the operating system, hardware,
- 41:01Speaker 2: et cetera. PS lists all the running processes pwdn LS
- 41:06Speaker 2: or durrors on Windows. Targets let you navigate the filesystem
- 41:09Speaker 2: just like a local command prompt. You start exploring.
- 41:12Speaker 1: What about making your access more stable?
- 41:14Speaker 2: That's crucial process migration. Your initial access might have come
- 41:17Speaker 2: through exploiting a vulnerability and say a user's web browser
- 41:21Speaker 2: or a specific application. If the user closes that browser application,
- 41:25Speaker 2: your interpreter session dies.
- 41:26Speaker 1: With it, so you lose access exactly.
- 41:29Speaker 2: Process migration involves injecting your materpreter agent from that initial
- 41:32Speaker 2: unscable process into a different, more stable, long running process
- 41:37Speaker 2: on the system. On Windows, migrating into something like Explorer
- 41:41Speaker 2: dot exx, which handles the desktop or services dot ex
- 41:44Speaker 2: is common. These processes almost never close while the system
- 41:48Speaker 2: is running. This makes your access much more persistent for
- 41:51Speaker 2: your current session.
- 41:52Speaker 1: Okay, stable access, what else? Getting data definitely?
- 41:55Speaker 2: Interpreter makes it easy to upload and download files between
- 41:58Speaker 2: your Collie machine and the compromised target. You might want
- 42:01Speaker 2: to download sensitive documents you find, or upload additional tools,
- 42:05Speaker 2: maybe a.
- 42:06Speaker 1: Keylogger, keyloggers to capture typing.
- 42:08Speaker 2: Yes, Materpreter has modules to deploy keyloggers that capture every
- 42:12Speaker 2: single keystroke the user types on their keyboard, passwords, emails,
- 42:15Speaker 2: chat messages, documents, everything. It's incredibly invasive.
- 42:18Speaker 1: And keeping access long term even after they reboot.
- 42:21Speaker 2: Right. That's maintaining access or persistence. Just migrating processes keeps
- 42:26Speaker 2: you alive for the current session, but if the computer reboots,
- 42:29Speaker 2: you lose access again. Persistence techniques aim to ensure your
- 42:32Speaker 2: backdoor runs automatically every time the system starts up. There
- 42:35Speaker 2: are simpler methods. You could use valvation again to generate
- 42:38Speaker 2: a backdoor designed to install itself as a system service.
- 42:42Speaker 2: Materpreter itself also has persistent scripts or modules that try
- 42:45Speaker 2: to set up basic startup entries in the registry or scheduled.
- 42:48Speaker 1: Tasks, but those might get caught.
- 42:50Speaker 2: They often do yes. These simpler methods can be detectable
- 42:53Speaker 2: by anti virus or endpoint security software. The book hints
- 42:57Speaker 2: a more advanced, robust methods for each ving persistence, often
- 43:01Speaker 2: involving combining multiple techniques or using more sophisticated evasion tactics
- 43:06Speaker 2: to ensure the back door remains active and hidden even
- 43:09Speaker 2: after reboots without being easily detected. These often require a
- 43:13Speaker 2: deeper understanding of the OS internals.
- 43:15Speaker 1: Okay, persistence is key. What about attacking other computers from
- 43:19Speaker 1: the one you just hacked?
- 43:20Speaker 2: Ah, that's pivoting. This is a really important concept in
- 43:23Speaker 2: penetration testing. Often the first machine you compromise might just
- 43:28Speaker 2: be a regular user's workstation or a less critical server,
- 43:31Speaker 2: but that machine might have access to other internal networks
- 43:35Speaker 2: or servers that are not directly reachable by your calling
- 43:37Speaker 2: machine from the outside.
- 43:39Speaker 1: Like deeper inside their network exactly.
- 43:41Speaker 2: Pivoting involves using the compromised computer as a stamping stone
- 43:44Speaker 2: or a pivot to route your attack traffic through it
- 43:47Speaker 2: to reach those other internal targets. For example, you might
- 43:51Speaker 2: hack a Windows machine in their main office network, say
- 43:54Speaker 2: one ninety two point one six eight point one point
- 43:57Speaker 2: one zero. Then you discover, maybe through network scan from
- 44:00Speaker 2: that Windows machine, that there's a separate internal server network,
- 44:03Speaker 2: say ten point zero point zero point zero two four,
- 44:06Speaker 2: that holds critical data, but your callie machine can't see
- 44:09Speaker 2: it directly. You use the compromise Windows machine as a gateway.
- 44:12Speaker 2: Metasploit has modules like run auto route that automatically add
- 44:16Speaker 2: network routes through your materpreter session on the Windows box.
- 44:19Speaker 2: The sales metasploit. Hey, if you want to talk to
- 44:21Speaker 2: any machine on the ten point zero point one to network,
- 44:23Speaker 2: send the traffic via the interpreter session running on one
- 44:26Speaker 2: ninety two point one sixty eight point one point one
- 44:28Speaker 2: towards zero.
- 44:29Speaker 1: So you can then launch exploits from your callie machine
- 44:32Speaker 1: against those internal servers, tunneling through the first victim.
- 44:35Speaker 2: Precisely, it allows you to burrow deeper into a target network,
- 44:39Speaker 2: moving laterally from system to system, starting from just one
- 44:42Speaker 2: initial point of compromise. It's a fundamental technique for mapping
- 44:46Speaker 2: out and compromising larger networks.
- 44:48Speaker 1: Post exploitation seems just as complex, if not more so,
- 44:51Speaker 1: than getting initial access.
- 44:53Speaker 2: It often is. It requires a different set of skills.
- 44:56Speaker 2: Understanding the target os, knowing how to move quietly and
- 44:58Speaker 2: achieving specific without getting caught.
- 45:01Speaker 1: Okay, we've covered networks devices, client side, server side. Let's
- 45:05Speaker 1: transition now to website penetration testing, shifting focus from the
- 45:10Speaker 1: underlying infrastructure to the web applications themselves. First off, what
- 45:14Speaker 1: exactly is a website from an ethical hackers perspective? And
- 45:18Speaker 1: how do you start gathering information specifically about a website target?
- 45:21Speaker 2: Good question from our perspective. A website is essentially a
- 45:26Speaker 2: web application, a collection of files and code installed on
- 45:29Speaker 2: a web server, and that web server is just another
- 45:31Speaker 2: computer running an OS with an IP address made accessible
- 45:35Speaker 2: usually via a domain name like www dot example dot com.
- 45:39Speaker 2: For example, that Metasploitable virtual machine we talked about. It
- 45:43Speaker 2: runs a web server and it has website files like index,
- 45:46Speaker 2: dot php, images, etc. In a specific directory. You can
- 45:50Speaker 2: access its simple website just by typing Metasploitable's IP address
- 45:54Speaker 2: into a browser on your Collie machine.
- 45:56Speaker 1: Okay, so it's software on a server. How do you
- 45:58Speaker 1: gather info on it? Is it like the osin tweeted
- 46:01Speaker 1: for people?
- 46:01Speaker 2: It's similar in principle, but focused on web technologies and infrastructure.
- 46:05Speaker 2: Information gathering is just as critical for web targets. You
- 46:08Speaker 2: start with things like a who's look up for the
- 46:10Speaker 2: domain name. This can give you information about who registered
- 46:13Speaker 2: the domain, the company name and address if they did
- 46:15Speaker 2: use a privacy service, the domain name servers, which hinsit,
- 46:18Speaker 2: their hosting provider, and sometimes technical contact email addresses.
- 46:22Speaker 1: What else, what about the tech running the site?
- 46:24Speaker 2: For that, tools and services like Netcraft are excellent. You
- 46:28Speaker 2: can enter a website URL into Netcraft's site report tool
- 46:31Speaker 2: and it will try to identify the technology as the
- 46:33Speaker 2: website is using. Things like what web server software are
- 46:36Speaker 2: they running? Apache injincs, Microsoft ISA, What server side programming
- 46:41Speaker 2: languages are they using? Php? Java, dot Net, Python? Will
- 46:44Speaker 2: client side JavaScript libraries jQuery React? Crucially, Netcraft can often
- 46:50Speaker 2: identify specific web applications being used, like wordcres, Jumladruple, Magento.
- 46:55Speaker 2: Knowing they're using say WordPress version xy immediately tell you
- 47:00Speaker 2: to go research known vulnerabilities for that specific version ah.
- 47:03Speaker 1: Finding known weaknesses in the software they use, mark exactly.
- 47:07Speaker 2: Robtex is another useful service that provides a lot of
- 47:09Speaker 2: related network information for a given domain or ip address,
- 47:12Speaker 2: things like historical DNS records or related domains IPA, just neighbors.
- 47:15Speaker 1: IP addressed neighbors. Why does that matter?
- 47:17Speaker 2: This relates to the idea of websites on the same server.
- 47:21Speaker 2: It's very common for web hosting companies to put multiple
- 47:24Speaker 2: websites belonging to different customers, all in the same physical
- 47:27Speaker 2: server sharing the same IP address. So if your target
- 47:30Speaker 2: website seems really secure and you can't find any vulnerabilities
- 47:34Speaker 2: on it directly, you can check what other websites are
- 47:37Speaker 2: hosted on that same IP address. If you can find
- 47:39Speaker 2: and exploit a vulnerability on one of those other, potentially
- 47:42Speaker 2: less secure websites on the same server, gaining access to
- 47:46Speaker 2: that site often means you gain access to the underlying
- 47:48Speaker 2: server itself, and from there you can usually access the
- 47:51Speaker 2: files and databases of your original target website.
- 47:54Speaker 1: As well hack the neighbor to get into the target's house. Essentially,
- 47:57Speaker 1: that's a.
- 47:58Speaker 2: Good way to put it. It's a common technique. Another
- 48:00Speaker 2: thing to look for is subdomains. Companies often have subdomains
- 48:04Speaker 2: that aren't widely advertised, like dev dot example dot com,
- 48:07Speaker 2: staging dot Example dot com, Beta dot example dot com,
- 48:10Speaker 2: or maybe even admin dot example dot com. These subdomains
- 48:14Speaker 2: might host experimental features, older versions of the application, or
- 48:18Speaker 2: internal administrative interfaces that are often less secured or patched
- 48:22Speaker 2: than the main public facing website. Finding improbing these hidden
- 48:26Speaker 2: subdomains can be very fruitful.
- 48:28Speaker 1: How do you find them if they're not advertised?
- 48:29Speaker 2: There are tools that perform subdomain enumeration using various techniques
- 48:33Speaker 2: like checking common names, admin, test, dev, etc. Querying DNS records,
- 48:37Speaker 2: using search engines, creatively or even brute forcing potential subdomain names. Finally,
- 48:43Speaker 2: information gathering also involves looking for sensitive files and directories
- 48:46Speaker 2: directly on the web server that might have been left exposed.
- 48:49Speaker 2: Maybe developers left behind configuration files canfig dot php, dot BAK,
- 48:53Speaker 2: backup archives, website dot zip, debugging scripts, PHPNFO dot php
- 48:58Speaker 2: which reveals tons about the PHP setup, or even files
- 49:01Speaker 2: containing credentials passwords dot txt.
- 49:03Speaker 1: People actually leave password files accessible.
- 49:06Speaker 2: You'd be surprised how often misconfigurations happen. Tools like derb
- 49:10Speaker 2: or go buster help automate the process of finding these
- 49:13Speaker 2: hidden files and directories by rapidly trying thousands of common
- 49:17Speaker 2: names based on dictionary lists.
- 49:19Speaker 1: Okay, that's a lot of ground to cover just in
- 49:22Speaker 1: information gathering for websites. Now let's get into the actual
- 49:25Speaker 1: vulnerabilities what are some of the most common ways ethical
- 49:29Speaker 1: hackers find and exploit weaknesses in web applications themselves.
- 49:33Speaker 2: Right, let's dive into the nitty gritty of common webflaws.
- 49:37Speaker 2: One conceptually straightforward vulnerability is related to file uploads. Many
- 49:41Speaker 2: websites allow users to upload files, profile, pictures, documents, etc.
- 49:46Speaker 2: If the website doesn't properly validate what kind of file
- 49:48Speaker 2: is being uploaded, an attacker might be able to upload
- 49:51Speaker 2: a malicious script file instead of say a GPEG.
- 49:53Speaker 1: Image, like uploading code instead of data exactly.
- 49:56Speaker 2: If the web servers configure to execute phpe scripts, for example,
- 50:00Speaker 2: and you can upload a file ending in dot php
- 50:02Speaker 2: containing malicious PHP code, often called a webshell, then simply
- 50:06Speaker 2: browsing to the URL of that uploaded file could give
- 50:09Speaker 2: you full command execution capabilities on the.
- 50:11Speaker 1: Server, so you upload your own command prompt essentially.
- 50:14Speaker 2: Yes, Tools like Weaveley are specifically designed to generate compact
- 50:19Speaker 2: and often stealthy PHP webshells that give you a nice
- 50:23Speaker 2: interactive terminal to control the server. This all comes down
- 50:26Speaker 2: to the critical principle of input validation. The website must
- 50:30Speaker 2: strictly check file types and not trust user supplied file names.
- 50:33Speaker 1: Okay, insecure file uploads? What else?
- 50:36Speaker 2: Next up are code execution vulnerabilities. These are flaws where
- 50:40Speaker 2: user input is directly used or embedded into a command
- 50:43Speaker 2: that gets executed by the server's operating system. Imagine a
- 50:46Speaker 2: website feature that lets you ping another machine and you
- 50:49Speaker 2: provide the IP address. If the website just takes your
- 50:52Speaker 2: input and sticks it into a pin your input command
- 50:55Speaker 2: without cleaning it.
- 50:55Speaker 1: First, you could add other commands precisely.
- 50:57Speaker 2: You could potentially inject os command separators like or and inmplinix,
- 51:01Speaker 2: followed by your own commands like rm rf don't do that,
- 51:04Speaker 2: or something more useful like ncee binch r cali.
- 51:08Speaker 1: Port ncee What's that?
- 51:09Speaker 2: That's a classic NETCIT command to create a reverse show.
- 51:13Speaker 2: It tells the server to execute binch a command prompt
- 51:16Speaker 2: and connect it to input and output back to a
- 51:18Speaker 2: listing port on your CALLAI machine. Instant command line access,
- 51:22Speaker 2: often bypassing firewalls. Again, the fix is rigorous input sanitization.
- 51:27Speaker 1: Okay, file uploads, code execution? What about accessing files on
- 51:31Speaker 1: the server?
- 51:32Speaker 2: That brings us to file inclusion vulnerabilities. There are two
- 51:35Speaker 2: main types, local and remote. Local file inclusion LiFi allows
- 51:39Speaker 2: an attacker to trick the web application into including and
- 51:42Speaker 2: displaying the contents of arbitrary files from the server's filesystem,
- 51:45Speaker 2: files that were never intended to be accessed via the web.
- 51:48Speaker 2: This often happens when a script uses user input to
- 51:51Speaker 2: determine which file to include. GT pages PHP. If you
- 51:55Speaker 2: can manipulate the page parameter in the URL, maybe using
- 51:58Speaker 2: directory curricial sequences like LETT, you could potentially read files
- 52:02Speaker 2: outside the normal web rout.
- 52:03Speaker 1: Like system file exactly yeah.
- 52:05Speaker 2: A classic LiFi demonstration is reading etcter password on a
- 52:08Speaker 2: Linux server to get a list of system users, or
- 52:10Speaker 2: reading application source code or configuration files that might contain
- 52:13Speaker 2: database passwords or other secrets.
- 52:16Speaker 1: And remote file inclusion.
- 52:18Speaker 2: Remote file inclusion RFI is generally much more dangerous, though
- 52:21Speaker 2: less common nowadays due to better default server configurations. RTIFI
- 52:26Speaker 2: occurs when the application allows you to include a file
- 52:29Speaker 2: not just from the local server, but from a completely
- 52:32Speaker 2: different server over the network using a URL, so.
- 52:35Speaker 1: You can make the target website include and execute a
- 52:38Speaker 1: script file hosted on your calling machine precisely.
- 52:40Speaker 2: If RFI is possible, you can usually just point it
- 52:43Speaker 2: to a URL hosting your malicious PHP shell script and
- 52:46Speaker 2: the target server will download and execute it, giving you
- 52:48Speaker 2: immediate code execution. RFI typically requires specific insecure PHP settings
- 52:54Speaker 2: to be enabled, like allowll include and alourel fopen, which
- 52:57Speaker 2: thankfully are often disabled by default.
- 52:59Speaker 1: Now LiFi reads local files, RFI executes remote code. What
- 53:03Speaker 1: about databases? Websites use databases all the time.
- 53:06Speaker 2: Ah. Yes, That leads us to one of the most
- 53:08Speaker 2: widespread and impactful categories of web vulnerabilities. Sql injection scoot
- 53:12Speaker 2: a lie cedicle. Vulnerabilities occur when user supplied input is
- 53:16Speaker 2: incorporated into a database query in an unsafe way, allowing
- 53:19Speaker 2: the attacker to manipulate the structure of the SQL query itself.
- 53:22Speaker 1: So you inject SQL commands through a web form.
- 53:25Speaker 2: Essentially yes, or through parameters in the URL. You discover
- 53:29Speaker 2: potential SQL points, often by injecting special characters like a
- 53:33Speaker 2: single quote or sequel fragments like AD one to on
- 53:36Speaker 2: or AD one zero into input fields or URL parameters.
- 53:40Speaker 2: If the application is vulnerable, these injections will often cause
- 53:44Speaker 2: database errors to be displayed or change the content returned
- 53:47Speaker 2: by the page in predictable ways, confirming that your input
- 53:50Speaker 2: is affecting the SQL query.
- 53:51Speaker 1: What can you do with SQL injection.
- 53:53Speaker 2: Once you find it a lot, It ranges from simple
- 53:56Speaker 2: checks to full database takeover. You can perform authorization bypass
- 54:00Speaker 2: crafting an injection like ar one one was one into
- 54:03Speaker 2: a username or password field might trick the log in
- 54:06Speaker 2: query into always evaluating to true, letting you log in
- 54:08Speaker 2: as an administrator or another user without knowing their actual password.
- 54:12Speaker 1: Log in as admin just like.
- 54:13Speaker 2: That in corely coded applications. Yes. Then you can start
- 54:17Speaker 2: extracting data using SQL union operators. You can combine the
- 54:20Speaker 2: applications intended query with your own select statements. You first
- 54:24Speaker 2: figure out the number of columns the original querer returns.
- 54:27Speaker 2: Then you can inject queries like union select one database
- 54:31Speaker 2: user version five, assuming five columns to retrieve the current
- 54:35Speaker 2: database name, the database username, the application is running as,
- 54:39Speaker 2: and the database software version.
- 54:41Speaker 1: Finding out details about the database itself right.
- 54:44Speaker 2: Knowing the database type and version helps tailor further attacks.
- 54:48Speaker 2: Then you can query the database's internal metadata tables like
- 54:51Speaker 2: information Schema in mysequel to discover the names of all
- 54:54Speaker 2: the tables and columns in the application's database. You might
- 54:57Speaker 2: find tables named users, accounts, credit cards, and then you
- 55:01Speaker 2: can query those tables directly to extract sensitive data like usernames,
- 55:05Speaker 2: hash passwords, which you might be able to crack offline
- 55:07Speaker 2: email addresses, personal details, etc.
- 55:09Speaker 1: Extracting the entire user database through a web form.
- 55:13Speaker 2: It's possible if the vulnerability is severe and not properly mitigated.
- 55:18Speaker 2: In some database configurations, SQL injection can even be used
- 55:21Speaker 2: to read arbitrary files from the server's file system, using
- 55:25Speaker 2: functions like load file, effectively turning in simply flaw into
- 55:29Speaker 2: an LFI flaw, or sometimes even write files leading to
- 55:32Speaker 2: code execution.
- 55:34Speaker 1: This sounds complex to do manually, it.
- 55:36Speaker 2: Can be tedious, yes, That's why there are powerful automated
- 55:40Speaker 2: tools like schoolmap. Schoole Map is an open source penetration
- 55:43Speaker 2: testing tool that automates the process of detecting and exploiting
- 55:47Speaker 2: SQL injection vulnerabilities. You just point it at a suspect
- 55:50Speaker 2: URL and it will automatically test various injection techniques for
- 55:54Speaker 2: different database types MYQL, postgrasschool, MSQL, Oracle, etc. If it
- 55:59Speaker 2: finds an injection point, it can automatically enumerate databases, tables, columns,
- 56:03Speaker 2: extract data, read files, and sometimes even give you an
- 56:05Speaker 2: OS level command show all through the SQL injection vulnerability.
- 56:08Speaker 2: It's an incredibly effective tool.
- 56:10Speaker 1: Wow, SQL injection seems devastating. It really drives home a
- 56:13Speaker 1: point you made earlier.
- 56:14Speaker 2: What all these web vulnerabilities, especially SQL injection and code execution,
- 56:19Speaker 2: fundamentally reveal is that critical principle never trust user input.
- 56:23Speaker 1: Right.
- 56:24Speaker 2: Every single piece of data coming from a user, whether
- 56:27Speaker 2: it's in a URL, a form field, an HTTP head,
- 56:30Speaker 2: or a cookie, must be rigorously validated and sanitized before
- 56:34Speaker 2: it's used by the application, especially before it's included in
- 56:37Speaker 2: a database query, an OS command, or a filepath. Otherwise,
- 56:41Speaker 2: what looks like a benign comment or search query can
- 56:43Speaker 2: become a direct command to your database or server.
- 56:46Speaker 1: Okay, one more major web vulnerability type, cross site SCRIPTINGXSS.
- 56:51Speaker 1: How is this different from things like SQL injection?
- 56:53Speaker 2: XSS is fundamentally different because the injected code, which is
- 56:57Speaker 2: usually JavaScript, executes in the victim user's browser, not on
- 57:00Speaker 2: the server itself.
- 57:01Speaker 1: A client side code injection, not server side exactly.
- 57:04Speaker 2: SCORED affection affects the server's database. Code execution affects the servers.
- 57:09Speaker 2: OS XSS affects the users visiting the vulnerable web page.
- 57:13Speaker 2: There are three main types of XSS. Stored persistent EXSS.
- 57:16Speaker 2: The attacker injects malicious JavaScript code and the web application
- 57:20Speaker 2: stores it in this database VHG product review, a form,
- 57:23Speaker 2: post a user profile. When other users view that stored content,
- 57:27Speaker 2: the malicious script executes in their browsers.
- 57:29Speaker 1: So one injection hits many users.
- 57:32Speaker 2: Potentially Yes, That's why it's often considered the most dangerous type.
- 57:35Speaker 2: Reflected EXSS. The malicious script is injected into the URL
- 57:38Speaker 2: or a form submission, and the server reflects that script
- 57:41Speaker 2: back in the immediate response page. It only executes if
- 57:44Speaker 2: the user clicks on a specifically crafted malicious link, for example,
- 57:47Speaker 2: sent via email or chat.
- 57:48Speaker 1: Only affects users who click the bad link right.
- 57:51Speaker 2: It requires more social engineering to get the victim to
- 57:53Speaker 2: the malicious URL. DOM based XSS. This is a more
- 57:58Speaker 2: subtle variant, where the vulnerability exists entirely in the client
- 58:02Speaker 2: side JavaScript code running on the page. The server might
- 58:05Speaker 2: not even see the malicious script, as the injection and
- 58:07Speaker 2: execution happen purely within the browser's Document Object Model DOM.
- 58:12Speaker 2: These can be harder to detect with server side standers.
- 58:15Speaker 1: What can an attacker do with XSS if it just
- 58:18Speaker 1: runs in the browser.
- 58:19Speaker 2: JavaScript running in a browser context can still do a
- 58:22Speaker 2: lot of damage. It can steal the user session cookies
- 58:25Speaker 2: for that website, allowing the attacker to hijack their logged
- 58:28Speaker 2: in session. It can rewrite parts of the current web
- 58:30Speaker 2: page to display fake log informs or misleading information. It
- 58:34Speaker 2: can redirect the user to malicious websites. It can perform
- 58:36Speaker 2: actions on the website as the logged in user without
- 58:39Speaker 2: their knowledge, eg change their passwords, send messages, transfer funds
- 58:42Speaker 2: if it's a banking site.
- 58:43Speaker 1: Wow. All from injecting script into a page.
- 58:46Speaker 2: And remember BEEF. The Browser Exploitation Framework EXSS is the
- 58:51Speaker 2: perfect way to deliver the BEEF hook. If you find
- 58:54Speaker 2: a stored XSS vulnerability on a popular website, you can
- 58:58Speaker 2: inject the beef hookscript as your PAYOEAD. Then every user
- 59:02Speaker 2: who visits that compromised page gets automatically hooked into your
- 59:05Speaker 2: BEEF console, giving your remote control over the browser session
- 59:08Speaker 2: through all the module's BEEF offers.
- 59:10Speaker 1: That connects the dots nicely. XSS delivers the hook for BEEF.
- 59:13Speaker 2: It's a very common and powerful combination.
- 59:15Speaker 1: So how do websites protect against EXSS?
- 59:18Speaker 2: Again comes down to handling user inputs securely. The main
- 59:22Speaker 2: defense is output encoding or escaping. Whenever usery supplied data
- 59:26Speaker 2: is displayed back on a web page, the application should
- 59:28Speaker 2: escape potentially dangerous HTML characters. For example, the character should
- 59:33Speaker 2: be converted to NELT to NGS to end quote. This
- 59:36Speaker 2: ensures that even if the user injects script exss script,
- 59:39Speaker 2: the browser literally displays that text on the page instead
- 59:42Speaker 2: of interpreting it as executable script tags. Content Security policy
- 59:46Speaker 2: CSP headers are also a powerful defense mechanism, and user
- 59:50Speaker 2: vigilance helps to being wary of suspicious links, checking for HTTPS,
- 59:55Speaker 2: not installing untrusted browser extensions.
- 59:57Speaker 1: Okay, that's an incredible overview of major web bloeulnerabilities. It
- 1:00:01Speaker 1: seems like finding these manually requires a lot of skill
- 1:00:03Speaker 1: and patients. Are there tools to help automate the discovery,
- 1:00:06Speaker 1: similar to squamap for Sooley.
- 1:00:08Speaker 2: Yes, while manual testing is crucial for understanding and finding
- 1:00:11Speaker 2: complex flaws, there are automated web vulnerability scanners. A very
- 1:00:15Speaker 2: popular open source one is OSPZP, which stands for the
- 1:00:19Speaker 2: z Attack Proxy OSPZP.
- 1:00:22Speaker 1: How does it work?
- 1:00:23Speaker 2: ZAP typically runs as a proxy server on your local machine.
- 1:00:27Speaker 2: You can figure your web browser to send all its
- 1:00:29Speaker 2: traffic through the ZA proxy as you browse the target website. Normally,
- 1:00:34Speaker 2: ZAP passively observes all the requests and responses. It can
- 1:00:38Speaker 2: also actively spider the website to discover all its pages
- 1:00:41Speaker 2: and links. Then you can tell ZAP to actively scan
- 1:00:44Speaker 2: the discovered pages for common vulnerabilities like SQL injection, cross
- 1:00:48Speaker 2: site scripting, file inclusion insecure configurations, and many others.
- 1:00:52Speaker 1: So it acts like an automated ethical hacker trying common.
- 1:00:55Speaker 2: Attacks in a way. Yes, it sends crafted requests with
- 1:00:59Speaker 2: attack payloads and analyzes the responses to see if the
- 1:01:02Speaker 2: application behaves in a vulnerable way. ZAP can generate detailed
- 1:01:06Speaker 2: reports outlining the potential risks it found, categorizing them by severity,
- 1:01:10Speaker 2: and often providing the specific URL and parameter that appears
- 1:01:13Speaker 2: to be vulnerable, giving you a great starting point for
- 1:01:16Speaker 2: manual verification and deeper exploitation.
- 1:01:18Speaker 1: So it's a good backup or starting point, but maybe
- 1:01:21Speaker 1: doesn't replace manual testing entirely exactly.
- 1:01:24Speaker 2: Automated scanners like ZAP are excellent for finding low hanging
- 1:01:27Speaker 2: fruit and ensuring broad coverage, but they can miss more
- 1:01:30Speaker 2: complex logic based vulnerabilities that require human understanding of the
- 1:01:34Speaker 2: application's context. They also sometimes produce false positives, so they
- 1:01:39Speaker 2: are best used in conjunction with manual testing, not as
- 1:01:42Speaker 2: a complete replacement.
- 1:01:43Speaker 1: Makes sense. Wow, We have covered a staggering amount of
- 1:01:47Speaker 1: ground in this deep dive. I mean, from setting up
- 1:01:49Speaker 1: virtual hacking labs, understanding the nuances of network attacks like
- 1:01:53Speaker 1: MI spoofing and MITM, the psychology of social engineering client
- 1:01:58Speaker 1: side versus server side exploits, post exploisation, pivoting, and now
- 1:02:02Speaker 1: this whole world of web application vulnerabilities like SEQL and EXSS.
- 1:02:05Speaker 2: It's a lot, definitely, But what I hope stands out
- 1:02:08Speaker 2: to you, the listener, is that ethical hacking isn't just
- 1:02:10Speaker 2: about breaking in for the sake of it. It's really
- 1:02:13Speaker 2: about deeply understanding how these complex systems are built, how
- 1:02:16Speaker 2: the interact, and crucially, how they can fail or be manipulated. Also,
- 1:02:20Speaker 2: they can ultimately be made more resilient and secure.
- 1:02:22Speaker 1: That core lesson seems clear. Knowledge is power, not just
- 1:02:26Speaker 1: for offense, but critically for defense.
- 1:02:28Speaker 2: Precisely understanding the attacker's mindset, tools and techniques is arguably
- 1:02:33Speaker 2: the best way to build effective defenses against them.
- 1:02:35Speaker 1: We explored some incredibly sophisticated tools today metasploit, veil, multigo,
- 1:02:41Speaker 1: beef wireshark, squall, map zap, each one revealing a different
- 1:02:47Speaker 1: facet of this complex digital security landscape. It's honestly a
- 1:02:51Speaker 1: profound reminder that our everyday online interactions, things we take
- 1:02:55Speaker 1: for granted, like browsing a website or logging into an account,
- 1:02:58Speaker 1: involve these intricate layers of technolog layers that can be misunderstood, misconfigured,
- 1:03:03Speaker 1: or actively exploited.
- 1:03:04Speaker 2: And that naturally leads to an important question. I think,
- 1:03:07Speaker 2: considering how deeply interconnected our digital lives are now and
- 1:03:10Speaker 2: seeing how these vulnerabilities work, how might a deeper understanding
- 1:03:14Speaker 2: of these threats encourage you personally or professionally to approach
- 1:03:17Speaker 2: your own cybersecurity differently, maybe moving beyond just the basic
- 1:03:20Speaker 2: precautions like using strong passwords towards a more informed, maybe
- 1:03:24Speaker 2: more proactive stance. Something to think about.
- 1:03:26Speaker 1: Ah, that's a perfect closing thought, A challenge really for
- 1:03:29Speaker 1: all of us. Thanks for diving deep with us today
- 1:03:32Speaker 1: into the world of ethical hacking. It's been truly enlightening.
- 1:03:35Speaker 1: Until next time, stay curious, stay informed, and most importantly,
- 1:03:38Speaker 1: stay secure.