First let’s import the PowerUpSQL Script

powershell-import C:\\Tools\\PowerUpSQL\\PowerUpSQL.ps1

image.png

Now let’s Enumerate the Instance.

powershell Get-SQLInstanceDomain

image.png

Now let’s test the connectivity.

powershell Get-SQLConnectionTest -Instance "sql-2.dev.cyberbotic.io,1433" | fl

image.png

We have access to SQL-2

Now let’s get some information about the system.

powershell Get-SQLServerInfo -Instance "sql-2.dev.cyberbotic.io,1433"

image.png

Now let’s see the accessable servers

powershell Get-SQLInstanceDomain | Get-SQLConnectionTest | ? { $_.Status -eq "Accessible" } | Get-SQLServerInfo

image.png

we didn’t get much so let’s continue.

Now let’s search for group members that have access to MSSQL.

powershell Get-DomainGroup -Identity *SQL* | % { Get-DomainGroupMember -Identity $_.distinguishedname | select groupname, membername }

image.png