Reveal saved passwords in Windows applications
Posted by Just little ol' me at Tuesday, March 11, 2008
I don't know about all of you, but I usually keep track of all my user/password information. How? Usually I save them in Firefox (web based accounts that is) and in Total Commander (ftp accounts). Dough, what did you think, that keep a diary of all my passwords? Dude, if you get to that point you just need to "format Internet:" and get a break!!!
So, people at Firefox (good Firefox, good :) ) imagined that people like me exist, so they added a *cool* feature to the Tools->Options->Security tab called "Show passwords". And it works great. Yeah, sure, if your desk neighbor gets 2 minutes to your PC, you can say "Bye-bye privacy". I just know that I work with great people in the office that would never ever try that...
Ok, that solves the "forgot password" for web accounts. But what about FTP accounts or any other password (remote desktop, etc.)?
Well, I found a cool and very easy to build tool that you just press a button and it shows you the password. Nice! Here is the link: http://www.rekenwonder.com/revealer.htm
The best part is that they also provide the source code which is just a couple of lines (see below). So, the next time you save your password, keep in mind that somebody might find it and expose all your pics and flicks to the community...
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam);
BOOL CALLBACK EnumWindowsProc2(HWND hwnd,LPARAM lParam);
LRESULT CALLBACK MainWndProc(HWND hWndMain,UINT Msg,
UINT wParam,LONG lParam)
{
switch(Msg) {
case WM_COMMAND:
if(HIWORD(wParam)==BN_CLICKED)
// call every main window
EnumWindows(EnumWindowsProc,0);
break;
case WM_DESTROY:
PostQuitMessage(0);
return 0L;
}
return DefWindowProc(hWndMain,Msg,wParam,lParam);
}
BOOL CALLBACK EnumWindowsProc(HWND hwnd,LPARAM lParam)
{
// call every child window (to find edit boxes)
EnumChildWindows(hwnd,EnumWindowsProc2,lParam);
return TRUE;
}
BOOL CALLBACK EnumWindowsProc2(HWND hwnd,LPARAM)
{
// reveal the password
::SendMessage(hwnd,EM_SETPASSWORDCHAR,0,0);
InvalidateRect(hwnd,NULL,FALSE);
return TRUE;
}
Labels: c++ source code , reveal lost password