Get windows user password in a Windows Forms application

不羁的心 提交于 2020-02-07 05:18:05

问题


I need to get the password from the user that is logged on on Windows. I need this information as string for a Windows Forms application. is there any way of doing that with LDAP, SSO, external dll or similar? Thanks a lot!


回答1:


Windows does not store the password as plain text. The password is stored hashed with NTLMv2 and therefor highly encrypted. It is not possible to reverse engineer that password or get it.

As Lucax said it would be a huge security issue if every program could read the password because it would enable every application (also viruses or trojans) to read the passwords of every user.




回答2:


You can ask the user. If you have a legitimate use, they'll surely comply.

That's about the only way, unless you try digging into security leaks in the system and its applications. For the most part, passwords are stored in an irreversible format, so the only point when they actually exist in memory is when the user is typing them in.

You can authenticate as the user, under certain circumstances - which may be quite enough to achieve what you're trying to do. However, there's little point going deeper into these when we don't know what you're actually trying to do.



来源:https://stackoverflow.com/questions/50527810/get-windows-user-password-in-a-windows-forms-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!