Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Log in to server using current username/pwd

Reply
 
Old 08-13-2009   #1 (permalink)
Jake


 
 

Log in to server using current username/pwd

Hi,

In our former domain based system we used the subroutine below to map
network drives to local drive letters. Since the clients already were
logged on to the domain, the server never needed to request explicit
authentication.

However when using Home Edition clients the server obviously requests
username and password when clients want to access these drives.

But luckily in this case the username and password expected by the
server are the same as those the local user used to log on to the computer.

Could the sub below be modified to supply or copy the current local
username and password to the server while mapping the drive so the local
user is not requested to re-authenticate?

Thanks for comments on this

regards jake

Sub MapMyDrives(strDriveLetter, strPath, strDescription)
'Remove former login's drive letters
'Map drive to new letter...
'Set friendly name
If fso.driveexists(strDriveLetter) Then
nwo.RemoveNetworkDrive strDriveLetter, True, True
wscript.sleep 300
End If
nwo.MapNetworkDrive strDriveLetter, strPath
sao.NameSpace(strDriveLetter).Self.Name = strDescription
End Sub

My System SpecsSystem Spec
Old 08-13-2009   #2 (permalink)
Reventlov


 
 

Re: Log in to server using current username/pwd

Il giorno Thu, 13 Aug 2009 13:39:42 +0200, Jake <jake44@xxxxxx> ha scritto:
Quote:

>Could the sub below be modified to supply or copy the current local
>username and password to the server while mapping the drive so the local
>user is not requested to re-authenticate?
AFAIK, you can get the name of the current user, but not his password.

--
Giovanni Cenati (Bergamo, Italy)
Write to "Reventlov" at katamail com
http://digilander.libero.it/Cenati (Esempi e programmi in VbScript)
--
My System SpecsSystem Spec
Old 08-13-2009   #3 (permalink)
Pegasus [MVP]


 
 

Re: Log in to server using current username/pwd


"Jake" <jake44@xxxxxx> wrote in message
news:OXF8ArAHKHA.4024@xxxxxx
Quote:

> Hi,
>
> In our former domain based system we used the subroutine below to map
> network drives to local drive letters. Since the clients already were
> logged on to the domain, the server never needed to request explicit
> authentication.
>
> However when using Home Edition clients the server obviously requests
> username and password when clients want to access these drives.
>
> But luckily in this case the username and password expected by the server
> are the same as those the local user used to log on to the computer.
>
> Could the sub below be modified to supply or copy the current local
> username and password to the server while mapping the drive so the local
> user is not requested to re-authenticate?
>
> Thanks for comments on this
>
> regards jake
>
> Sub MapMyDrives(strDriveLetter, strPath, strDescription)
> 'Remove former login's drive letters
> 'Map drive to new letter...
> 'Set friendly name
> If fso.driveexists(strDriveLetter) Then
> nwo.RemoveNetworkDrive strDriveLetter, True, True
> wscript.sleep 300
> End If
> nwo.MapNetworkDrive strDriveLetter, strPath
> sao.NameSpace(strDriveLetter).Self.Name = strDescription
> End Sub
As Reventlov said, you cannot extract passwords. If you could then this
would be a gross breach of password security. You could create domain
accounts/passwords that are identical to local accounts/passwords. This
would get around the password prompt but it would create a nightmare when
your users change their passwords.

In a domain environment you should use WinXP Professional clients. Using
WinXP Home clients is unproductive.


My System SpecsSystem Spec
Old 08-14-2009   #4 (permalink)
Jake


 
 

Re: Log in to server using current username/pwd

Pegasus [MVP] wrote:
Quote:

> As Reventlov said, you cannot extract passwords. If you could then this
> would be a gross breach of password security.
Of course I know that, but I would just check if there was a way for
windows to secretly forwarding the current user's auth data without
revealing the password openly.
Quote:

> You could create domain
> accounts/passwords that are identical to local accounts/passwords. This
> would get around the password prompt but it would create a nightmare when
> your users change their passwords.
OK, great, so matching usernames / passwords for a domain account will
allow a workgroup computer to use resources on the server. That would
be fine, because the users are not allowed to change their passwords
(which are kept synced with their LMS software).
Quote:

