Normal domain user access
Last updated
Last updated
Login to WEB01
as the Administrator
user with password Welcome01!
.
Open "Microsoft SQL Server Management Studio"
3. Login with the Administrator
user using Windows Authentication.
4. Expand the "Security" and "Logins" folders. Right click on "Logins" and click "New Login".
5. Click on "Search", click "Locations" and expand the directories and click on "Amsterdam.bank.local".
6. Fill in "Richard" and click "Check Names".
7. At "Default Database" select "Production".
8. Click on "User Mapping" and select "Production".
9. Click "OK".
Check for MSSQL servers inside the domain and try to login using the credentials from the current user or from another user. Sometimes all Domain Users have access to the database and its even possible that everyone is sysadmin on the database.
Download PowerUpSQL on the kali machine and host it on a webserver:
2. Login to WS01
as Richard
with the password Sample123
.
3. Start PowerShell and download and execute an amsi and PowerUpSQL in memory:
4. Get the SQL instances from the domain:
The output shows one SQL Instance.
5. Get the SQL instances from the domain and check access:
The output shows that we can access the MSSQL instance WEB01.amsterdam.bank.local
.
If ran from a user that doesn't have access (for example John), it says not accessible
.
6. To get more info about the session on the SQL server run:
It shows that we aren't sysadmin. Which means we can't execute commands on the database, but our user has access to the database. So we can look into the database for sensitive information or we might be able to escalate our privileges to sysadmin.
Download HeidiSQL on WS01
.
To execute SQL queries and look into the database start heidiSQL.
Click on "New" on the left bottom and configure the following settings:
Network Type: Microsoft SQL Server (TCP/IP)
Library: SQLOLEDB
Hostname / IP: WEB01.amsterdam.bank.local
Select: "Use Windows Authentication"
Port: 1433
4. Click "OK" on the security Issue warning.
5. Click on the databases on the left and see if we got access to any:
We are able to access the Production database, but not the Development one.
Periodically audit who has access to which SQL servers / databases etc.