Latest / CyberCode Academy / Course 18 - Evading IDS Firewalls and Honeypots | Episode 3: Network Emulation and Security Defense: Deploying Cisco ASA and Kali Linux
Transcript
- 0:00Speaker 1: So if you've ever wanted to get your hands dirty
- 0:02Speaker 1: with real enterprise level network security, I mean the kind
- 0:06Speaker 1: of stuff that protects massive companies, you immediately hit this
- 0:10Speaker 1: huge wall, right the hardware.
- 0:12Speaker 2: Yeah, multimillion dollar wall. You can't just go out and
- 0:14Speaker 2: buy a Cisco Asa for your home lab to practice on.
- 0:17Speaker 2: They're incredibly expensive.
- 0:18Speaker 1: Exactly, And that's really the problem we're tackling in this
- 0:21Speaker 1: deep dive. How do you get that experience?
- 0:24Speaker 2: Well, the answer is a tool called GNS three, the
- 0:26Speaker 2: Graphical Network Simulator, and it completely solves that hardware problem,
- 0:33Speaker 2: and it does it in a way that feels incredibly.
- 0:36Speaker 1: Real, And that real part is what's so important here.
- 0:38Speaker 1: This isn't just you know, drawing diagrams with placeholders, not
- 0:41Speaker 1: at all.
- 0:42Speaker 2: GNS three is what professionals use, network architects, security testers.
- 0:46Speaker 2: They rely on it because it runs the actual device code,
- 0:49Speaker 2: the real operating system, just pulled from a physical device
- 0:52Speaker 2: and run in an emulator.
- 0:53Speaker 1: So you're getting genuine hands on experience without the quarter
- 0:58Speaker 1: million dollar price tag o case. So here's our mission
- 1:00Speaker 1: for today. We're going to use GNS three to build
- 1:03Speaker 1: a secure network from scratch. We'll install and configure a
- 1:07Speaker 1: Cisco ASA firewall to find security zones like a DMZ
- 1:12Speaker 1: and a secure zone, and then we're going to try
- 1:16Speaker 1: and break it.
- 1:16Speaker 2: We're going to attack it. Yeah.
- 1:17Speaker 1: See, if our defense is hold up, it's a lot
- 1:19Speaker 1: to cover, but it'll give you a fantastic roadmap for
- 1:21Speaker 1: secure networking. So let's jump in.
- 1:23Speaker 2: Let's do it.
- 1:24Speaker 1: So before we can secure anything, we need the lab.
- 1:27Speaker 1: We fire up GNS three. What is it about its
- 1:30Speaker 1: architecture that makes it so good for this kind of work.
- 1:33Speaker 2: Well, the amazing thing is it's scope. It's not just
- 1:36Speaker 2: for Cisco. It supports Juniper Linux, pretty much any virtual
- 1:39Speaker 2: machine you can throw at it. But its real strength
- 1:42Speaker 2: is how it can connect to the real world.
- 1:44Speaker 1: What do you mean by that?
- 1:45Speaker 2: Your virtual network You can actually bridge it out to
- 1:47Speaker 2: the physical Internet or connect it to a real switch
- 1:50Speaker 2: sitting on your desk. It just it blurs that line
- 1:53Speaker 2: between the simulation and reality.
- 1:55Speaker 1: That's incredible.
- 1:56Speaker 2: Yeah, and for really big networks you'd run it with
- 1:58Speaker 2: a dedicated server, but for our purposes, the all in
- 2:01Speaker 2: one application is perfect.
- 2:03Speaker 1: Okay, Now you mentioned there's a specific technical thing we
- 2:06Speaker 1: need to keep in mind, right about the version.
- 2:08Speaker 2: Right and This is a key tip. Because we're using
- 2:11Speaker 2: a very specific and slightly older image of the Cisco ASA.
- 2:15Speaker 2: We need to match it to a compatible version of
- 2:18Speaker 2: GNS three. For this setup, it's version one point four
- 2:21Speaker 2: point six. That's a common thing in emulation. You have
- 2:24Speaker 2: to match the tool to the code to get stability.
- 2:27Speaker 1: Makes sense. Okay, so we've got the program running. I'm
- 2:29Speaker 1: looking at the main workspace. You've got this big canvas
- 2:33Speaker 1: in the middle and a toolbar on the left with
- 2:35Speaker 1: all the gear, routers, switches, PCs.
- 2:38Speaker 2: Yep, you can just drag and drop.
- 2:39Speaker 1: Let's try. I'll drag two virtual PCs and a simple
- 2:43Speaker 1: hub onto the canvas. Then I'll use the linking tool
- 2:45Speaker 1: to connect them up.
- 2:46Speaker 2: Okay, now, just start the devices and you can open
- 2:49Speaker 2: up a console window for each one, right and.
- 2:51Speaker 1: From here it's just like a real machine. I'll configure
- 2:53Speaker 1: a simple IP address on each PC and then let's
- 2:56Speaker 1: test it with a pink command and.
- 2:58Speaker 2: You should see a successful reply.
- 2:59Speaker 1: And there it is. We have a basic working network.
- 3:03Speaker 1: Simple as that.
- 3:04Speaker 2: Simple as that. But now for the interesting part.
- 3:06Speaker 1: The real hardware. As you said, GNS three gives you
- 3:09Speaker 1: the generic stuff. But if we want a real Cisco router.
- 3:12Speaker 1: We need its brain right, the operating system image.
- 3:15Speaker 2: Exactly, and this is where it can get a little tricky.
- 3:18Speaker 2: To get the latest, fully authorized Cisco images, you typically
- 3:21Speaker 2: need a very expensive support contract with them.
- 3:24Speaker 1: Which brings us back to square.
- 3:25Speaker 2: One kind of. But luckily for educational purposes there are
- 3:28Speaker 2: repositories and sights where you can find templates and older
- 3:31Speaker 2: binary images. For today, we're using a well known image
- 3:34Speaker 2: for a Sisto three seven forty five router and the
- 3:37Speaker 2: specific files for an ASA eight point four point two.
- 3:41Speaker 2: Finding these is sort of the secret hand shape to
- 3:43Speaker 2: get into enterprise level testing for free.
- 3:46Speaker 1: Okay, so once we have that binary file for the
- 3:48Speaker 1: router importing, it looks pretty straightforward in the preferences menu.
- 3:53Speaker 1: But you told me there's one critical step right after
- 3:55Speaker 1: that which could save my computer's life.
- 3:58Speaker 2: Yes, and do not skip this. It's the idle time setting.
- 4:01Speaker 1: What does that do?
- 4:02Speaker 2: Because GNS three is emulating the real hardware that router
- 4:05Speaker 2: code wants to use one hundred percent of your computer's processor,
- 4:08Speaker 2: all of it. Your machine will slow to a crawl
- 4:10Speaker 2: and the fan will sound like a jet engine. By
- 4:12Speaker 2: running the idle time calculator GNS three finds a value
- 4:15Speaker 2: that tells the emulation when it can take a break.
- 4:18Speaker 2: It throttles the CPU usage down to manageable levels. It's
- 4:22Speaker 2: absolutely essential.
- 4:23Speaker 1: That is a fantastic tip. Okay, optimization is done. Now
- 4:27Speaker 1: we can actually build the foundation for our secure network.
- 4:31Speaker 2: Yep. Let's start with a simple routed network. We'll drop
- 4:34Speaker 2: two of those three seven forty five roters we just
- 4:36Speaker 2: configured R one and R two onto the canvas.
- 4:39Speaker 1: Okay, R one and R two. I'll connect them together
- 4:41Speaker 1: on their Ethernet zero interfaces. We'll give them IP is
- 4:44Speaker 1: like ten point zero point zero point one and ten
- 4:47Speaker 1: point zero point zero point two. Then I'll add a
- 4:50Speaker 1: virtual PC to each router.
- 4:52Speaker 2: Good. Now, the real work happens in the console. This
- 4:55Speaker 2: is that text based command line interface. We need to
- 4:57Speaker 2: go in and not only set the IP addresses on
- 4:59Speaker 2: the interface, but also define the path between them. We
- 5:02Speaker 2: have to literally tell our one how to find the
- 5:04Speaker 2: network connected to R two.
- 5:05Speaker 1: And the command language is very specific. Right, It's not
- 5:08Speaker 1: like Linux or anything.
- 5:09Speaker 2: Right, it's Cisco's own system iOS. You use specific commands
- 5:12Speaker 2: to set things up, and if you make a mistake
- 5:14Speaker 2: or want to remove a setting. You just type no
- 5:16Speaker 2: and from the same command.
- 5:17Speaker 1: Oh. Interesting, So it's like a built in undo no
- 5:20Speaker 1: IP address which just wipe it out exactly.
- 5:22Speaker 2: It's actually pretty elegant when to get used to it.
- 5:24Speaker 1: All right, So the routes are configured, the PCs have
- 5:26Speaker 1: their ips. The final check is can PC one ping
- 5:30Speaker 1: PC two all the way across this new routed network.
- 5:33Speaker 1: That's the test its success. We have connectivity. The routers
- 5:36Speaker 1: are talking perfect.
- 5:38Speaker 2: So we've built a network that works. Now is build
- 5:41Speaker 2: a network that's secure. It's time to bring in the centerpiece.
- 5:44Speaker 1: Cisco ASA firewall, the ASA.
- 5:48Speaker 2: We're going to completely rewire our network. R one in
- 5:51Speaker 2: R two will no longer talk to each other directly.
- 5:53Speaker 2: All their traffic has to pass through the firewall, so.
- 5:56Speaker 1: It becomes the gatekeeper. This rerouting, it's really about defying
- 6:00Speaker 1: ning security boundaries, isn't it.
- 6:01Speaker 2: That's the entire concept. We're going to put router R one,
- 6:04Speaker 2: which might lead to a web server, into what we
- 6:06Speaker 2: call the DMZ, the demilitarized zone, and router R two,
- 6:09Speaker 2: which might connect to our super sensitive internal database, goes
- 6:13Speaker 2: into the secure enclay on the ASA. This is called
- 6:15Speaker 2: the inside network.
- 6:17Speaker 1: So we jump into the ASA's console. How do we
- 6:19Speaker 1: tell it which is which?
- 6:20Speaker 2: We use a command called name to name the physical interfaces.
- 6:23Speaker 2: So for the connection going to R two, we'll name
- 6:25Speaker 2: it inside, and the ASA by default assigns the name
- 6:29Speaker 2: inside a security level.
- 6:30Speaker 1: Of one hundred one hundred, the highest level.
- 6:33Speaker 2: The highest. Then for the interface connected to R one,
- 6:35Speaker 2: we'll name it DMZ and we manually set its security
- 6:38Speaker 2: level to fifty.
- 6:39Speaker 1: Okay, so inside as one hundred DMZ is fifty, What
- 6:43Speaker 1: does that actually mean?
- 6:45Speaker 2: This is the absolute core principle of the ASA. Traffic
- 6:48Speaker 2: is always allowed to flow from a higher number of
- 6:50Speaker 2: security zone to a lower number zone.
- 6:52Speaker 1: So from one hundred down to fifty is.
- 6:54Speaker 2: Fine, totally fine, no questions asked. The firewall assumes that
- 6:57Speaker 2: safe because the connection is starting from your trusted area
- 7:01Speaker 2: and going to a less crusted one.
- 7:02Speaker 1: But what about the other way? What if our web
- 7:04Speaker 1: server in the DMZ at level fifty needs to talk
- 7:07Speaker 1: to the database on the inside at level one.
- 7:09Speaker 2: Hundred blocked instantly and automatically. Ah, the ASA denies everything
- 7:14Speaker 2: by default when you try to go from low to
- 7:16Speaker 2: high to allow that to happen, even for something as
- 7:19Speaker 2: simple as a ping. You have to write a specific
- 7:21Speaker 2: explicit rule that permits it. That's the power of the firewheel.
- 7:25Speaker 1: That default wall of denial is exactly what we want
- 7:28Speaker 1: to test. We've built the fortress. Now it's time to
- 7:31Speaker 1: bring in the siege engines.
- 7:32Speaker 2: Exactly time for some active testing.
- 7:34Speaker 1: So for this we're bringing in a new tool, one
- 7:37Speaker 1: that's essential for any security tester.
- 7:39Speaker 2: CALI Linux, the Red Team's operating system. It's just packed
- 7:42Speaker 2: with tools for penetration testing.
- 7:45Speaker 1: And we're integrating it right into our GNS three network.
- 7:47Speaker 1: The setup is a little tricky, right, you have to
- 7:49Speaker 1: make sure it's virtual network card is set a certain way.
- 7:52Speaker 2: Yeah, that's crucial. And it's virtual box settings. You have
- 7:55Speaker 2: to set the network adapter to not attached. That lets
- 7:58Speaker 2: GNS three take full and plug it into our virtual network.
- 8:01Speaker 1: Okay, So we connect Colli to the last open port
- 8:04Speaker 1: on our ASA and this will be our outside zone,
- 8:07Speaker 1: the public Internet, right, and we give.
- 8:09Speaker 2: It the lowest security level of allee. This is the
- 8:12Speaker 2: untrusted world. Now from Collie, we can start our attack.
- 8:15Speaker 1: First up nmap the network scanner. We'll point it at
- 8:19Speaker 1: the ASA's public IP address and see what it finds and.
- 8:23Speaker 2: The result is perfect. NMP reports that all ports are filtered.
- 8:29Speaker 2: It can't see a single open door. It can't even
- 8:31Speaker 2: tell what operating system is running. The ASA is in
- 8:34Speaker 2: total stealth mode.
- 8:35Speaker 1: That's a great first sign. But NMAP is just a scanner.
- 8:38Speaker 1: Let's get more aggressive. Let's use something like Armitage, which
- 8:41Speaker 1: can launch actual exploits. We'll run what's sometimes called a
- 8:45Speaker 1: hail Mary scan against it, and.
- 8:47Speaker 2: The result is the same. This scan comes back with nothing,
- 8:50Speaker 2: no open services, no vulnerabilities to exploit. Our basic configuration
- 8:55Speaker 2: is holding strong.
- 8:57Speaker 1: So what does this tell us as a tester?
- 9:00Speaker 2: Highlights why you need to understand the architecture you're testing.
- 9:03Speaker 2: If you, as the attacker, know that the network admin
- 9:05Speaker 2: is relying on that default high to low traffic rule,
- 9:08Speaker 2: you can start looking for places where they might have
- 9:10Speaker 2: forgotten to add a specific rule. Going the other way,
- 9:13Speaker 2: you anticipate their blind spots.
- 9:14Speaker 1: So you're basically using their own devices logic against them.
- 9:17Speaker 2: That's the art of penetration testing.
- 9:19Speaker 1: So let's just recap here. We use GNS three to
- 9:22Speaker 1: solve the expensive hardware problem. We built a network integrated
- 9:26Speaker 1: a complex Cisco firewall and used its core idea of
- 9:29Speaker 1: security levels to create safe zones, and then we confirmed
- 9:32Speaker 1: it was locked down tight with professional tools.
- 9:35Speaker 2: We've honestly only scratched the surface. The ASA has way
- 9:39Speaker 2: more advanced features. For instance, there's a command threat detection
- 9:44Speaker 2: that turns the firewall from a passive gatekeeper into an
- 9:46Speaker 2: active centry that actually looks for suspicious patterns in the traffic.
- 9:50Speaker 1: That sounds incredibly powerful.
- 9:52Speaker 2: It is, and learning those deeper features is what really
- 9:54Speaker 2: separates a good setup from a great one.
- 9:56Speaker 1: Okay, that's a perfect place to leave it. And based
- 9:58Speaker 1: on everything we covered today, here's a final thought for
- 10:01Speaker 1: you to take away. We established that traffic flows freely
- 10:04Speaker 1: from the inside zone security one hundred down to the
- 10:07Speaker 1: DMZ security fifty. So what's the very first explicit rule
- 10:11Speaker 1: you would need to write on the ASA to allow
- 10:13Speaker 1: a web server in that DMZ to initiate a connection
- 10:16Speaker 1: back to a database server in the secure inside zone.
- 10:19Speaker 2: Think about that principle of default denial. What do you
- 10:22Speaker 2: have to explicitly permit to bridge that security gap from
- 10:26Speaker 2: low to high?
- 10:26Speaker 1: Something to think about. That's it for this deep dive.
- 10:29Speaker 1: We'll see you next time.