> In a domain environment you should use WinXP Professional clients. Using
> WinXP Home clients is unproductive.
>
Of course, if you go and convince Bill that he should allow selling
netbooks with XP Pro preinstalled that would definitely be our first
choice, but apparently Microsoft doesn't allow that.

regards

jake
My System SpecsSystem Spec
Old 08-14-2009   #5 (permalink)
Al Dunbar


 
 

Re: Log in to server using current username/pwd


"Jake" <jake44@xxxxxx> wrote in message
news:#7YUyFLHKHA.3000@xxxxxx
Quote:

> Pegasus [MVP] wrote:
>
Quote:

>> As Reventlov said, you cannot extract passwords. If you could then this
>> would be a gross breach of password security.
>
> Of course I know that, but I would just check if there was a way for
> windows to secretly forwarding the current user's auth data without
> revealing the password openly.
I do not think that that is possible. Windows does not walk around with a
copy of your password in its back pocket - basically, it does not know what
your password is. When you logon, the password is not compared with the one
stored in the SAM database, because the password is not stored there. A
one-way hash of the password is stored that is based, in part, on the date
when the password was last changed. When you enter your password at logon,
what you enter is hashed in the same way and the result compared with the
stored value. If they are the same then you just logged on with your
currently valid password, which is promptly forgotten (i.e. obliterated from
memory or anywhere else where it might otherwise hang around).

We all think of other humans as being the entities that will use our
credentials without our permission. But software, including the O/S, is also
a potential threat. I'm not saying that Windows itself wants to abuse our
credentials, just that, if it knew the password, it is concerned that
someone might find a way to extract it.

Of course, one way to accomplish what you want is to logon using a computer
that is a member of the domain and a domain account. In that circumstance, a
token is created for the session that encapsulates your group membership.
The file system, for example, uses this token to determine your access
rights instead of processing your group membership each time you try to
access a resource.
Quote:
Quote:

>> You could create domain accounts/passwords that are identical to local
>> accounts/passwords. This would get around the password prompt but it
>> would create a nightmare when your users change their passwords.
>
> OK, great, so matching usernames / passwords for a domain account will
> allow a workgroup computer to use resources on the server. That would be
> fine, because the users are not allowed to change their passwords (which
> are kept synced with their LMS software).
Personally, I don't find that a very manageable solution, even if passwords
cannot change...
Quote:
Quote:

>> In a domain environment you should use WinXP Professional clients. Using
>> WinXP Home clients is unproductive.
> Of course, if you go and convince Bill that he should allow selling
> netbooks with XP Pro preinstalled that would definitely be our first
> choice, but apparently Microsoft doesn't allow that.
I haven't looked into that, but have you looked into the possibility of an
upgrade license?

/Al


My System SpecsSystem Spec
Old 08-15-2009   #6 (permalink)
Stefan Kanthak


 
 

Re: Log in to server using current username/pwd

"Al Dunbar" <alandrub@xxxxxx> wrote:
Quote:

>
> "Jake" <jake44@xxxxxx> wrote in message
> news:#7YUyFLHKHA.3000@xxxxxx
Quote:

>> Pegasus [MVP] wrote:
>>
Quote:

