Let's say, there is an .NET application on a windows 7 host where I have administrator's access rights.

The application works with remote MS-SQL server on port 1433 which I don't control. I want to capture the connection string to use for my other app which would connect to the same database. I have already try WireShark and Microsoft Network Monitor to sniff packet. Some frame seem encrypted but i am not sure. Is there another way to show the connection string?

  • 6
    Login packets, which include the user id and password from the connection string when SQL auth is used, are always encrypted. It would be a security flaw if these could be easily sniffed. The actual connection string might be available in a config file, perhaps in clear text. That is the first place I would look for your need. – Dan Guzman Apr 15 at 8:53

I am not really sure why you want to sniff connection string when you already know which server it is connecting to, on which port communication is happening. Possibly, you are not sure about the login id and password. You may check with your DBA and he/she would help you with the login id. In case, you are not sure about the password, you may get it reset if you are the owner of this application or you are the only user. If above option is not favorable, in case somebody else is using that account, you may get another login instead.

Typically connection string contains three parts - Server Name with instance name(if any), login name, password, port. if port is default(as mentioned), you don't need port in the connection string.

Please refer below links for more understanding:



I hope above helps.

  • The problem is the application not mine, they give me the application for report only. The server is not mine also. – Toi Lee Apr 17 at 2:34

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.