Category Archives: Security

SQL PowerShell to check and repair Ad-hoc distributed queries Vulnerability

Introduction Ad hoc distributed queries use the OPENROWSET and OPENDATASOURCE functions to connect to remote data sources that use OLE DB. As the name suggests, ad-hoc distributed queries should only be used with infrequent access to data sources. For the … Continue reading

Posted in PowerShell, Security, SQL, T-SQL, Uncategorized, Vulnerability | Tagged , , , , , | Leave a comment

Simple Methods to Recover master.mdf File Password

Overview MS SQL Server is the relational database management system used to store information in form of tables, views, indexes, triggers, constraints and stored procedures. Master Database File (MDF) is the main database file with the file extension .mdf used … Continue reading

Posted in Security, SQL, T-SQL | 1 Comment

Database Level Permission DECLARE @DBuser_sql VARCHAR(4000) DECLARE @DBuser_table TABLE ( DBName VARCHAR(200), UserName VARCHAR(250), LoginType VARCHAR(500), AssociatedDatabaseRole VARCHAR(200) ) SET @DBuser_sql=’ SELECT “[?]” AS DBName,a.name AS Name, a.type_desc AS LoginType, USER_NAME(b.role_principal_id) AS AssociatedDatabaseRole FROM [?].sys.database_principals a LEFT OUTER JOIN [?].sys.database_role_members … Continue reading

Posted on by Prashanth Jayaram | 1 Comment