DetectionLab: Investigating Active Directory Attacks with Splunk and Wireshark
An authentication event can tell you that an account logged on. A packet capture can show the connection behind that logon. Neither source, on its own, necessarily explains what happened next.
In this lab, I used a controlled Active Directory environment to investigate how reconnaissance, credential abuse, directory replication, persistence, and lateral movement appeared across Windows logs and network traffic.
The objective was to connect simulated attacker activity to observable evidence using Splunk and Wireshark—and understand where that evidence supported a conclusion and where further validation was needed.
Lab Scope and Environment
The exercise used an isolated training environment based on Chris Long’s DetectionLab project. All simulated attacks targeted systems inside the lab.
| System | IP address | Role |
|---|---|---|
| dc.windomain.local | 192.168.56.101 | Active Directory domain controller |
| win10.windomain.local | 192.168.56.100 | Windows workstation |
| wef.windomain.local | 192.168.56.103 | Windows Event Forwarding collector |
| logger | 192.168.56.105 | Splunk and network telemetry collection |
| Kali Linux | 192.168.56.104 | Attack simulation host |
The domain was windomain.local.
The monitoring stack included Windows Event Logs, Sysmon, Windows Event Forwarding, Winlogbeat, Splunk, and network captures reviewed in Wireshark.
The attack simulation used tools including Nmap, Kerbrute, NetExec, Impacket, and Evil-WinRM.
This article focuses on investigating the resulting activity rather than reproducing every offensive command.
The Documented Attack Sequence
The exercise progressed through the following stages:
- Discovering hosts and exposed services.
- Enumerating domain usernames through Kerberos.
- Authenticating with a default lab account.
- Extracting domain credential material through directory replication.
- Establishing an administrative WinRM session using Pass-the-Hash.
- Creating an additional account and exploring persistence mechanisms.
- Accessing the WEF server with compromised credentials.
The main enabling condition was a default lab credential associated with excessive privileges. Once that account was authenticated, the remaining activity demonstrated the consequences of privileged credential exposure.
These were intentionally insecure training conditions, not evidence that every Active Directory environment is vulnerable to the same sequence.
Investigation Approach
For each stage, I worked through four questions:
- Which host initiated the activity?
- Which account or security context was involved?
- What did the destination system record?
- What network evidence supported the interpretation?
This approach helped separate an event’s basic meaning from its significance in the wider attack sequence.
A successful network logon, for example, is not inherently malicious. The source system, account, destination, timing, and subsequent activity determine whether it deserves investigation.
1. Establishing the Network Context
Initial reconnaissance identified services associated with the domain controller, including Kerberos, LDAP, SMB, RPC, and WinRM.
From a defender’s perspective, the important distinction was between expected service exposure and unexpected access to those services.
A domain controller legitimately handles authentication and directory traffic. Connections from the Kali simulation host provided the context for investigating the activity generated during this exercise.
In Wireshark, I used the simulation host as an initial pivot:
ip.addr == 192.168.56.104
This narrowed the capture to traffic involving the known source. From there, protocol filters and conversation statistics helped separate authentication, remote management, and directory replication activity.
2. Investigating Kerberos Username Enumeration
Kerbrute was used to identify valid domain accounts through Kerberos responses. The documented results included the administrator and vagrant accounts.
The report also recorded an unsuccessful AS-REP roasting attempt against the tested account because Kerberos pre-authentication was required.
That distinction mattered: identifying an account did not mean its credentials had been compromised.
Splunk Investigation
The original investigation reviewed Event ID 4768 and identified periods of increased ticket-request activity.
A stronger starting query groups events by source address instead of treating the total event count as activity from one system:
index=wineventlog EventCode=4768
| bin _time span=1m
| stats count by _time, IpAddress
| sort - count
Field extraction varies between Windows logging configurations. Replace IpAddress with the client-address field available in your environment.
This query is a hunting starting point, not a validated detection rule. A high request count requires comparison with normal authentication patterns and examination of related success and failure events.
Wireshark Investigation
To inspect the corresponding traffic:
kerberos && ip.src == 192.168.56.104
I examined the requested principals, Kerberos responses, destination, and timing.
The useful signal was repeated account-testing behavior from the simulation host. The presence of Kerberos traffic alone would not have established enumeration.
3. Tracing Authentication with the Default Account
The exercise obtained authenticated access using the default vagrant lab account.
The security issue was the combination of predictable credentials and privileges sufficient to support the subsequent attack—not simply the account name.
Splunk Investigation
Event ID 4624 provided a starting point for reviewing successful authentication:
index=wineventlog EventCode=4624 Logon_Type=3
Source_Network_Address="192.168.56.104"
| table _time, ComputerName, Account_Name,
Source_Network_Address, Logon_Process,
Authentication_Package
The field names in this example follow the report’s logging format and may need adjustment.
The investigation focused on:
- Authentication from the simulation host.
- Use of the
vagrantaccount. - The destination receiving the logon.
- NTLM-related authentication details.
- Activity occurring after authentication.
Logon Type 3 indicates a network logon. It does not, by itself, identify NetExec, credential theft, or malicious access.
Network Correlation
A useful Wireshark filter was:
ntlmssp && ip.addr == 192.168.56.104
NTLM messages helped associate authentication with the relevant account and connections.
The authentication exchange should not be confused with transmission of the account’s plaintext password or raw NT hash.
4. Investigating Directory Replication Abuse
The documented credential-access stage used Impacket’s replication-based functionality to retrieve domain credential material.
This behavior is commonly described as DCSync: abusing directory replication permissions to request sensitive information from a domain controller.
Replication-based credential retrieval is also different from proving that the physical NTDS.dit file was copied from disk.
Splunk Investigation
The investigation reviewed Event ID 4662 for activity associated with the compromised account:
index=wineventlog EventCode=4662
| table _time, ComputerName, Account_Name,
Object_Type, Access_Mask, Properties
Event 4662 records audited operations on directory objects. It is not automatically a DCSync alert.
To evaluate suspicious replication activity, investigate:
- The account performing the operation.
- The replication-related rights present in the event.
- Whether the activity was expected for that identity.
- The associated logon session and source host.
- Supporting RPC traffic.
Relevant events depend on audit policy and object-level auditing configuration. Missing events do not establish that replication abuse did not occur.
Network Investigation
I reviewed RPC communication involving the simulation host and domain controller.
A broad starting filter is:
ip.addr == 192.168.56.104 &&
ip.addr == 192.168.56.101 &&
tcp
The report documented communication with a dynamic RPC endpoint. However, a high-numbered port alone does not identify DCSync.
The stronger interpretation comes from correlating directory replication protocol activity with the account, source host, timing, and Windows audit evidence.
5. Investigating the WinRM Session
Following credential retrieval, the exercise used an Administrator NT hash to establish a session through Evil-WinRM.
This demonstrated authentication without supplying the plaintext password.
Network Evidence
To review WinRM traffic between the simulation host and domain controller:
ip.addr == 192.168.56.104 &&
ip.addr == 192.168.56.101 &&
tcp.port == 5985
This identified communication with the WinRM service.
Port 5985 traffic does not independently prove an interactive shell or Pass-the-Hash. The interpretation relied on the documented simulation activity and corresponding authentication evidence.
Detection Opportunity
Useful investigation questions included:
- Was the source an approved management host?
- Was the account expected to use WinRM?
- Was this normal administration for the destination?
- What processes or changes followed the logon?
An administrative session should also not automatically be described as a SYSTEM session. The effective identity and privileges require separate verification.
6. Investigating Account-Based Persistence
The report documented creation of an account named fake_test_user.
Account creation was a useful pivot because it represented a durable change to the environment.
Splunk Investigation
index=wineventlog (EventCode=4720 OR EventCode=4732)
| table _time, ComputerName, EventCode,
Subject_Account_Name, Target_Account_Name,
Account_Name, Group_Name
Event ID 4720 identifies account creation. Event ID 4732 records addition to a security-enabled local group. Other group types require their corresponding membership-change events.
The investigation should establish who created the account, where it existed, and whether it received additional privileges.
Timing can provide context, but account creation outside business hours is not proof of persistence.
Other Persistence Mechanisms
The report also discussed scheduled tasks, Registry Run keys, and accessibility-feature modification.
These should be evaluated separately. A command example does not establish that a working persistence mechanism was deployed.
Verification would require artifacts such as task definitions, registry values, file changes, execution events, or demonstrated behavior after a restart or logon.
7. Investigating Access to the WEF Server
The documented sequence continued with access to the WEF server at 192.168.56.103 using compromised credentials.
To investigate the destination’s network logons:
index=wineventlog EventCode=4624 Logon_Type=3
| search Source_Network_Address="192.168.56.104"
OR Source_Network_Address="192.168.56.101"
| table _time, ComputerName, Account_Name,
Source_Network_Address, Authentication_Package
Results need to be restricted to the WEF destination using the host field available in the deployment.
In Wireshark, I reviewed SMB traffic involving that server:
ip.addr == 192.168.56.103 && tcp.port == 445
Authentication and SMB communication support investigation of remote access. Claims about specific files being accessed or exfiltrated require additional evidence, such as share-access auditing, file-access events, or identifiable transfer activity.
Evidence Summary
| Activity | Windows evidence | Network evidence | Main interpretation limit |
|---|---|---|---|
| Kerberos enumeration | Relevant ticket and failure events | Repeated Kerberos requests and responses | Volume alone does not prove enumeration |
| Authenticated access | 4624 network logons | NTLM and SMB exchanges | Successful authentication is not inherently malicious |
| Directory replication abuse | 4662 with relevant rights and context | Directory replication over RPC | 4662 or a dynamic port alone is insufficient |
| WinRM access | Authentication and endpoint telemetry | Connections to port 5985 | Port usage does not prove Pass-the-Hash |
| Account persistence | 4720 and relevant group-change events | Limited direct visibility | Account creation does not establish malicious intent |
| Access to WEF | Destination authentication and access logs | SMB and RPC communication | A connection does not prove exfiltration |
Detection Improvements
The exercise highlighted several practical improvements:
- Remove default credentials and review privileged account assignments.
- Investigate unexpected replication activity from non-domain-controller systems.
- Restrict remote management to approved administration hosts.
- Monitor account creation and privileged group changes together.
- Correlate authentication with process execution and network activity.
- Verify that audit policies produce the evidence required by detection rules.
- Tune thresholds against normal activity instead of relying on universal event counts.
Historical evidence and real-time detection are different outcomes. Finding an artifact during analysis does not prove that an alert would have fired during the attack.
A detection needs testing, tuning, and validation against both simulated attacks and legitimate activity.
Key Lessons
The central lesson was the value of correlation.
Windows logs helped identify accounts and operations. Network captures supplied communication context. The documented simulation timeline helped connect those observations to actions performed inside the lab.
The exercise also reinforced the need for precise conclusions. A successful logon is not automatically lateral movement. Directory access is not automatically DCSync. An administrative connection is not automatically a SYSTEM shell.
A useful investigation explains what the evidence shows, why it matters, and what remains uncertain.
Project Resources
The report and supporting screenshots are available in the DetectionLab investigation repository.
The lab environment was based on Chris Long’s DetectionLab project.
For further reading, see Microsoft’s Directory Service Access auditing documentation and MITRE ATT&CK’s DCSync reference.
