HTB LDAP SKILLS ASSESMENT
A few commands that could com in handy in the near future. This might just be a skills assessment however they are useful once we filter out the Good and bad and categorize into a better payload
Get-ADUser -Filter {UserAccountControl -eq 262656} -Properties UserAccountControlGet-ADuser -filter 'protected -eq "False"'Get-ADGroup -filter * -Properties MemberOf | Where-Object {$_.MemberOf -ne $null} | Select-Object Name,MemberOffunction Get-NestedGroupMembers {
param(
[string]$GroupName
)
$group = Get-ADGroup -Filter { Name -eq $GroupName } -Properties MemberOf
if ($group -eq $null) {
Write-Host "Group '$GroupName' not found."
return
}
$members = Get-ADGroupMember -Identity $group.DistinguishedName
foreach ($member in $members) {
if ($member.objectClass -eq "group") {
Write-Host "Nested Group: $($member.Name)"
Get-NestedGroupMembers -GroupName $member.Name
} else {
Write-Host "User: $($member.Name)"
}
}
}
# Specify the group name you're interested in
$groupName = "Server Technicians"
# Get the Server Technicians group and its nested members
Write-Host "Checking Nested Group Memberships for: $groupName"
Get-NestedGroupMembers -GroupName $groupName
Last updated