Privileged Access

Remote Desktop

# Enumerating the Remote Desktop Users Group
Get-NetLocalGroupMember -ComputerName MS01 -GroupName "Remote Desktop Users"

WinRM

# Enumerating the Remote Management Users Group
Get-NetLocalGroupMember -ComputerName MS01 -GroupName "Remote Management Users"

# Custom query to find WinRM users
MATCH p1=shortestPath((u1:User)-[r1:MemberOf*1..]->(g1:Group)) MATCH p2=(u1)-[:CanPSRemote*1..]->(c:Computer) RETURN p2

Establishing WinRM Session from Windows

$password = ConvertTo-SecureString "pass" -AsPlainText -Force
$cred = new-object System.Management.Automation.PSCredential ("DOMAIN\eren", $password)
Enter-PSSession -ComputerName DB01 -Credential $cred

ORRR 
# From Linux
evil-winrm -i ip -u eren

SQL Server Admin

Last updated