>>> As Reventlov said, you cannot extract passwords. If you could then this
>>> would be a gross breach of password security.
>>
>> Of course I know that, but I would just check if there was a way for
>> windows to secretly forwarding the current user's auth data without
>> revealing the password openly.
>
> I do not think that that is possible. Windows does not walk around with a
> copy of your password in its back pocket -
Go inform yourself about credential reflection/playback!
MSFT published another patch for such a problem just this tuesday.-(

Stefan

My System SpecsSystem Spec
Old 08-15-2009   #7 (permalink)
Al Dunbar


 
 

Re: Log in to server using current username/pwd


"Stefan Kanthak" <postmaster@[127.0.0.1]> wrote in message
news:uV0eZIdHKHA.1248@xxxxxx
Quote:

> "Al Dunbar" <alandrub@xxxxxx> wrote:
Quote:

>>
>> "Jake" <jake44@xxxxxx> wrote in message
>> news:#7YUyFLHKHA.3000@xxxxxx
Quote:

>>> Pegasus [MVP] wrote:
>>>
>>>> As Reventlov said, you cannot extract passwords. If you could then this
>>>> would be a gross breach of password security.
>>>
>>> Of course I know that, but I would just check if there was a way for
>>> windows to secretly forwarding the current user's auth data without
>>> revealing the password openly.
>>
>> I do not think that that is possible. Windows does not walk around with a
>> copy of your password in its back pocket -
>
> Go inform yourself about credential reflection/playback!
> MSFT published another patch for such a problem just this tuesday.-(
Thanks for the hint.

While I have not yet fully understood the mechanism, in the context of this
thread the effect is the same as if no such vulnerability existed. If one
actually *could* figure out how to leverage this "feature" to get windows
"to secretly forward the current user's auth data..." for some valid
purpose, the method would stop working as soon as the countervailing patch
was released.

I will rephrase what I said above: "Windows should not be walking around
with a copy of your password in its back pocket".

If Windows does not provide a capability to do what the OP wants, leveraging
a vulnerability to accomplish this does not seem a sensible approach.


All that said, I do not see where "using the victim's credentials" means
that the actual password was revealed, which would imply that Windows did
keep a copy in its back pocket. Lots of attacks use the victim's credentials
without ever finding out what the password is.


/Al


My System SpecsSystem Spec
Old 08-16-2009   #8 (permalink)
Stefan Kanthak


 
 

Re: Log in to server using current username/pwd

"Al Dunbar" <alandrub@xxxxxx> wrote:
Quote:

>
> "Stefan Kanthak" <postmaster@[127.0.0.1]> wrote in message
> news:uV0eZIdHKHA.1248@xxxxxx
Quote:

>> "Al Dunbar" <alandrub@xxxxxx> wrote:
Quote:

>>>
>>> "Jake" <jake44@xxxxxx> wrote in message
>>> news:#7YUyFLHKHA.3000@xxxxxx
>>>> Pegasus [MVP] wrote:
>>>>
>>>>> As Reventlov said, you cannot extract passwords. If you could then this
>>>>> would be a gross breach of password security.
>>>>
>>>> Of course I know that, but I would just check if there was a way for
>>>> windows to secretly forwarding the current user's auth data without
>>>> revealing the password openly.
>>>
>>> I do not think that that is possible. Windows does not walk around with a
>>> copy of your password in its back pocket -
>>
>> Go inform yourself about credential reflection/playback!
>> MSFT published another patch for such a problem just this tuesday.-(
>
> Thanks for the hint.
De nada.
Quote:

> While I have not yet fully understood the mechanism, in the context of this
> thread the effect is the same as if no such vulnerability existed. If one
> actually *could* figure out how to leverage this "feature" to get windows
> "to secretly forward the current user's auth data..." for some valid
> purpose, the method would stop working as soon as the countervailing patch
> was released.
Actually it's NO vulnerability, it's just "sending out the current user's
authentification".
Since the beginning of DOS' (and Windows') networking the user logs on to
the client which caches the authentication. When the client connects to
"the network" this cached authentication is sent to the target (nowadays
after negotiation of the authentication protocol to use it's most often
a challenge-response proof that the client has the right authentification)
without further notice to the user! If the target but requests cleartext
authentication and the client accepts that then username/password may be
transmitted in clear!

As practical example use the Internet Explorer in your intranet where it
uses the current windows user login to authenticate to web servers. Now
setup your own web server and request basic auth...
Quote:

> I will rephrase what I said above: "Windows should not be walking around
> with a copy of your password in its back pocket".
But it does! Yes, you can configure it to never send cleartext (or near
cleartext, i.e. replayable) authentication data, but have you done so?
Quote:

> If Windows does not provide a capability to do what the OP wants, leveraging
> a vulnerability to accomplish this does not seem a sensible approach.
>
>
> All that said, I do not see where "using the victim's credentials" means
> that the actual password was revealed, which would imply that Windows did
> keep a copy in its back pocket. Lots of attacks use the victim's credentials
> without ever finding out what the password is.
It doesn't matter whether you have the real password or derived credentials
when you can use these credentials to authenticate.

Stefan

My System SpecsSystem Spec
Old 08-16-2009   #9 (permalink)
Al Dunbar


 
 

Re: Log in to server using current username/pwd


"Stefan Kanthak" <postmaster@[127.0.0.1]> wrote in message
news:#ElD2gnHKHA.4376@xxxxxx
Quote:

> "Al Dunbar" <alandrub@xxxxxx> wrote:
Quote:

>>
>> "Stefan Kanthak" <postmaster@[127.0.0.1]> wrote in message
>> news:uV0eZIdHKHA.1248@xxxxxx
Quote:

>>> "Al Dunbar" <alandrub@xxxxxx> wrote:
>>>>
>>>> "Jake" <jake44@xxxxxx> wrote in message
>>>> news:#7YUyFLHKHA.3000@xxxxxx
>>>>> Pegasus [MVP] wrote:
>>>>>
>>>>>> As Reventlov said, you cannot extract passwords. If you could then
>>>>>> this
>>>>>> would be a gross breach of password security.
>>>>>
>>>>> Of course I know that, but I would just check if there was a way for
>>>>> windows to secretly forwarding the current user's auth data without
>>>>> revealing the password openly.
>>>>
>>>> I do not think that that is possible. Windows does not walk around with
>>>> a
>>>> copy of your password in its back pocket -
>>>
>>> Go inform yourself about credential reflection/playback!
>>> MSFT published another patch for such a problem just this tuesday.-(
>>
>> Thanks for the hint.
>
> De nada.
>
Quote:

>> While I have not yet fully understood the mechanism, in the context of
>> this
>> thread the effect is the same as if no such vulnerability existed. If one
>> actually *could* figure out how to leverage this "feature" to get windows
>> "to secretly forward the current user's auth data..." for some valid
>> purpose, the method would stop working as soon as the countervailing
>> patch
>> was released.
>
> Actually it's NO vulnerability, it's just "sending out the current user's
> authentification".
> Since the beginning of DOS' (and Windows') networking the user logs on to
> the client which caches the authentication. When the client connects to
> "the network" this cached authentication is sent to the target (nowadays
> after negotiation of the authentication protocol to use it's most often
> a challenge-response proof that the client has the right authentification)
> without further notice to the user!
Perfectly OK, imho, as I assume that the "cached authentication" cannot
generally be used outside of the context of the user session that cached the
authentication...
Quote:

> If the target but requests cleartext
> authentication and the client accepts that then username/password may be
> transmitted in clear!
May, or will? I had thought that the cached authentication did not include a
copy of the text of the password. Do you have a reference to where it is
explained that it does?
Quote:

> As practical example use the Internet Explorer in your intranet where it
> uses the current windows user login to authenticate to web servers. Now
> setup your own web server and request basic auth...
>
Quote:

>> I will rephrase what I said above: "Windows should not be walking around
>> with a copy of your password in its back pocket".
>
> But it does! Yes, you can configure it to never send cleartext (or near
> cleartext, i.e. replayable) authentication data, but have you done so?
Not sure, as the client configuration at work is not something I can change.
Quote:
Quote:

>> If Windows does not provide a capability to do what the OP wants,
>> leveraging
>> a vulnerability to accomplish this does not seem a sensible approach.
>>
>>
>> All that said, I do not see where "using the victim's credentials" means
>> that the actual password was revealed, which would imply that Windows did
>> keep a copy in its back pocket. Lots of attacks use the victim's
>> credentials
>> without ever finding out what the password is.
>
> It doesn't matter whether you have the real password or derived
> credentials
> when you can use these credentials to authenticate.
I agree. So why have you not answered the OP's question about how to
actually do this: "Of course I know that, but I would just check if there
was a way for windows to secretly forwarding the current user's auth data
without revealing the password openly."

/Al




My System SpecsSystem Spec
Old 08-17-2009   #10 (permalink)
James


 
 

Re: Log in to server using current username/pwd

Maybe common sense does not prevail here. But doesn't the password (even if
its is encrypted) have to be stored on the machine somewhere? Isn't that
the only way a match can be made? How else can it make a match to what you
input?


"Al Dunbar" <alandrub@xxxxxx> wrote in message
news:OBH8xMpHKHA.4168@xxxxxx
Quote:

>
> "Stefan Kanthak" <postmaster@[127.0.0.1]> wrote in message
> news:#ElD2gnHKHA.4376@xxxxxx
Quote:

>> "Al Dunbar" <alandrub@xxxxxx> wrote:
Quote:

>>>
>>> "Stefan Kanthak" <postmaster@[127.0.0.1]> wrote in message
>>> news:uV0eZIdHKHA.1248@xxxxxx
>>>> "Al Dunbar" <alandrub@xxxxxx> wrote:
>>>>>
>>>>> "Jake" <jake44@xxxxxx> wrote in message
>>>>> news:#7YUyFLHKHA.3000@xxxxxx
>>>>>> Pegasus [MVP] wrote:
>>>>>>
>>>>>>> As Reventlov said, you cannot extract passwords. If you could then
>>>>>>> this
>>>>>>> would be a gross breach of password security.
>>>>>>
>>>>>> Of course I know that, but I would just check if there was a way for
>>>>>> windows to secretly forwarding the current user's auth data without
>>>>>> revealing the password openly.
>>>>>
>>>>> I do not think that that is possible. Windows does not walk around
>>>>> with a
>>>>> copy of your password in its back pocket -
>>>>
>>>> Go inform yourself about credential reflection/playback!
>>>> MSFT published another patch for such a problem just this tuesday.-(
>>>
>>> Thanks for the hint.
>>
>> De nada.
>>
Quote:

>>> While I have not yet fully understood the mechanism, in the context of
>>> this
>>> thread the effect is the same as if no such vulnerability existed. If
>>> one
>>> actually *could* figure out how to leverage this "feature" to get
>>> windows
>>> "to secretly forward the current user's auth data..." for some valid
>>> purpose, the method would stop working as soon as the countervailing
>>> patch
>>> was released.
>>
>> Actually it's NO vulnerability, it's just "sending out the current user's
>> authentification".
>> Since the beginning of DOS' (and Windows') networking the user logs on to
>> the client which caches the authentication. When the client connects to
>> "the network" this cached authentication is sent to the target (nowadays
>> after negotiation of the authentication protocol to use it's most often
>> a challenge-response proof that the client has the right
>> authentification)
>> without further notice to the user!
>
> Perfectly OK, imho, as I assume that the "cached authentication" cannot
> generally be used outside of the context of the user session that cached
> the authentication...
>
Quote:

>> If the target but requests cleartext
>> authentication and the client accepts that then username/password may be
>> transmitted in clear!
>
> May, or will? I had thought that the cached authentication did not include
> a copy of the text of the password. Do you have a reference to where it is
> explained that it does?
>
Quote:

>> As practical example use the Internet Explorer in your intranet where it
>> uses the current windows user login to authenticate to web servers. Now
>> setup your own web server and request basic auth...
>>
Quote:

>>> I will rephrase what I said above: "Windows should not be walking around
>>> with a copy of your password in its back pocket".
>>
>> But it does! Yes, you can configure it to never send cleartext (or near
>> cleartext, i.e. replayable) authentication data, but have you done so?
>
> Not sure, as the client configuration at work is not something I can
> change.
>
Quote:
Quote:

>>> If Windows does not provide a capability to do what the OP wants,
>>> leveraging
>>> a vulnerability to accomplish this does not seem a sensible approach.
>>>
>>>
>>> All that said, I do not see where "using the victim's credentials" means
>>> that the actual password was revealed, which would imply that Windows
>>> did
>>> keep a copy in its back pocket. Lots of attacks use the victim's
>>> credentials
>>> without ever finding out what the password is.
>>
>> It doesn't matter whether you have the real password or derived
>> credentials
>> when you can use these credentials to authenticate.
>
> I agree. So why have you not answered the OP's question about how to
> actually do this: "Of course I know that, but I would just check if there
> was a way for windows to secretly forwarding the current user's auth data
> without revealing the password openly."
>
> /Al
>
>
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Get Current Terminal Server Session ID? (Sooo Frustrating) VB Script
Cannot change my server o.0 (username and password help) Vista mail
how do I keep powershells current directory and dotnets current directory in sync PowerShell
Vista VPN server hanging on Verifying Username and Password..help. Vista General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46