Latest / CyberCode Academy / Course 16 - Red Team Ethical Hacking Beginner Course | Episode 7: The Art of Evasion: Detecting and Bypassing Security with Sysmon
Transcript
- 0:00Speaker 1: Welcome back to the deep dive. Our mission today is
- 0:03Speaker 1: to step inside the mind of Well, the digital ghost.
- 0:07Speaker 1: We're going deep into the high stakes world of cybersecurity
- 0:09Speaker 1: to understand the fundamental tactics of evasion, you know, the
- 0:12Speaker 1: art of being an invisible adversary on a target network.
- 0:16Speaker 2: Evasion really is the cornerstone of any successful offensive op.
- 0:20Speaker 2: Whether you're a legitimate Red team or you know, a
- 0:22Speaker 2: real threat actor. When an operation starts, the clock is ticking, right,
- 0:26Speaker 2: the goal isn't just to get access, it's to stay undetected.
- 0:30Speaker 2: If a defender the Blue team spots you, the consequences
- 0:33Speaker 2: are immediate. We'll terminate your session, they'll delete your files,
- 0:37Speaker 2: or and this is the worst case scenario, they'll just.
- 0:39Speaker 1: Back off, back off. Why is that worse.
- 0:41Speaker 2: Because they switch into full investigation mode. They start actively
- 0:45Speaker 2: monitoring your every move to learn your real objective. So yeah,
- 0:49Speaker 2: detection is basically operational failure.
- 0:51Speaker 1: So for you, the listener, the challenge here is to
- 0:55Speaker 1: really understand how this invisible adversary operates. You can't defend
- 0:59Speaker 1: against a threat you can't see, and if you know
- 1:01Speaker 1: their playbook for hiding, you know exactly which dark corners
- 1:05Speaker 1: to start shining a light on. Let's start with the
- 1:07Speaker 1: core philosophy. It's not about, you know, smashing through a firewall.
- 1:11Speaker 2: No, that's way too loud obvious.
- 1:13Speaker 1: Right. Evasion is about subtlety, about camouflage. The mindset shift
- 1:17Speaker 1: is from how do I break in to how do
- 1:21Speaker 1: I look absolutely totally normal once I'm inside.
- 1:24Speaker 2: That's situational awareness taken to the extreme. Your likelihood of
- 1:28Speaker 2: blending in is directly proportional to your knowledge of the
- 1:31Speaker 2: target environment.
- 1:32Speaker 1: So you have to know what you're up against.
- 1:33Speaker 2: You have to identify every security control they have, the
- 1:36Speaker 2: network intrusion systems, the IDs and ips, the firewalls, the
- 1:40Speaker 2: anti virus, and maybe most importantly, any host based loggers
- 1:44Speaker 2: running on the machines themselves.
- 1:45Speaker 1: I think the best analogy is like carrying contraband through
- 1:49Speaker 1: a crowded city square. You could walk through in a
- 1:52Speaker 1: suit with a shiny briefcase, and you're guaranteed to draw attention.
- 1:55Speaker 2: Yeah, everyone's going to look at you.
- 1:56Speaker 1: Or you could just put the payload in a ratty,
- 1:59Speaker 1: worn out backpack, tie a sweatshirt around your waist to
- 2:01Speaker 1: just blend right in. That deep awareness of what normal
- 2:05Speaker 1: looks like on a network is key to survival.
- 2:08Speaker 2: And when Red teams put this into practice, they rely
- 2:11Speaker 2: on what you could call three strategic pillars of evasion,
- 2:14Speaker 2: and they all have different levels of risk.
- 2:18Speaker 1: Okay, so pillar number one, this is the high risk,
- 2:21Speaker 1: high reward approach, disabling defenses.
- 2:24Speaker 2: Right, This is the digital equivalent of shooting out the
- 2:27Speaker 2: surveillance cameras.
- 2:28Speaker 1: It works, but it.
- 2:29Speaker 2: Worked, I mean it stops automated systems from flagging you immediately,
- 2:32Speaker 2: but the risk is enormous. As soon as a Blue
- 2:35Speaker 2: team analyst sees their main monitoring tools go dark, the alarm.
- 2:38Speaker 1: Bells go off, it's like a bomb going off exactly.
- 2:41Speaker 2: They will immediately pivot from passive monitoring to aggressive hunting.
- 2:45Speaker 2: Your exposure is guaranteed at that point.
- 2:47Speaker 1: So, because that's so risky, the better approaches Pillar two.
- 2:50Speaker 2: Pillar two blending in This is where the creativity really
- 2:54Speaker 2: comes into play. You want your command and control traffic,
- 2:58Speaker 2: your C two, to look like existing background noise. If
- 3:01Speaker 2: the network mostly uses standard web protocols, you make your
- 3:05Speaker 2: C two traffic mimic normal HTTP or HTTPS.
- 3:09Speaker 1: And this goes all the way down to the file
- 3:10Speaker 1: level too. Right, you can't just drop a file named
- 3:13Speaker 1: malwarevo one dot ex into the Windows directory.
- 3:17Speaker 2: Oh definitely not. You use file and process names that
- 3:20Speaker 2: sound ordinary, or you know, they blend into the naming
- 3:22Speaker 2: conventions the target already uses. Maybe you name it updeedservice,
- 3:25Speaker 2: dot ex or something that looks like a normal update helper.
- 3:28Speaker 1: And I imagine it gets deeper than just the name.
- 3:30Speaker 2: Much deeper. Attackers rely heavily on anti forensics. A classic
- 3:34Speaker 2: technique is messing with the filesystem metadata. They'll upload their
- 3:38Speaker 2: malicious file and then immediately change its timestamps creation time,
- 3:41Speaker 2: access time, modification time to match the timestamps of legitimate
- 3:45Speaker 2: files already in that directory.
- 3:47Speaker 1: So a quick scan would just slide right past it.
- 3:49Speaker 2: A scan or even a superficial forensic review would completely
- 3:52Speaker 2: overlook the file because its metadata just looks authentic, historically correct.
- 3:57Speaker 1: That is subtle. But let's talk about a tactic defenders
- 4:00Speaker 1: find incredibly difficult to track stealing user sessions. You mentioned
- 4:04Speaker 1: that earlier. How does that work?
- 4:06Speaker 2: That is a masterstroke of stealth. It often starts with
- 4:10Speaker 2: credential dumping, so using tools like mimicats to pull passwords
- 4:14Speaker 2: or hash material write out of memory while a user
- 4:17Speaker 2: is logged in okay.
- 4:18Speaker 1: So you grab their keys while they're using.
- 4:20Speaker 2: Them, right, and once the attacker has those credentials, they
- 4:23Speaker 2: can pivot laterally using that person's identity. The problem for
- 4:27Speaker 2: the defender is that all the malicious actions that follow
- 4:30Speaker 2: running commands accessing files are now logged under a genuine
- 4:34Speaker 2: active user ID.
- 4:36Speaker 1: So from the security logs perspective, it just looks like
- 4:39Speaker 1: Bob from Accounting suddenly decided to run some crazy command line.
- 4:42Speaker 2: Strength Exactly, it takes really skilled contextual analysis to realize
- 4:46Speaker 2: that Bob's session has actually been hijacked.
- 4:48Speaker 1: That makes perfect sense. The activity is malicious, but the
- 4:51Speaker 1: identity is legitimate. What about the third pillar?
- 4:53Speaker 2: Pillar three is using unwatched areas. This requires the attacker
- 4:58Speaker 2: to have already done excellent recom on. They need deep
- 5:01Speaker 2: knowledge of the specific security configuration. Think of it like
- 5:05Speaker 2: knowing a security guard's patrol route and finding the one
- 5:07Speaker 2: blind spot they never check.
- 5:09Speaker 1: Can you give us a concrete example of a digital
- 5:11Speaker 1: blind spot?
- 5:12Speaker 2: A classic one involves anti virus. If an attacker can
- 5:15Speaker 2: get a copy of the endpoint security agents can fig file,
- 5:19Speaker 2: they often find explicit exclusion rules. For instance, a system
- 5:23Speaker 2: admin might have set a specific folder path, maybe for
- 5:26Speaker 2: software development tools that the av is explicitly told not
- 5:30Speaker 2: to scan, usually for performance reasons, and.
- 5:32Speaker 1: That folder becomes the perfect hiding place.
- 5:34Speaker 2: It becomes the perfect staging ground for the payload. The
- 5:37Speaker 2: defender assumes the whole system is monitored, but a key
- 5:40Speaker 2: area is deliberately unwatched.
- 5:42Speaker 1: Okay, So once the objective is met, the final step
- 5:44Speaker 1: has to be clearing.
- 5:46Speaker 2: Tracks absolutely non negotiable. Removing artifacts is what separates the
- 5:50Speaker 2: advanced operator from the beginner. You have to remove every trace, scripts, executables,
- 5:55Speaker 2: any files you staged. And crucially, this isn't just deleting
- 5:58Speaker 2: local files.
- 5:59Speaker 1: You have to check the lawe to make sure you
- 6:01Speaker 1: didn't leave a footprint.
- 6:02Speaker 2: Right, did the local Windows event logs get cleared? Was
- 6:06Speaker 2: my activity forwarded to a remote log server? What about
- 6:09Speaker 2: logs from the security tools themselves? You check all of
- 6:12Speaker 2: that before you close the session.
- 6:13Speaker 1: That sets the stage for the attacker. Now let's flip
- 6:17Speaker 1: the script. Let's put on the defender's hat. If the
- 6:19Speaker 1: red team is so meticulous, how do blue teams even
- 6:23Speaker 1: know to look in the first place? How do they
- 6:26Speaker 1: spot that brief window of activity?
- 6:28Speaker 2: This is where powerful logging tools become well indispensable. The
- 6:32Speaker 2: most popular example is probably Cisman, part of the Windows
- 6:35Speaker 2: CIS internal suite. It's critical because it captures granular system
- 6:40Speaker 2: activity that standard Windows logging just misses, detailed process creations,
- 6:45Speaker 2: network connection attempts, even those file creation timestamps we just
- 6:49Speaker 2: talked about. It gives you the raw data you need
- 6:51Speaker 2: to spot really subtle anomalies.
- 6:53Speaker 1: Okay, let's walk through a real world scenario. Let's say
- 6:56Speaker 1: an automated lateral movement has just been executed, something that
- 6:59Speaker 1: price prioritizes speed over deep stealth. You the blue team analyst.
- 7:04Speaker 1: You refresh your log viewer. What's the sequence of events
- 7:07Speaker 1: you're looking for? What's the noisy signature?
- 7:10Speaker 2: So the chain starts with a file create event.
- 7:12Speaker 1: A new file appears.
- 7:13Speaker 2: Right, and because the automated framework is built for speed,
- 7:17Speaker 2: the executable often has a random high entropy name like.
- 7:21Speaker 1: C nine three nine b dot ex or.
- 7:23Speaker 2: Something exactly like that, and it shows up in a
- 7:25Speaker 2: suspicious location, maybe c Windows or an admin share. A
- 7:29Speaker 2: random file in a system folder is an immediate red flag, and.
- 7:33Speaker 1: That file needs to run, which often needs higher privileges. Correct.
- 7:37Speaker 2: So the next event is often a registry value set event.
- 7:40Speaker 2: This shows Windows Own Services dot ex process starting to
- 7:44Speaker 2: interact with that random file, often trying to run it
- 7:46Speaker 2: as a service, and this quickly leads to the most
- 7:48Speaker 2: revealing part the process create chain. The parent process services
- 7:52Speaker 2: dot ex spawns the random dot ex as its.
- 7:55Speaker 1: Child, and what is that random EXECUTA will do?
- 7:58Speaker 2: It immediately becomes the parent and it spawns a legitimate
- 8:01Speaker 2: Windows binary, typically Rundle thirty two dot ex. This is
- 8:06Speaker 2: a classic masting tactic, using legitimate tools to run your
- 8:09Speaker 2: malicious code.
- 8:10Speaker 1: Well wait, if using Rundle thirty two dot ex to
- 8:14Speaker 1: run a malicious DLL is so classic and well known,
- 8:18Speaker 1: why does SEE two frameworks keep doing it? Isn't the
- 8:20Speaker 1: blue team already hunting for exactly that.
- 8:22Speaker 2: They are And that's the calculated risk of automation. Rundle
- 8:25Speaker 2: thirty two dot Ex is used because it's a necessary,
- 8:28Speaker 2: trusted part of the OS. An attacker needs to use
- 8:31Speaker 2: processes that are allowed to make network calls, and it
- 8:34Speaker 2: fits the bill. It also generates a ton of background
- 8:37Speaker 2: noise on any network, so it's hard to spot one
- 8:39Speaker 2: bad instance without deep context.
- 8:40Speaker 1: So they use it because it works, and they're just
- 8:42Speaker 1: betting that the defenders won't see the full chain of.
- 8:45Speaker 2: Events exactly, so once runnell thirty two dot ex is running,
- 8:48Speaker 2: the random dot exse often just terminates itself a quick
- 8:51Speaker 2: self cleaning move, but then comes the definitive evidence.
- 8:53Speaker 1: The smoking gun.
- 8:54Speaker 2: The smoking gun is the network connection event Sismin logs
- 8:58Speaker 2: show rundele thirty two dot exc now running as the
- 9:01Speaker 2: high privileged system account making an outbound connection to an
- 9:05Speaker 2: external IP. That's the attacker C two, and the entire
- 9:08Speaker 2: sequence file creates service interaction, process sponds, self deletion, and
- 9:12Speaker 2: network callback. That's the noisy, predictable footprint of automated lateral movement,
- 9:17Speaker 2: which brings.
- 9:17Speaker 1: Us back to the skill of the adversary. What happens
- 9:20Speaker 1: when the Red team is skilled enough to know the
- 9:22Speaker 1: defender is using sisman and actively fights.
- 9:26Speaker 2: Back, then the advantage shifts back to the Red team.
- 9:28Speaker 2: They assume sisman is there, so their first step is
- 9:31Speaker 2: better reconnaissance.
- 9:32Speaker 1: The simple check is just looking for sismans sixty four
- 9:34Speaker 1: dot exx running in the process list, but a savvy
- 9:37Speaker 1: Blue team can just rename that file exactly.
- 9:40Speaker 2: Renaming is trivial. A more advanced attacker uses the Windows FLTMC,
- 9:44Speaker 2: the filter manager control program to check for the driver's
- 9:47Speaker 2: unique signature. They look for the filter driver's altitude number.
- 9:50Speaker 1: For those less familiar with Windows internals, what exactly is
- 9:54Speaker 1: an altitude number and why is that specific number three
- 9:57Speaker 1: eight five two zero one a dead giveaway?
- 9:59Speaker 2: An altitude number basically defines where a filesystem filter driver
- 10:03Speaker 2: sits in the kernel stack. Multiple programs can hook into
- 10:07Speaker 2: file operations and they stack up like layers. Each driver
- 10:11Speaker 2: gets a unique altitude number, so Windows knows the order
- 10:14Speaker 2: of operations sism's driver no matter what you name, it
- 10:17Speaker 2: is assigned three eight five two zero one. If an
- 10:21Speaker 2: attacker runs FLTMC and sees a driver at that altitude,
- 10:25Speaker 2: they know for a fact sisman is installed and logging.
- 10:28Speaker 1: Once they've identified it, the goal is to get the
- 10:30Speaker 1: configuration file to steal the defender's rulebook.
- 10:33Speaker 2: Right Using tools like wimick Windows Management Instrumentation command Line,
- 10:38Speaker 2: they find the executable's path. Then they use the sisman
- 10:41Speaker 2: executable itself with the dex c flag to dump the
- 10:43Speaker 2: entire configuration. Now they know exactly what's being logged and
- 10:47Speaker 2: what's being ignored, and once.
- 10:48Speaker 1: They have the map, they can move to evasion strategy
- 10:51Speaker 1: one exploiting unwatched areas.
- 10:53Speaker 2: They'll review the rules for file create events. They might
- 10:55Speaker 2: find that the config flags all files created and the
- 10:58Speaker 2: downloads folder, but the admin for got to include.
- 11:00Speaker 1: The desktop and there's your blind spot.
- 11:02Speaker 2: That's the unwatched area. And it gets better because the
- 11:05Speaker 2: config also probably flags specific file.
- 11:08Speaker 1: Extensions like dot exx or dot d ella.
- 11:10Speaker 2: Right, so the bypass is simple but effective. Before the
- 11:13Speaker 2: payload leaves the attacker's machine, they rename it from test
- 11:17Speaker 2: dot exc twesday testa blaw. They upload test dot blaw
- 11:21Speaker 2: to the unwatched desktop folder. The extension isn't flagged, the
- 11:25Speaker 2: path isn't monitored, so no log event is triggered for
- 11:28Speaker 2: file creation.
- 11:29Speaker 1: And then once the file is safely on the machine,
- 11:32Speaker 1: they just use a command shell to rename it back
- 11:34Speaker 1: to test dot exx right before they run it. So
- 11:36Speaker 1: the crucial moment the payload landing was completely missed.
- 11:40Speaker 2: Precisely it breaks the chain of evidence for the defender,
- 11:43Speaker 2: forcing them to start their investigation way too late.
- 11:46Speaker 1: And finally for the really aggressive operator strategy too, just
- 11:49Speaker 1: disabling the defense entirely. You mentioned FLTMC for recon you
- 11:52Speaker 1: can use it for destruction too.
- 11:54Speaker 2: Yeah, if the red team decides to go loud, they
- 11:56Speaker 2: can use that same FLTMC command, but with the unload flag,
- 11:59Speaker 2: fl TMC unloads sisman DRVA, and that forces the operating
- 12:03Speaker 2: system to just stop collecting sisman event logs, so.
- 12:06Speaker 1: The effectively blind the defender for a while.
- 12:09Speaker 2: Yes, the system might still think sisman is running, but
- 12:12Speaker 2: the event collection has stopped. But and this is a
- 12:15Speaker 2: huge warning for blue teams, this driver unload action typically
- 12:19Speaker 2: generates a very specific and severe log message, event ID
- 12:24Speaker 2: two fifty five. If you see your logging telemetry suddenly
- 12:28Speaker 2: drop off, you should immediately search for that two fifty
- 12:31Speaker 2: five event. It's your primary clue.
- 12:33Speaker 1: So what does this all mean for the listener? I mean, Ultimately,
- 12:36Speaker 1: success in this domain, whether you're detecting or evading, seems
- 12:39Speaker 1: to depend less on the tools themselves and more on
- 12:42Speaker 1: skill and creativity.
- 12:43Speaker 2: Absolutely, we've shown that if an adversary just spends a
- 12:46Speaker 2: little extra time on their craft, they can easily bypass
- 12:49Speaker 2: automated scanners and exploit holes and config files. If defenders
- 12:53Speaker 2: rely only on automated alerts, they'll always be a step
- 12:56Speaker 2: behind the skilled attacker who knows the rules better than
- 12:58Speaker 2: the person who wrote them.
- 12:59Speaker 1: It's the constant evolution of these tactics, techniques, and procedures
- 13:03Speaker 1: the TTPs that keeps this whole game moving. The Red
- 13:05Speaker 1: team's goal is just limitless creativity, and.
- 13:08Speaker 2: That leads to a final thought, a challenge for you,
- 13:10Speaker 2: the listener. We talked about how attackers can exploit existing
- 13:13Speaker 2: blind spots, but what if instead of just finding an
- 13:16Speaker 2: unwatched area, an attacker was able to change the logger's
- 13:19Speaker 2: rules directly. If an attacker could modify the security tool's
- 13:23Speaker 2: configuration to explicitly ignore their own activity before they act,
- 13:27Speaker 2: what single artifact would be the most difficult for a
- 13:30Speaker 2: defender to detect? Afterward, think about what evidence exists outside
- 13:34Speaker 2: of the configured rules.
- 13:36Speaker 1: A compelling question to mole over. This deep analytical interplay
- 13:39Speaker 1: between TTPs and monitoring tools is really the core of
- 13:42Speaker 1: modern security. Thank you for joining us for this deep
- 13:45Speaker 1: dive into digital evasion.