2

I have a sql server 2005 database server. I have administrative access(sa access) however I need the password to a specific account on the server. I can't really reset the password to this account because it would break some applications.

Is there anyway to get the decrypted password from the sql server?

  • 4
    "it would break some applications". So, do these applications have the password stored? – ypercubeᵀᴹ Mar 10 '12 at 1:48
  • 2
    WHY not get the password that is stored in those applications? Should be usually plain text for some (of course depends on the app) – Jakub Mar 12 '12 at 1:16
3

There are ways to do it which involve attaching a debugger to the SQL Server and basically crashing the SQL Server so that you can get into the memory that SQL Server is using which will have the plain text password in memory.

It'll be much easier to get the password from the .NET source code.

1

Depending on how badly you need to get the password, there is a way to read it from memory if the application has an active connection to the instance. However it is more of a parlor trick and not advised to perform on a production server.

I would suggest going the route of checking the application code to see if a configuration file may have the password stored, or the developers may have the password documented. It is best to document the password somewhere secure, whether it be on a piece of paper in a safe or an encrypted master file that has limited access.

  • The reason for the question was because the app encrypted the db string. However it turns out I just created a new user for the application and now everything is working. – Chris-AZ Mar 13 '12 at 2:10
0

As far as I know, password is not stored on the server. Instead a some kind of HASH Value is calculated and saved. Each time user connects and enters password a hash value is calculated on his password, and then they are compared. Hash-values are calculated using one-way algorithm, so there is no way to re-construct the original password.

If your applications are written in .NET you can use Reflector to navigate through source code and try to find the password.

0

The reason for the question was because the app encrypted the db string. However it turns out I just created a new user for the application and now everything is working.

0

You can decrypt a password from SQL Server 2005 using methods in this article. https://blog.netspi.com/decrypting-mssql-credential-passwords/

Step 1: obtain the encrypted values

select * from sys.sysobjvalues where valclass = 28 

when using a dedicated administrative connection (DAC) is needed (more information about DAC at http://technet.microsoft.com/en-us/library/ms178068%28v=sql.105%29.aspx).

Step 2: decode the the values using this script

https://github.com/NetSPI/Powershell-Modules/blob/master/Get-MSSQLCredentialPasswords.psm1

Step 3: profit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.