Latest / CyberCode Academy / Course 16 - Red Team Ethical Hacking Beginner Course | Episode 3: Essential Windows Domain and Host Enumeration
Transcript
- 0:00Speaker 1: In any complex environment, especially in tech, gaining situational awareness
- 0:04Speaker 1: is well, it's not just helpful, it's the first and
- 0:08Speaker 1: most critical step absolutely. I mean, whether you're protecting a
- 0:11Speaker 1: system or you're trying to assess it, you really have
- 0:15Speaker 1: to become the ultimate detective in that networked world.
- 0:18Speaker 2: That's a great way to put it. This whole process
- 0:20Speaker 2: we often call it enumeration. M sounds a bit technical,
- 0:24Speaker 2: it does, but it's really just structured intelligence gathering. It's
- 0:27Speaker 2: how you methodically map out your digital territory. You're not
- 0:31Speaker 2: just looking at the technology, but you're figuring out who
- 0:34Speaker 2: is using it and where.
- 0:35Speaker 1: Our mission today then is to get that kind of
- 0:38Speaker 1: surgical precision. We're going to cover the essential techniques for
- 0:41Speaker 1: extracting those core configuration details and tracking user movements inside
- 0:47Speaker 1: a Windows domain.
- 0:48Speaker 2: Right, and we're splitting it into two phases.
- 0:50Speaker 1: Two phases first mapping the entire domain that's the big
- 0:53Speaker 1: picture of the blueprint, and then second dissecting an individual computer,
- 0:58Speaker 1: which we're calling the host impact.
- 1:00Speaker 2: This we have to start at that domain level. I mean,
- 1:03Speaker 2: before you even glance at a single machine, you have
- 1:05Speaker 2: to understand the network's boundaries. It's key players and it's
- 1:09Speaker 2: always changing, right, it's never static. That's what's so fascinating.
- 1:12Speaker 2: You've got users logging in services starting up, so this
- 1:16Speaker 2: kind of dynamic info gathering is well, it's just crucial.
- 1:20Speaker 1: So if we're starting our investigation into this digital city,
- 1:25Speaker 1: where do we even begin? What's step one?
- 1:26Speaker 2: Step one is identifying the core infrastructure. You can use
- 1:30Speaker 2: some simple utilities that you know quickly show you what
- 1:32Speaker 2: domain you're in. Maybe it says you're in fun dot com.
- 1:35Speaker 2: But the real high value target is locating the domain
- 1:38Speaker 2: controller the DC.
- 1:40Speaker 1: Why is the DC the domain controller so critical to find?
- 1:43Speaker 2: It's the central nervous system of the entire operation. It
- 1:46Speaker 2: handles all the security, the authentication, user access for the whole.
- 1:49Speaker 1: Domain, so everything flows through it.
- 1:51Speaker 2: Everything. If you get insight into the DC, you get
- 1:54Speaker 2: insight into way everything. You can use secialized tools or
- 1:57Speaker 2: even just command line queries to find its domain fun
- 2:00Speaker 2: dot com and its internal IP address say one nine
- 2:04Speaker 2: to two bout one six eight by one two two
- 2:06Speaker 2: by one two nine, and.
- 2:07Speaker 1: That IP address tells you exactly where the keys of
- 2:10Speaker 1: the kingdom are stored exactly that. So knowing the location
- 2:13Speaker 1: of the control center is one thing, but we also
- 2:16Speaker 1: need the rule book. Once we know where the DC is,
- 2:19Speaker 1: what's the next immediate.
- 2:21Speaker 2: Step policy review. Once you've pinpointed the DC, you retrieve
- 2:25Speaker 2: the overall domain policy.
- 2:27Speaker 1: And this policy dictates everything.
- 2:29Speaker 2: It governs every single user and system. We're talking password complexity,
- 2:34Speaker 2: account lockouts, access restrictions. Finding this is like finding the
- 2:38Speaker 2: network's constitution.
- 2:39Speaker 1: Okay, so finding the DC and the policy, Yeah, that
- 2:42Speaker 1: gives you the structural blueprint and I guess the legal framework.
- 2:47Speaker 1: But this is where it gets really interesting for me
- 2:49Speaker 1: tracking the users. Because a network is only as secure
- 2:53Speaker 1: as the people on.
- 2:54Speaker 2: It, precisely, that's the dynamic element. We move beyond that
- 2:57Speaker 2: static structure and we start looking for current human activity.
- 3:01Speaker 2: We start by listing all the known host.
- 3:03Speaker 1: Names, so every single computer connected to the domain.
- 3:06Speaker 2: Every single one. That's your list of potential activity zones.
- 3:09Speaker 1: And then do we just start pinging them all?
- 3:11Speaker 2: Pretty much? We use a command chain to check every
- 3:13Speaker 2: computer on that list for any currently logged on user accounts.
- 3:16Speaker 1: That can reveal some pretty high value intelligence right away.
- 3:20Speaker 2: Oh instantly. For example, you might discover that a highly
- 3:23Speaker 2: privileged account like administrator is currently logged onto the domain
- 3:27Speaker 2: controller itself.
- 3:29Speaker 1: WHOA Okay, wait, if the main administrator account is actively
- 3:32Speaker 1: logged into the main control center machine, what's the security
- 3:36Speaker 1: implication there?
- 3:37Speaker 2: That machine immediately becomes a prime high priority target. I'll
- 3:42Speaker 2: bet because if that DC is compromised while the administrator
- 3:46Speaker 2: account is active, an attacker basically has total network control.
- 3:50Speaker 2: It's like finding the gateway to the Kingdom and the
- 3:53Speaker 2: door is already unlocked.
- 3:54Speaker 1: That is some serious intelligence. But it also helps track
- 3:57Speaker 1: less privileged users too.
- 3:58Speaker 2: Right.
- 3:58Speaker 1: Yeah, you could find a user Peter Pan lugged into
- 4:01Speaker 1: say Win ten user one exactly.
- 4:03Speaker 2: Or even find something more revealing, like discovering that two users,
- 4:07Speaker 2: maybe Jane Doe and Jason Bourne, are both logged into
- 4:10Speaker 2: the same machine Win ten user two.
- 4:12Speaker 1: Ah, And that's a gold mine for an analyst, it is.
- 4:15Speaker 2: It immediately raises questions is the credential sharing? Is there
- 4:19Speaker 2: a weak system configuration allowing this?
- 4:22Speaker 1: Right?
- 4:22Speaker 2: The ability to list all users across all machines is powerful,
- 4:25Speaker 2: but you can also narrow the search. If you only
- 4:28Speaker 2: care about WIN ten user two, a targeted search will
- 4:31Speaker 2: confirm Jane Doe and Jason Born are active. Right there.
- 4:34Speaker 1: Now, you mentioned some of these tools rely on specialized
- 4:37Speaker 1: frameworks which you might not always be available to an
- 4:40Speaker 1: everyday analyst. What are the practical alternatives just using native
- 4:44Speaker 1: Windows commands?
- 4:45Speaker 2: That's such a critical point. You don't always need the
- 4:47Speaker 2: fancy toolbox for finding the domain name. You can just
- 4:50Speaker 2: use ipcomefig all. It's always there, and it lists the
- 4:53Speaker 2: domain as the primary DNS suffix, simple, baked in, effective.
- 4:58Speaker 1: Simple and reliable. What about the more complex stuff like
- 5:01Speaker 1: finding the DC?
- 5:02Speaker 2: For that, we can leverage WMI.
- 5:04Speaker 1: Windows Management Instrumentation YEAP.
- 5:06Speaker 2: Think of WMI as this standard interface built right into
- 5:09Speaker 2: Windows that lets you query and manage pretty much all
- 5:11Speaker 2: OS settings. A quick WMI query can pull the DC's
- 5:14Speaker 2: address like one ninety two point one sixty eight point
- 5:18Speaker 2: one two two point nine and confirm the domain name.
- 5:20Speaker 1: It sounds like we're just asking the operating system to
- 5:22Speaker 1: fill out our paperwork for us.
- 5:24Speaker 2: That's a good way of thinking about it.
- 5:25Speaker 1: And what about that complex domain policy? How do you
- 5:28Speaker 1: make that readable?
- 5:29Speaker 2: For that? We use the gpresult utility. This tool is fantastic.
- 5:35Speaker 2: It can generate a complete, readable HTML report of the
- 5:40Speaker 2: entire domain policy.
- 5:41Speaker 1: So it takes this huge cryptic list and just turns
- 5:45Speaker 1: it into a simple web page.
- 5:46Speaker 2: A browsable rulebook. It speeds up any audit dramatically.
- 5:50Speaker 1: I can see how that would save endless hours.
- 5:52Speaker 2: And finally, for a quick check on who's logged into
- 5:55Speaker 2: a specific machine, like if we want to confirm Jane
- 5:58Speaker 2: and Jason on WHEN ten user two, you can just
- 6:02Speaker 2: use the native command Q and stuff.
- 6:03Speaker 1: So it's fast, it's lightweight.
- 6:05Speaker 2: Exactly, no heavy scripts needed.
- 6:07Speaker 1: Okay, that covers the big picture. We've mapped the territory,
- 6:10Speaker 1: we've found the command center, we've tracked the people across
- 6:13Speaker 1: the network. Now let's zoom in. Let's go to one
- 6:15Speaker 1: specific machine, the host.
- 6:17Speaker 2: Right, So we're moving from the network ecosystem down to
- 6:19Speaker 2: the individual device. This is host enumeration, and we start
- 6:22Speaker 2: with the identity of the machine. We're actually on.
- 6:25Speaker 1: What's the best way to get that quick comprehensive system check.
- 6:28Speaker 2: The system info command a running that instantly pulls all
- 6:32Speaker 2: the crucial details, the host name, the OS version like
- 6:37Speaker 2: Windows ten Enterprise twenty sixteen, the architecture by sixty four,
- 6:41Speaker 2: and critically a report on whether required patches or hot
- 6:44Speaker 2: fixes are installed.
- 6:46Speaker 1: So that snapshot tells you immediately how current and potentially
- 6:51Speaker 1: vulnerable the system is instantly. Once we know the machine,
- 6:54Speaker 1: we need to know who we are, or rather who
- 6:56Speaker 1: the current user is in that context.
- 6:58Speaker 2: Right, that's self identification, which is crucial for figuring out
- 7:01Speaker 2: what you can and can't do. For that, we use
- 7:04Speaker 2: womeall Okay, this will show you the user's name, their
- 7:07Speaker 2: unique security ID or SID, their group memberships which is
- 7:11Speaker 2: so important, and they're specific privileges on this host. That
- 7:15Speaker 2: SID is invaluable for more advanced stuff.
- 7:17Speaker 1: And speaking of privileges, who actually has local control of
- 7:20Speaker 1: the machine?
- 7:20Speaker 2: Good question. We need to check that. A quick check
- 7:22Speaker 2: of net local group administrators tells us exactly which user
- 7:26Speaker 2: accounts have full admin control over this specific host.
- 7:29Speaker 1: So just because there's a domain admin for the whole
- 7:31Speaker 1: network doesn't mean they're the only one who can install
- 7:34Speaker 1: software here precisely. Okay, so we know the system specs,
- 7:38Speaker 1: it's patch status, and who's logged in. Now let's look
- 7:41Speaker 1: at what's actually running the processes, services, all that network chatter.
- 7:46Speaker 2: This is where the machine is doing its work. We
- 7:49Speaker 2: can use WMI again to list only the services that
- 7:52Speaker 2: are currently running. That quickly tells you what the machine
- 7:55Speaker 2: is actively doing, whether it's a legitimate backup service or
- 7:58Speaker 2: something more suspicious.
- 8:00Speaker 1: And beyond what's running now, we should check things that
- 8:03Speaker 1: are set to start automatically.
- 8:04Speaker 2: Right for persistence, that's checking the startup items exactly. We
- 8:08Speaker 2: look for services that are configured to run automatically and
- 8:11Speaker 2: we list the actual command they use. If something malicious
- 8:14Speaker 2: has gained persistence, it will often hide right there.
- 8:17Speaker 1: It makes sense now for network activity, how do we
- 8:20Speaker 1: analyze what ports are open and what conversations the machine
- 8:24Speaker 1: is having.
- 8:24Speaker 2: We use netstat ono. This command is just essential. It
- 8:28Speaker 2: shows open ports, what addresses they're listening on, the connection
- 8:32Speaker 2: states is it listening for input or is it established
- 8:36Speaker 2: with another host?
- 8:37Speaker 1: And it also gives you the process ID, the PID most.
- 8:40Speaker 2: Crazily, yes, the associated process ID.
- 8:42Speaker 1: So if the connection is listening, it's waiting for something.
- 8:45Speaker 1: If it's established, it's actively talking to another system. But
- 8:49Speaker 1: that PID is just a number like eighteen eighty. How
- 8:52Speaker 1: do we connect that number back to an actual file
- 8:55Speaker 1: on the disc.
- 8:56Speaker 2: That is the ultimate digital fingerprint. The PID is the
- 8:59Speaker 2: temporary handle the OS gives a program. So if you
- 9:02Speaker 2: see PID eighteen eighty on some high port, you use
- 9:05Speaker 2: WMI to connect that PID back to the file system. Okay,
- 9:09Speaker 2: you query the process by its PID, you get its name,
- 9:12Speaker 2: maybe it's something that looks innocent like spools V and
- 9:15Speaker 2: most importantly, you find its exact location the executable path
- 9:18Speaker 2: on the disc.
- 9:19Speaker 1: Which lets you immediately inspect the actual program file responsible
- 9:22Speaker 1: for that network connection. You can confirm if it's legit
- 9:24Speaker 1: or if it's something malicious hiding under a common name.
- 9:27Speaker 2: Exactly. It completes the loop right from the network connecting
- 9:29Speaker 2: all the way.
- 9:29Speaker 1: Back to the file fantastic. Okay, finally, let's talk inventory.
- 9:34Speaker 1: We need to know what programs the user has installed
- 9:37Speaker 1: and what data they might be hiding.
- 9:39Speaker 2: For application inventory, we're back to WMI. We can use
- 9:42Speaker 2: it to get a clear list of installed programs by name. Inversion.
- 9:45Speaker 2: This is vital for intelligence gathering.
- 9:47Speaker 1: Uh so well.
- 9:49Speaker 2: For instance, detecting an application like wireshark on a non
- 9:52Speaker 2: IT system is a huge red.
- 9:54Speaker 1: Flag because it's a network monitoring tool, right.
- 9:56Speaker 2: It tells you immediately about the capabilities or maybe the
- 9:59Speaker 2: in tent of the user on that machine, and.
- 10:02Speaker 1: Then the digital treasure hunt finding the data itself.
- 10:05Speaker 2: Yes, for that, we use the simple but powerful deer
- 10:08Speaker 2: command with a recursive search parameter SS the classic, the classic,
- 10:13Speaker 2: and lets you hunt for files with specific keywords like
- 10:16Speaker 2: findingflag dot txt or passwords dot xl sx buried deep
- 10:20Speaker 2: in a user's documents. We've all spent hours with that command.
- 10:23Speaker 1: But what if the files hidden? People do that intentionally.
- 10:26Speaker 2: That's the critical final step for any good investigation. You
- 10:30Speaker 2: just modify the search parameters to specifically look for hidden
- 10:32Speaker 2: files using the attribute command.
- 10:34Speaker 1: Ah, and that can reveal stuff that would never show
- 10:37Speaker 1: up in a standard.
- 10:38Speaker 2: Search, potentially intentionally concealed information. Yeah, like finding a file
- 10:42Speaker 2: named hiddenflag dot txt. That ability to reveal the hidden
- 10:47Speaker 2: is what turns general enumeration into well surgical precision.
- 10:52Speaker 1: So what does this all mean? We've covered this whole
- 10:54Speaker 1: journey of system knowledge. We went from mapping an entire
- 10:58Speaker 1: network down to finding an intentionally hidden file on one machine.
- 11:02Speaker 1: This whole process and numeration, it's about creating a detailed,
- 11:07Speaker 1: dynamic map of the IT landscape.
- 11:10Speaker 2: And the relevance is just immense. Whether you're securing a
- 11:13Speaker 2: massive corporate network, building software or doing a security assessment,
- 11:18Speaker 2: Knowing which commands get you which pieces of information is foundational.
- 11:21Speaker 1: It's the difference between guessing where the security gaps are
- 11:24Speaker 1: and knowing exactly where to look.
- 11:25Speaker 2: Knowing who is logged into the DC, what software is
- 11:28Speaker 2: on a desktop, which executables are listening on the network.
- 11:31Speaker 2: That's how you move from being generally informed to being
- 11:33Speaker 2: surgically precise in your strategy.
- 11:35Speaker 1: Okay, so, building on what we learned about user activity
- 11:39Speaker 1: and domain policy, and let me throw something out there
- 11:42Speaker 1: for you, our listener, to think about. I like it
- 11:45Speaker 1: if you are monitoring in network and you notice the
- 11:48Speaker 1: exact same user account logged into three different machines simultaneously,
- 11:53Speaker 1: the same Peter Pan on three different computers at once.
- 11:56Speaker 1: What specific network security policy or credential management vulnerability hinted
- 12:01Speaker 1: at by the commands we discussed, would you prioritize investigating first.
- 12:04Speaker 2: That's a good one something for you, tomul Over, as
- 12:07Speaker 2: you think about how all these pieces of digital intelligence
- 12:09Speaker 2: connect