Latest / CyberCode Academy / Course 43 - Practical Malware Development | Episode 1: Building Your Virtual Sandbox
Transcript
- 0:00Speaker 1: So imagine for a second that you're writing a piece
- 0:03Speaker 1: of code, right?
- 0:04Speaker 2: Right.
- 0:05Speaker 1: And it intentionally acts like ransomware. Or maybe you're downloading
- 0:09Speaker 1: some super suspicious JEC executable that you need to reverse engineer.
- 0:13Speaker 2: Oh, yeah. That is always a stressful moment if you're
- 0:15Speaker 2: not prepared for it.
- 0:16Speaker 1: Exactly. Because if you execute that thing on your primary machine,
- 0:20Speaker 1: I mean, you're risking catastrophic data loss. But if you
- 0:24Speaker 1: detonate it inside a strictly isolated sandbox, like a virtual machine,
- 0:28Speaker 1: you can just sit back, watch it dismantle the operating system,
- 0:31Speaker 1: take all your notes, and then literally just hit a
- 0:33Speaker 1: reset button.
- 0:34Speaker 2: Right, and it instantly restores the environment back to this
- 0:37Speaker 2: pristine condition. It's like magic.
- 0:39Speaker 1: It really is. So welcome to this deep dive, everyone. Today,
- 0:41Speaker 1: we are walking you through the complete architecture of setting
- 0:44Speaker 1: up a dual environment development sandbox. We're going to build
- 0:48Speaker 1: one Windows instance and one Ubuntu Linux instance.
- 0:50Speaker 2: Yeah, and the ultimate goal here is to prep you
- 0:53Speaker 2: for building and testing desktop applications and server-side web applications too.
- 0:58Speaker 2: And the best part is it's all completely sandboxed on
- 1:01Speaker 2: your existing hardware. You don't need a whole server rack
- 1:04Speaker 2: for this.
- 1:04Speaker 1: Which is huge. So before we build this sort of
- 1:08Speaker 1: computer within a computer, what are the actual physical building
- 1:12Speaker 1: blocks we need to get started? Because that sandboxing aspect
- 1:15Speaker 1: is critical for any serious development workflow.
- 1:19Speaker 2: It's totally critical. So we are utilizing type 2 hypervisors today. Um,
- 1:23Speaker 2: just for anyone who might be a little rusty on
- 1:25Speaker 2: the topology, a type two hypervisor basically runs as an
- 1:28Speaker 2: application right on top of your existing host operating system.
- 1:32Speaker 1: Wait, as opposed to a type one, which goes straight
- 1:34Speaker 1: on the bare metal. Exactly.
- 1:35Speaker 2: Yeah. Type one installs directly on the bare metal of
- 1:37Speaker 2: a server, but by using a type two hypervisor on
- 1:40Speaker 2: your laptop, we're basically creating a software abstraction layer. It
- 1:45Speaker 2: tricks the guest operating systems into thinking they have their
- 1:48Speaker 2: own dedicated physical hardware.
- 1:49Speaker 1: Like they think they have their own real CPU and
- 1:52Speaker 1: RAM and storage.
- 1:53Speaker 2: Right. They think they're running the show. When in reality,
- 1:56Speaker 2: the hypervisor is just dynamically translating all their requests and,
- 2:00Speaker 2: you know, passing them down to your physical laptop's actual hardware.
- 2:03Speaker 1: Oh, wow. Okay. Which I guess brings us to the
- 2:07Speaker 1: actual software we're using to handle that abstraction layer. Mm-hmm.
- 2:11Speaker 1: Because we've got two primary options in the virtualization space
- 2:14Speaker 1: for this kind of local development, right? VirtualBox and VMware.
- 2:18Speaker 2: Yeah, those are the big two.
- 2:20Speaker 1: And I know VirtualBox is like the classic open source choice.
- 2:24Speaker 1: It's heavily relied upon because it has this massive community.
- 2:27Speaker 2: Yeah.
- 2:27Speaker 1: And you can script it super easily with tools like Vagrant.
- 2:30Speaker 1: But I don't know, VMware has always felt a bit
- 2:33Speaker 1: more performant to me when handling things like graphics rendering
- 2:37Speaker 1: or complex networking.
- 2:38Speaker 2: Yeah, you're not wrong there. That performance difference usually comes
- 2:41Speaker 2: down to how their respective hypervisor engines handle things like
- 2:44Speaker 2: memory ballooning and CPU scheduling. I mean, VirtualBox is fantastic
- 2:49Speaker 2: because it's free and ubiquitous. Right.
- 2:51Speaker 1: Everyone has used it at some point. Exactly.
- 2:54Speaker 2: But VMware, specifically VMware Fusion for Mac users and the
- 2:58Speaker 2: free VM player for Windows users... It often has a
- 3:02Speaker 2: slightly more optimized set of proprietary drivers for hardware accelerators.
- 3:06Speaker 1: Okay, so wait, for the VMware software, you mentioned Fusion
- 3:09Speaker 1: for Mac and VM Player for Windows, but can I
- 3:12Speaker 1: just use VirtualBox regardless of my setup?
- 3:14Speaker 2: Oh yeah, absolutely. The choice really just comes down to
- 3:18Speaker 2: your personal workflow. Both options are trivial to install from
- 3:22Speaker 2: their official websites. You basically just click next a bunch
- 3:24Speaker 2: of times. And neither one restricts the core functionality we
- 3:28Speaker 2: need to build this dual OS environment.
- 3:30Speaker 1: Good to know. Because, I mean, the hypervisor is really
- 3:33Speaker 1: just the engine, right? The real architectural choices start when
- 3:36Speaker 1: we actually select our guest operating systems.
- 3:38Speaker 2: Precisely. You have to gather your raw materials, which are
- 3:40Speaker 2: your operating system images. Right.
- 3:42Speaker 1: The ISO files. So let's get into those choices, starting
- 3:44Speaker 1: with the Windows environment. Because we are pulling a Windows
- 3:47Speaker 1: 10 ISO from Microsoft's official site. And actually, here's a
- 3:51Speaker 1: funny quirk from the notes. Sometimes the Microsoft page might
- 3:55Speaker 1: randomly default to another language, like Turkish.
- 3:58Speaker 2: Oh, yeah. I've seen that happen. You just swap it
- 3:59Speaker 2: back to English. No big deal.
- 4:00Speaker 1: Yeah, just a weird little glitch. But looking through our
- 4:03Speaker 1: setup notes, there's a really specific constraint here. We are
- 4:07Speaker 1: intentionally selecting the 32-bit architecture for this Windows 10 download.
- 4:11Speaker 1: And I have to admit, that feels super counterintuitive. I know.
- 4:14Speaker 2: It really does sound like a step backward.
- 4:16Speaker 1: Right, because almost every modern physical machine out there is 64-bit.
- 4:21Speaker 1: Why on earth would we bottleneck our virtual development environment
- 4:26Speaker 1: with a 32-bit OS?
- 4:28Speaker 2: Well, it's actually a very deliberate resource management strategy. You
- 4:32Speaker 2: have to remember the fundamental constraint of a 32-bit operating system.
- 4:36Speaker 2: It has a hard limit on memory addressing, so it
- 4:39Speaker 2: can only recognize up to 4 gigabytes of RAM.
- 4:41Speaker 1: Okay, but why is having a hard limit an advantage here?
- 4:44Speaker 2: Because a 64-bit operating system uses 64-bit memory pointers. That
- 4:49Speaker 2: means every single memory reference takes up literally twice as
- 4:52Speaker 2: much space in RAM compared to a 32-bit system.
- 4:55Speaker 1: Oh, I see. So it's just heavier by default.
- 4:57Speaker 2: Exactly. A 64-bit OS inherently demands a much higher baseline
- 5:01Speaker 2: of memory just to sit there and idle. And since
- 5:04Speaker 2: we want to keep our virtual machines lightweight so they
- 5:06Speaker 2: don't starve the host computer, we really want a leaner footprint.
- 5:10Speaker 1: That makes a ton of sense. So by utilizing the
- 5:13Speaker 1: 32-bit version, we strip away all that 64-bit memory overhead.
- 5:16Speaker 2: Right. Resulting in a much more responsive VM when you're
- 5:19Speaker 2: operating under strict memory constraints.
- 5:21Speaker 1: Okay. Yeah. We're basically trading massive memory capacity, which we
- 5:24Speaker 1: don't even need for a simple sandbox anyway, for actual
- 5:27Speaker 1: operational efficiency.
- 5:28Speaker 2: You nailed it.
- 5:29Speaker 1: Awesome. So that brings us to our second operating system,
- 5:31Speaker 1: which is Linux. For our server-side web applications, we are
- 5:36Speaker 1: pulling an Ubuntu ISO. But again, there's a really specific
- 5:41Speaker 1: versioning constraint here. We aren't just going to releases.ubuntu.com to
- 5:45Speaker 1: grab the shiny new version at the very top of
- 5:47Speaker 1: the page.
- 5:48Speaker 2: No, definitely not.
- 5:49Speaker 1: We are specifically targeting version 18.04. Yeah, and this is such.
- 5:53Speaker 2: A crucial lesson in server-side development. When you deploy web
- 5:56Speaker 2: applications out in the real world, you are usually deploying
- 5:59Speaker 2: them to enterprise servers. And those servers prioritize rock-solid stability over,
- 6:06Speaker 2: you know, cutting-edge features.
- 6:07Speaker 1: Right, they can't afford to just crash because of a
- 6:09Speaker 1: fancy new update.
- 6:10Speaker 2: Exactly. Ubuntu 18.04 is an LTS release. That stands for
- 6:16Speaker 2: Long-Term Support. If we were to download the absolute newest
- 6:20Speaker 2: non-LTS version, we might run into bleeding-edge package updates or...
- 6:25Speaker 2: slightly altered file system structures, or even deprecated Python libraries. Oh, man.
- 6:30Speaker 1: Which completely leads to dependency hell, right? Like when your
- 6:33Speaker 1: local environment works totally fine, but then the production server
- 6:35Speaker 1: just crashes because it's running older, more stable libraries.
- 6:38Speaker 2: Yes, precisely. Dependency hell is exactly what we are trying
- 6:42Speaker 2: to avoid. You always want your development sandbox to mirror
- 6:45Speaker 2: standard production environments as closely as possible.
- 6:47Speaker 1: So version 18.04 just gives us predictable, heavily documented behavior.
- 6:52Speaker 2: Right. If you hit a bug while coding your server-side app,
- 6:56Speaker 2: you want to be absolutely sure that the bug is
- 6:59Speaker 2: actually in your code and not just some weird quirk
- 7:02Speaker 2: of a brand new experimental OS kernel.
- 7:04Speaker 1: Okay. So we've got our tools and our ISOs downloaded.
- 7:08Speaker 1: Now we actually have to construct the machines. Let's talk
- 7:11Speaker 1: about hardware allocation because I feel like this is where
- 7:13Speaker 1: the Type 2 hypervisor really earns its keep. We need
- 7:17Speaker 1: to dictate how much of our physical laptop's hardware is
- 7:21Speaker 1: gets cordoned off for these VMs.
- 7:23Speaker 2: Yeah, you're carving out physical resources from the main laptop, essentially. Right.
- 7:27Speaker 1: So our baseline requirement for this setup, if I'm looking
- 7:31Speaker 1: at this correctly, is allocating at least three gigabytes of
- 7:34Speaker 1: RAM and four processing cores.
- 7:36Speaker 2: Yes. And that RAM allocation ties perfectly back to our
- 7:39Speaker 2: whole 32-bit Windows discussion earlier. Giving the VM three gigabytes
- 7:43Speaker 2: of RAM fits really comfortably under that 32-bit maximum threshold.
- 7:47Speaker 1: Oh, right, because the limit was four gigs.
- 7:49Speaker 2: Exactly. But you have to balance this really carefully with
- 7:52Speaker 2: your host system. Think of it like subletting an apartment
- 7:55Speaker 2: in your computer's brain, you know?
- 7:56Speaker 1: I love that analogy. You have to give the tenant
- 7:58Speaker 1: enough room so they can live comfortably without totally starving
- 8:01Speaker 1: the landlord. Exactly.
- 8:03Speaker 2: If your physical laptop only has, say, 8 gigabytes of
- 8:06Speaker 2: RAM total, and you assign 3 to Windows and 3
- 8:09Speaker 2: to Ubuntu, and then you try to run them both simultaneously, well,
- 8:13Speaker 2: your host operating system is left with just 2 gigabytes.
- 8:16Speaker 1: Oh, yikes. Which means the host OS is going to
- 8:19Speaker 1: start thrashing. It'll just desperately start paging active memory over
- 8:24Speaker 1: to the physical hard drive, which is What, exponentially slower
- 8:28Speaker 1: than RAM?
- 8:28Speaker 2: Oh, incredibly slower. Your entire system, both the host and
- 8:32Speaker 2: the VMs, will basically just grind to an absolute halt.
- 8:36Speaker 2: It is the ultimate bottleneck in local virtualization.
- 8:39Speaker 1: Wow, okay. So how do we fix that?
- 8:41Speaker 2: Well, hypervisors do have some mitigation strategies, like memory ballooning. Basically,
- 8:45Speaker 2: the hypervisor can actively monitor the guest OS, and if
- 8:48Speaker 2: the guest isn't actively utilizing all three of its allocated gigabytes...
- 8:52Speaker 2: the hypervisor can transparently reclaim some of that memory to
- 8:55Speaker 2: keep the host OS breathing.
- 8:57Speaker 1: Oh, that's clever. But I'm guessing you probably shouldn't just
- 8:59Speaker 1: rely purely on ballooning to save you.
- 9:02Speaker 2: No, definitely not. You always have to monitor your physical constraints.
- 9:05Speaker 1: Okay, so that's RAM. What about the CPU allocation? We
- 9:08Speaker 1: are assigning four processors. How does the hypervisor even schedule
- 9:13Speaker 1: that if my physical laptop only has, let's say, four
- 9:17Speaker 1: physical cores to begin with?
- 9:19Speaker 2: That's a great question, and it's super important to differentiate
- 9:21Speaker 2: between virtual cores and physical cores here. When you assign
- 9:25Speaker 2: four processors to the VM in those settings, you are
- 9:28Speaker 2: really just giving the virtual operating system the ability to
- 9:31Speaker 2: run four concurrent threads.
- 9:33Speaker 1: Okay, so it's not literally taking over the physical core.
- 9:36Speaker 2: Right. The hypervisor still has to pass those threads down
- 9:39Speaker 2: to the physical CPU scheduler. So even if you only
- 9:41Speaker 2: have four physical cores total, the CPU uses time slicing
- 9:45Speaker 2: to rapidly switch between the host threads and the VM's threads.
- 9:49Speaker 1: I see. So it's happening so fast, it just feels concurrent.
- 9:51Speaker 1: But why exactly four? Why not just give it one
- 9:54Speaker 1: virtual core and be done with it?
- 9:55Speaker 2: Because modern operating systems, even if they're just sitting completely
- 9:59Speaker 2: idle on a desktop, they run dozens of background services.
- 10:03Speaker 2: If you restrict it to a single core, the OS
- 10:06Speaker 2: scheduler gets backlogged almost immediately and your UI response time
- 10:10Speaker 2: just plummets.
- 10:11Speaker 1: It gets all laggy and unusable.
- 10:12Speaker 2: Exactly.
- 10:13Speaker 1: Okay, so wait, do we do this exact same hardware
- 10:15Speaker 1: allocation thing for the Ubuntu setup too?
- 10:17Speaker 2: Yep, absolutely. The exact same procedures apply to get the
- 10:21Speaker 2: Ubuntu environment set up. You want that minimum of three
- 10:25Speaker 2: kilobytes of RAM and four processors for both.
- 10:27Speaker 1: Got it. So we configure the resources, we attach the
- 10:30Speaker 1: ISO files, and we boot it up. Now, the installation
- 10:33Speaker 1: process itself for both Windows and Ubuntu is, I mean,
- 10:36Speaker 1: it's incredibly standard. You just select your language. Time zone,
- 10:40Speaker 1: you partition the virtual disk.
- 10:41Speaker 2: Yeah, it's mostly just hitting next a bunch of times.
- 10:44Speaker 2: Although creating a solid naming convention for your VMs right
- 10:47Speaker 2: here is actually really crucial, especially once you start spinning
- 10:49Speaker 2: up multiple instances.
- 10:51Speaker 1: Oh, for sure. Like naming it Windows 10 Ebox or something,
- 10:53Speaker 1: so you keep your inventory organized. But okay, let's just
- 10:56Speaker 1: skip past all those loading progress bars and look at
- 10:59Speaker 1: the state of the machines once they finally hit the desktop.
- 11:02Speaker 1: Because out of the box, they're completely quarantined.
- 11:05Speaker 2: Oh, they are heavily isolated, which, to be fair, is
- 11:09Speaker 2: the default security posture of any virtual machine. The hypervisor
- 11:13Speaker 2: traps that guest OS within a really strict boundary.
- 11:16Speaker 1: Yeah, I've noticed that like the mouse might not seamlessly
- 11:18Speaker 1: track out of the VM window and the display resolution
- 11:21Speaker 1: is usually locked to this tiny basic default square. Plus,
- 11:26Speaker 1: there is a total air gap between your host file
- 11:28Speaker 1: system and the guest file system.
- 11:30Speaker 2: Right, which is secure, yes, but it's a completely terrible
- 11:33Speaker 2: user experience for a developer.
- 11:35Speaker 1: Oh, it's the worst. If I have a piece of
- 11:36Speaker 1: code on my host machine, I want to be able
- 11:38Speaker 1: to just, you know, paste it into the VM without
- 11:41Speaker 1: routing it through some cloud drive or emailing it to myself.
- 11:44Speaker 2: Exactly. So to break that quarantine safely, of course we
- 11:47Speaker 2: have to apply the finishing touch. We have to install
- 11:50Speaker 2: what VirtualBox calls guest additions, or what VMware calls VMware tools.
- 11:55Speaker 1: So what are these exactly? We are essentially installing specialized
- 11:59Speaker 1: kernel modules, right?
- 12:00Speaker 2: Yeah, basically, yeah. You're installing drivers that allow the guest
- 12:03Speaker 2: OS to communicate directly with the hypervisor. This communication channel
- 12:07Speaker 2: is known as para-virtualization.
- 12:09Speaker 1: Para-virtualization. Okay, break that down for me.
- 12:12Speaker 2: Sure. Normally, a guest OS has no idea it's virtualized.
- 12:15Speaker 2: It just sends standard hardware requests into the void. But
- 12:19Speaker 2: when you install these guest additions... you are injecting drivers
- 12:23Speaker 2: into the guest operating system that are actually hypervisor aware.
- 12:27Speaker 2: They bridge the gap.
- 12:28Speaker 1: Okay, so this is what unlocks all those massive features
- 12:31Speaker 1: we want.
- 12:31Speaker 2: Right.
- 12:32Speaker 1: Like dynamic full screen resolution.
- 12:34Speaker 2: Right. So when you drag the VM window to resize it,
- 12:38Speaker 2: the hypervisor can finally tell the guest OS to instantly
- 12:41Speaker 2: update its display drivers to match the new window size.
- 12:44Speaker 1: That is so cool. And it also enables drag and
- 12:46Speaker 1: drop file sharing between the host and the VM, right?
- 12:48Speaker 2: Yes, and hypervisor Honestly, most importantly for developers, it gives
- 12:51Speaker 2: you a synchronized shared clipboard.
- 12:54Speaker 1: Being able to copy and paste is a lifesaver. Now,
- 12:58Speaker 1: the installation of these pair of virtualization drivers is drastically
- 13:02Speaker 1: different depending on the OS. For Windows, it's almost trivially easy.
- 13:06Speaker 2: Oh, yeah, it takes two seconds.
- 13:08Speaker 1: Under the virtual machine menu, you just trigger the install
- 13:11Speaker 1: guest additions command. And if you don't see it, you
- 13:13Speaker 1: just poke around the menus until you find it. That
- 13:15Speaker 1: virtually mounts an ISO into the Windows CD drive. You
- 13:18Speaker 1: just run the setup.exe file, click next a few times, reboot,
- 13:22Speaker 1: and bam, the drivers are loaded.
- 13:24Speaker 2: Super simple.
- 13:25Speaker 1: But Linux.
- 13:26Speaker 2: Yeah.
- 13:27Speaker 1: Linux handles this very differently. And this actually really highlights
- 13:30Speaker 1: a core philosophical difference between the two operating systems.
- 13:33Speaker 2: It really does. Windows abstracts all the system administration away
- 13:36Speaker 2: from the user to make it easy. But Linux forces
- 13:39Speaker 2: you to interact with the underlying mechanics.
- 13:41Speaker 1: Yeah, it's way more hands-on. So walk me through this
- 13:44Speaker 1: Ubuntu process, because this is the trippy part.
- 13:46Speaker 2: Okay, so when you tell the hypervisor to install VMware
- 13:50Speaker 2: tools for the Ubuntu VM, you are again just mounting
- 13:54Speaker 2: a virtual CD. But in Linux, you often have to
- 13:57Speaker 2: mount and execute it completely manually. First off, you might
- 14:00Speaker 2: even find the install option is just grayed out in
- 14:03Speaker 2: your hypervisor menu.
- 14:04Speaker 1: Yes, I've run into this. The button is completely unclickable.
- 14:08Speaker 1: Why does it do that?
- 14:10Speaker 2: It usually means the Linux kernel has placed a lock
- 14:12Speaker 2: on the virtual optical drive, or maybe it just failed
- 14:15Speaker 2: to automatically mount the previous state.
- 14:17Speaker 1: So how do you fix it?
- 14:19Speaker 2: You have to actually power down the VM, go into
- 14:21Speaker 2: the hypervisor's hardware settings at the top menu, manually disconnect
- 14:25Speaker 2: the virtual CD and DVD drive, and if it's already connected,
- 14:28Speaker 2: you disconnect it and reconnect it just to force a
- 14:31Speaker 2: state refresh and then boot back up.
- 14:32Speaker 1: Okay, so once you clear that weird mounting hurdle, you
- 14:35Speaker 1: click install, and the virtual CD finally appears on your
- 14:38Speaker 1: Ubuntu desktop. and inside is a. tar file.
- 14:42Speaker 2: Right, so you need to drag that archive file onto
- 14:44Speaker 2: your local Ubuntu desktop, open up your terminal, navigate to
- 14:47Speaker 2: the desktop directory, and extract it.
- 14:49Speaker 1: Okay, so you extract the. tar file on the desktop,
- 14:51Speaker 1: you go into the extracted folder, find the installation script.
- 14:55Speaker 1: But wait, we can't just run it normally, right? No.
- 14:57Speaker 1: We have to execute it with sudo superuser privileges. Then
- 15:01Speaker 1: you press the Enter key a bunch of times to
- 15:03Speaker 1: accept the defaults, and finally reboot. But that Ubuntu process...
- 15:08Speaker 1: Sounds wild compared to the Windows 1, extracting tar files
- 15:11Speaker 1: on the desktop and running super-user scripts. Why is Linux
- 15:15Speaker 1: so protective over running a simple driver installation script?
- 15:19Speaker 2: Well, because it's not just a simple script, you know?
- 15:21Speaker 2: It's actively modifying the kernel. In a modern operating system,
- 15:24Speaker 2: you basically have user space and kernel space.
- 15:27Speaker 1: Yeah, what's the difference?
- 15:28Speaker 2: User space is where your web browser and your text
- 15:30Speaker 2: editors live. It's safe. But kernel space, which is known
- 15:33Speaker 2: as ring zero... is where the OS interacts directly with
- 15:36Speaker 2: the hardware, or in our case, the hypervisor. Linux is
- 15:40Speaker 2: designed with this strict privilege separation to prevent malware from
- 15:44Speaker 2: just modifying system-level behavior.
- 15:46Speaker 1: Ah, I get it. Because if any random user space
- 15:49Speaker 1: program could just inject a kernel module, your entire system
- 15:53Speaker 1: would be instantly compromised the second you ran a malicious script.
- 15:56Speaker 2: Exactly. The guest additions require kernel-level access, so they can
- 16:00Speaker 2: intercept display protocols and modify the clipboard daemon. By forcing
- 16:04Speaker 2: you to use sudo, the Linux kernel is demanding explicit
- 16:08Speaker 2: cryptographic authorization from you, the system administrator. It's basically making
- 16:12Speaker 2: you say, I understand that this script is going to
- 16:15Speaker 2: alter the core communication layer of this operating system, and
- 16:18Speaker 2: I am officially authorizing it.
- 16:20Speaker 1: That is fascinating. So you run the script as super user,
- 16:23Speaker 1: except those default module configurations and reboot. And once that
- 16:27Speaker 1: reboot hits, wow, you have a completely seamless environment.
- 16:32Speaker 2: It's beautiful, isn't it?
- 16:33Speaker 1: It really is. You can have your code editor open
- 16:35Speaker 1: on your Mac or PC, copy a block of logic,
- 16:38Speaker 1: drag your mouse seamlessly into the full screen Ubuntu VM,
- 16:41Speaker 1: and paste it directly into your server configuration.
- 16:44Speaker 2: And it feels like one unified machine. But underneath, you
- 16:47Speaker 2: know you are routing commands through a hypervisor, you're managing
- 16:51Speaker 2: segmented memory allocation, and you're executing parallel kernels.
- 16:54Speaker 1: It is a truly remarkable piece of software engineering. And
- 16:59Speaker 1: having this architecture running locally just gives you incredible freedom.
- 17:02Speaker 1: I mean, you can snapshot the entire VM state, attempt
- 17:06Speaker 1: some dangerous configuration change on your server application, and if
- 17:11Speaker 1: it completely breaks the OS.
- 17:12Speaker 2: You just roll back the hypervisor state to the snapshot
- 17:15Speaker 2: you took three seconds prior?
- 17:16Speaker 1: Exactly. It fundamentally changes how aggressive you can be with
- 17:19Speaker 1: your testing. You just aren't afraid of breaking things anymore.
- 17:21Speaker 2: No, you're invincible in the sandbox.
- 17:24Speaker 1: So true. All right, before we wrap this architecture breakdown,
- 17:26Speaker 1: I want to pose a quick review exercise for you,
- 17:28Speaker 1: the listener. just to sort of solidify these technical requirements
- 17:32Speaker 1: we talked about. So first question, test your memory from
- 17:35Speaker 1: today's deep dive. Based on our discussion of memory address space,
- 17:39Speaker 1: what were the minimum hardware requirements we needed to carve
- 17:42Speaker 1: out for our Windows 10 virtual machine? And why did
- 17:45Speaker 1: we specifically select the 32-bit architecture?
- 17:49Speaker 2: Well, the answer there is we needed 3GB of RAM
- 17:52Speaker 2: and four processors. And we chose 32-bit because it operates
- 17:56Speaker 2: with a smaller memory footprint, which aligns perfectly with that
- 17:59Speaker 2: constrained 3-gigabyte RAM allocation, completely avoiding the heavy baseline overhead
- 18:04Speaker 2: of 64-bit pointers.
- 18:06Speaker 1: Spot on. Okay, second question. What are the three specific
- 18:09Speaker 1: superpowers that installing guest additions gives your new virtual environment?
- 18:13Speaker 1: And why did the Ubuntu terminal demand we use super-ruser
- 18:16Speaker 1: privileges to install them?
- 18:18Speaker 2: The three superpowers are drag-and-drop file sharing, a shared clipboard,
- 18:22Speaker 2: and dynamic full-screen mode. And it demanded super-user privileges because
- 18:27Speaker 2: guest additions are para-virtualization drivers that must be compiled and
- 18:31Speaker 2: injected directly into the Linux kernel space to bridge that
- 18:34Speaker 2: communication gap with the hypervisor.
- 18:36Speaker 1: Awesome. Well, that basically covers the core of our dual-environment
- 18:39Speaker 1: sandbox build. You are now officially ready to start coding, breaking,
- 18:43Speaker 1: and restoring.
- 18:43Speaker 2: Yeah, you've got a fully operational lab now. But as
- 18:46Speaker 2: you spin up these environments, I actually want to leave
- 18:48Speaker 2: you with a slightly more advanced security concept to explore
- 18:51Speaker 2: on your own.
- 18:52Speaker 1: Oh, lay on us.
- 18:53Speaker 2: So we set this up for application development, right? But
- 18:57Speaker 2: think about the security implications of this sandbox we just built.
- 19:01Speaker 2: We discussed how hypervisors isolate the guest from the host.
- 19:05Speaker 2: and how guest additions punch these controlled little holes through
- 19:08Speaker 2: that isolation for file sharing and clipboard access. Well, consider
- 19:12Speaker 2: the concept of a VM escape vulnerability. Because a virtual
- 19:16Speaker 2: machine is just an isolated emulation, what happens if you
- 19:19Speaker 2: accidentally or intentionally download a really nasty virus while inside it?
- 19:24Speaker 2: Is it theoretically possible for sophisticated malware to exploit the
- 19:28Speaker 2: hypervisor's shared memory processes, break out of the virtual machine entirely,
- 19:33Speaker 2: and execute code on your real physical host laptop.
- 19:36Speaker 1: Wait, really? Does the computer within a computer actually protect
- 19:39Speaker 1: your real machine in that scenario?
- 19:40Speaker 2: It's a terrifying and absolutely brilliant area of cybersecurity research
- 19:44Speaker 2: to look into, especially now that you understand exactly how
- 19:47Speaker 2: the walls of the sandbox are constructed. Wow.
- 19:50Speaker 1: A completely isolated environment. Well, until it isn't. That is
- 19:54Speaker 1: a fascinating layer of cybersecurity to explore. Keep your hypervisors updated,
- 19:58Speaker 1: keep experimenting in your new labs, and we will catch
- 20:00Speaker 1: you on the next Deep Dive.