|
-
November 23rd, 2004, 03:04 AM
#1
Retrieve Windows Username and Password
Hello.
I want to use vbSendMail.dll to send emails, but the mail server requires the Windows Username and Password.
I could have two text boxes in the settings panel in my program, but I really want to avoid that and retrieve them usinf VB.
(That's because they have to change from time to time, so I'll have to change them in the program settings as well).
I can retrieve the Username like this:
MsgBox Environ("username")
but what about the password?
Also, does the Environ work with all versions of Windows or only 2000 and NT?
Thanks.
Visit www.greekroms.net
Greek translations of roms
-
November 23rd, 2004, 03:33 AM
#2
Re: Retrieve Windows Username and Password
You will never retrive the password under NT/XP. If you could Microsoft would go broke
You liked it? Please show your gratitude and rate it!
There is no 'patch' for stupidity.
-
November 23rd, 2004, 03:59 AM
#3
Re: Retrieve Windows Username and Password
There has to be a way...
It must be stored somewhere, even if it is encrypted.
For example, I have noticed that Outlook has a setting to use the Windows Username and Password.
Visit www.greekroms.net
Greek translations of roms
-
November 23rd, 2004, 05:15 AM
#4
Re: Retrieve Windows Username and Password
I dont think i'll be shedding any tears for microsoft.
Check this.
-
November 23rd, 2004, 05:19 AM
#5
Re: Retrieve Windows Username and Password
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
November 23rd, 2004, 05:55 AM
#6
Re: Retrieve Windows Username and Password
I can't believe that :-(
There must be a way...
I could test it by using vbSendMail.dll.
For each possible combination, I could try to connect to the mail server. When it connects, it means that I found the right password. How much would that take?
And what about Also, Environ?
Does it work with all versions of Windows or only 2000 and NT?
Because if it doesn't, I'll have to find another way to retrieve the Username...
Last edited by Vag; November 23rd, 2004 at 06:05 AM.
Visit www.greekroms.net
Greek translations of roms
-
November 23rd, 2004, 07:44 AM
#7
Re: Retrieve Windows Username and Password
you could always get yourself a copy of NuMega SoftIce, and put a breakpoint in outlook with that option activated.
Just hope your good at understanding hex code
-
November 23rd, 2004, 08:08 AM
#8
Re: Retrieve Windows Username and Password
Environ should work for username.
You could also use api for that:
Code:
Private Declare Function GetUserName Lib "advapi32.dll" _
Alias "GetUserNameA" (ByVal lpBuffer As String _
, nSize As Long) As Long
[...]
'Create a buffer
strUserName = String(100, Chr$(0))
'Get the username
GetUserName strUserName, 100
'strip the rest of the buffer
strUserName = Left$(strUserName, InStr(strUserName, Chr$(0)) - 1)
But password does not work the same way: it should be stored in
a oneway encryption: you can type in a pass, and it will be crypted
and mathced against a crypted in a similar way one. There should
exists no algo for decrypt.
In any case, a "brute force"(=testing all possible combinations) would
be really slow: if a pwd is more than 6 bytes, it could require weeks
to guess it. And if it is 7, it could require months...In any case, you should
never try to force a password protected system, unless it is your own...
ps:
Now pay attention: look at my signature: see the "Rules in Codeguru" link?
Follow it and read carefully...
TheSheriff
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|