Latest / CyberCode Academy / Course 18 - Evading IDS Firewalls and Honeypots | Episode 4: Advanced Application Security: WAFs, API Gateways, and Honeypot Traps
Transcript
- 0:00Speaker 1: You know, if you look at modern software development, there's
- 0:02Speaker 1: one word that comes up over and over again.
- 0:04Speaker 2: Velocity.
- 0:04Speaker 1: Velocity exactly. We're in this era of microservices, agile deployment,
- 0:09Speaker 1: and this whole fail fast, learn quickly mantra right.
- 0:14Speaker 2: And it's fantastic for getting new features out the.
- 0:16Speaker 1: Door, it is, but it's a massive headache for security.
- 0:19Speaker 2: Teams, oh absolutely, because while your dev team is moving fast,
- 0:22Speaker 2: the attackers have their own cry scan fast, penetrate quicker,
- 0:26Speaker 2: and that creates.
- 0:27Speaker 1: This fundamental tension. New vulnerabilities can pop up and get
- 0:31Speaker 1: exploited almost instantly.
- 0:33Speaker 2: In your old static perimeter defenses, they just can't keep up.
- 0:36Speaker 2: That's why today we're doing a deep dive into three
- 0:38Speaker 2: critical specialized tools that manage this tension.
- 0:41Speaker 1: Right, we're going to unpack Web application firewalls or wfs.
- 0:47Speaker 2: The essential boundary enforcement of API gateways.
- 0:51Speaker 1: And the very deceptive world of honeypots.
- 0:53Speaker 2: Our goal is to really get into how they work
- 0:55Speaker 2: and why understanding them is so critical whether you're building
- 0:59Speaker 2: a defense or trying to test it.
- 1:00Speaker 1: Okay, let's unpack this. Let's start with w waves. Why
- 1:04Speaker 1: do we need yet another firewall? I mean, doesn't every
- 1:07Speaker 1: organization already have traditional firewall.
- 1:09Speaker 2: They do, but they're doing a completely different job. A
- 1:12Speaker 2: traditional firewall operates at the network layer layers.
- 1:15Speaker 1: Three and four, so we're talking IP addresses, imports exactly.
- 1:19Speaker 2: It has no idea what the content of that traffic is.
- 1:21Speaker 2: A wife is different. It's a specialized device that provides
- 1:25Speaker 2: protection at the application layer layer seven.
- 1:28Speaker 1: So the way if is smart enough to actually read
- 1:29Speaker 1: the conversation, it's looking at the HTTP request itself correct.
- 1:33Speaker 2: It sits between your traditional firewall and your web server,
- 1:36Speaker 2: and it's constantly monitoring all that web traffic. It uses
- 1:39Speaker 2: these things called access control lists to analyze the stream
- 1:42Speaker 2: and block common.
- 1:43Speaker 1: Attacks, bots, spam, that kind of thing, all of it.
- 1:46Speaker 2: Yeah, but here's the most critical part. Okay, think about it.
- 1:49Speaker 2: Nearly all modern web traffic is encrypted right HTTPS, right,
- 1:54Speaker 2: So for the wave to inspect that traffic it has well,
- 1:57Speaker 2: it has to break the SSL encryption.
- 1:59Speaker 1: Really, it decrypts the traffic, inspects it, and then re
- 2:02Speaker 1: encrypts it.
- 2:03Speaker 2: That's it. It's the single most important operational trade off
- 2:06Speaker 2: you make. It has to do this decryption, inspection and
- 2:09Speaker 2: re encryption loop for everything.
- 2:11Speaker 1: That sounds like a massive performance hit, Yeah, and a
- 2:14Speaker 1: huge security risk if it's not configured perfectly.
- 2:17Speaker 2: It is the WA becomes your single point of failure
- 2:21Speaker 2: for SSL key management. A misconfiguration and you've basically created
- 2:25Speaker 2: your own man in the middle of vulnerability.
- 2:27Speaker 1: And I guess that also applies to things like web
- 2:29Speaker 1: sockets the WSS traffic too.
- 2:31Speaker 2: Yep, same process. That persistent two way channel also has
- 2:35Speaker 2: to go through the same inspection loop.
- 2:37Speaker 1: So how smart are these things? Are they just using
- 2:40Speaker 1: like blacklegs of known malware.
- 2:42Speaker 2: The good ones are far more sophisticated. They use signatures, sure,
- 2:46Speaker 2: but their real power comes from non signature based logic,
- 2:49Speaker 2: meaning they detect protocol misuse anomalist behavior. Some commercial ones
- 2:54Speaker 2: like impervose secure Sphere can actually learn what's normal for
- 2:57Speaker 2: your application.
- 2:58Speaker 1: Ah, so it builds a baseline exactly.
- 3:01Speaker 2: And then it can spot zero day attacks things that
- 3:03Speaker 2: don't have a signature yet just because they deviate wildly
- 3:06Speaker 2: from that learned behavior.
- 3:08Speaker 1: And they're open source options too, right.
- 3:09Speaker 2: Oh yeah. Mod security is the big one from OS,
- 3:12Speaker 2: but it's a real workhourse and you've got others like
- 3:14Speaker 2: Ectronics Web that integrate with ICE. It even has a logging.
- 3:18Speaker 1: Only mode, which is perfect for testing.
- 3:20Speaker 2: Invaluable you can see what it would have blocked before
- 3:23Speaker 2: you flip the switch and potentially break your application.
- 3:25Speaker 1: So if I'm a security tester, my first job is
- 3:27Speaker 1: to figure out if a WAFT is even there.
- 3:29Speaker 2: You have to It completely changes your methodology.
- 3:32Speaker 1: How do you spot one?
- 3:33Speaker 2: They often give themselves away. They might insert custom cookies
- 3:36Speaker 2: or change standard HTTP headers. You learn to fingerprint them
- 3:40Speaker 2: by these little telltale signs. You have to know if
- 3:42Speaker 2: you're attacking the app or just sparring with the firewall.
- 3:45Speaker 1: Okay, so if the WAFT is the hard shell, the
- 3:48Speaker 1: API gateway is sort of the internal security chief and
- 3:51Speaker 1: this is where things get really important from modern apps.
- 3:54Speaker 2: Absolutely, we're not building monoliths anymore.
- 3:56Speaker 1: No, it's all micro services and APIs letting it external
- 4:00Speaker 1: parties access data directly. What kind of risk does that create.
- 4:04Speaker 2: It's a massive expansion of the attack surface. Every API
- 4:08Speaker 2: endpoint is a potential door for an attacker.
- 4:10Speaker 1: And we've seen this go wrong in the real world
- 4:12Speaker 1: for sure.
- 4:12Speaker 2: Think about Internet of things devices. They are all API
- 4:16Speaker 2: driven and we've seen them hijacked to launch these devastating
- 4:19Speaker 2: denial of service attacks.
- 4:21Speaker 1: So the API gateway steps in as this necessary middle layer.
- 4:25Speaker 1: What's its main job?
- 4:26Speaker 2: At its core, it's a proxy. It mediates all the
- 4:29Speaker 2: traffic between whoever is subscribing to the API and your
- 4:33Speaker 2: back end micro services. But it's so much more than that.
- 4:37Speaker 1: It's also doing security monitoring, looking for things like sequel injection. Right.
- 4:40Speaker 2: But the features that are most interesting and often the
- 4:43Speaker 2: biggest targets for testers are the non traffic filtering ones. Likewise, well,
- 4:48Speaker 2: a good gateway manages a central catalog of all your
- 4:51Speaker 2: API calls. It provides documentation, it handles subscriber management, and crucially,
- 4:56Speaker 2: it provisions and manages the API keys for those subscribers.
- 5:00Speaker 1: So let's make this practical. We looked at the open
- 5:02Speaker 1: source WSO two gateway as an example. When you set
- 5:05Speaker 1: that up, the admin console isn't on the same port
- 5:07Speaker 1: as a public API.
- 5:08Speaker 2: Store, right, and that teaches you a huge lesson about testing.
- 5:12Speaker 2: The developer might get the API store working on say
- 5:15Speaker 2: port eighty to eighty, but the admin console is tucked
- 5:19Speaker 2: away on a high non standard port like nine four
- 5:22Speaker 2: four three.
- 5:23Speaker 1: So a quick network scam might completely miss it totally.
- 5:25Speaker 2: You could miss the keys to the Kingdom.
- 5:27Speaker 1: Which means as a tester, your focus suddenly shifts. You're
- 5:31Speaker 1: not trying to brute force the ATI anymore.
- 5:33Speaker 2: Exactly, You're looking for weaknesses in the management structure itself.
- 5:37Speaker 2: Are there default credentials on that admin console? Because if
- 5:41Speaker 2: you can get in there, it doesn't matter how good
- 5:43Speaker 2: the traffic filtering is. You own the system.
- 5:46Speaker 1: We've covered defense and control. Now let's talk about detection.
- 5:49Speaker 1: How do defenders flip the script and actually trick the attackers.
- 5:53Speaker 2: This is where we get into the art of deception.
- 5:55Speaker 2: This is honeypots.
- 5:57Speaker 1: A digital trojan horse.
- 5:58Speaker 2: Kind of a honeypot is a lure. It's a system
- 6:01Speaker 2: that looks legitimate, but it's actually placed there by a
- 6:04Speaker 2: defender specifically to trap an intruder.
- 6:06Speaker 1: And the goal isn't really to prosecute them, is it rarely?
- 6:10Speaker 2: It's usually about intelligence gathering. You want to monitor them,
- 6:13Speaker 2: understand their technique, see what tools they're using.
- 6:16Speaker 1: Are all these traps the same, not at all.
- 6:18Speaker 2: We basically categorize them by their interaction level. A low
- 6:22Speaker 2: interaction honeypot is simple, maybe just a fake login page
- 6:26Speaker 2: or an open port, just enough to get a bite exactly.
- 6:29Speaker 2: A high interaction honeypot on the other hand, is a
- 6:32Speaker 2: much more convincing fake. It might be a full operating
- 6:35Speaker 2: system with a file system and services, all designed to
- 6:38Speaker 2: keep the attacker engaged for as long as possible.
- 6:41Speaker 1: And if you link a bunch of those together.
- 6:42Speaker 2: That's called a HoneyNet. It looks like a complete real
- 6:45Speaker 2: network environment. It's the ultimate intelligence gathering tool.
- 6:49Speaker 1: So once an attacker is inside this HoneyNet, how do
- 6:52Speaker 1: you actually collect their data safely?
- 6:54Speaker 2: You use a technique called synchronoling. Once you've identified the attacker,
- 6:59Speaker 2: you can divert all their traffic and any mailware they
- 7:02Speaker 2: upload into a safe containment area.
- 7:04Speaker 1: Like shunting a suspicious train onto a quarantine track.
- 7:08Speaker 2: That's a great way to put it. It lets you
- 7:10Speaker 2: analyze their tools and scripts without risking your real network.
- 7:13Speaker 1: The open source community seems to be driving a lot
- 7:15Speaker 1: of this. We saw the evolution from a tool called
- 7:18Speaker 1: Kippo to a new one called Cowi. Why the change.
- 7:21Speaker 2: Kippo was great, but attackers are smart. Over time, they
- 7:25Speaker 2: figured out how to fingerprint it. You could run certain
- 7:28Speaker 2: commands and it would behave in a way or real
- 7:30Speaker 2: system wouldn't.
- 7:31Speaker 1: So Cowie was designed to be a better fake.
- 7:34Speaker 2: A much better fake. It's a medium interaction SSH and
- 7:37Speaker 2: telnet honeypot that pretends to be a Debian system. It
- 7:41Speaker 2: has a full file system, logs everything.
- 7:44Speaker 1: It has a really clever trick with passwords.
- 7:46Speaker 2: It does by default it allows any password to log in,
- 7:49Speaker 2: except for a few common ones you exclude, like route
- 7:52Speaker 2: or one, two, three, four, five six.
- 7:54Speaker 1: So the attacker thinks they got lucky with their brute
- 7:56Speaker 1: force attempt, and they stay engaged.
- 7:59Speaker 2: They spend more time in your environment revealing more of
- 8:01Speaker 2: their methods. It's brilliant, But.
- 8:03Speaker 1: There must be a whole cat and mouse game here.
- 8:05Speaker 1: There have to be ways to detect these honeypots too.
- 8:08Speaker 2: Oh. Absolutely, most of them can be detected because they
- 8:11Speaker 2: failed to deliver full system functionality. A tester might try
- 8:14Speaker 2: a command like ad user to add.
- 8:17Speaker 1: A new user, and the honeypot can't handle it.
- 8:19Speaker 2: The old Kippo system would get stuck in an endless loop.
- 8:23Speaker 2: A lot of modern ones will just pretend to execute
- 8:25Speaker 2: the command, but nothing actually changes.
- 8:28Speaker 1: I'd imagine. File permanence is another big giveaway.
- 8:30Speaker 2: It's a huge one. If you create a file, then
- 8:33Speaker 2: log out and log back in and your file is gone.
- 8:36Speaker 2: That's a major red flag. It means you're in a
- 8:39Speaker 2: non persistent simulated environment.
- 8:41Speaker 1: And there are even external tools to check for this.
- 8:45Speaker 2: Yeah, things like Chodan's honey score. You can use it
- 8:47Speaker 2: to check if an IP address, especially one pretending to
- 8:50Speaker 2: be something valuable like an industrial control system, is likely
- 8:54Speaker 2: a honeypot.
- 8:55Speaker 1: So let's bring this all together. We've mapped out three
- 8:58Speaker 1: really specialized can putons. Here.
- 9:00Speaker 2: We have w wafts inspecting that Layer seven traffic and
- 9:03Speaker 2: dealing with all the encryption overhead.
- 9:05Speaker 1: Then gateways securing that dynamic API boundary.
- 9:08Speaker 2: And finally honey pots, which flip the script to gather
- 9:11Speaker 2: intelligence on the adversary. What's the main takeaway for someone
- 9:14Speaker 2: listening to this, It's that in this dynamic world, it's
- 9:18Speaker 2: just not enough to deploy these defenses. You have to
- 9:21Speaker 2: know their specific features their limitations.
- 9:23Speaker 1: Whether you're building them or testing them exactly.
- 9:26Speaker 2: A defender has to configure them beyond the defaults, and
- 9:29Speaker 2: a tester has to learn how to fingerprint them to
- 9:31Speaker 2: find the weak spots.
- 9:32Speaker 1: Okay, let's put that into practice a little exercise for you.
- 9:35Speaker 1: If you were just tasked with securing a brand new
- 9:37Speaker 1: API gateway based on what we've talked about, what are
- 9:40Speaker 1: three non traffic sultering features you would prioritize securing or testing.
- 9:45Speaker 2: First, good question, Okay. First, I would immediately audit the
- 9:49Speaker 2: default administrator credentials on the management console. That's always the
- 9:53Speaker 2: path of least resistance, makes sense. Second, I'd lock down
- 9:56Speaker 2: the subscriber management system to make sure only authorized people
- 9:59Speaker 2: can even and see the API catalog. In third, I
- 10:03Speaker 2: would critically test the provisioning and revocation process for the
- 10:06Speaker 2: API keys. You have to be able to instantly deactivate
- 10:10Speaker 2: a compromised key.
- 10:11Speaker 1: That brings us to our final thought. The real difference
- 10:14Speaker 1: between a successful defense and a successful penetration often comes
- 10:18Speaker 1: down to the details. It's either the defender's deep knowledge
- 10:22Speaker 1: of their own tools or the attacker's ability to spot
- 10:25Speaker 1: a tiny flaw in the emulation of a fake system.