How to retrieve windows logged on username?
Moderator: General Moderators
-
b0necrack3r
- Forum Newbie
- Posts: 4
- Joined: Sat Sep 02, 2006 6:33 pm
How to retrieve windows logged on username?
Hello.
I ma fighting with one problem for about 2 weeks and cannot find any solvation.
I build a site which gonna run in a private ,domain based network, and I need a script in php which will retrieve the username of the corrent logged on to windows user.
Hope that you can help.
Thank you, sasha.
I ma fighting with one problem for about 2 weeks and cannot find any solvation.
I build a site which gonna run in a private ,domain based network, and I need a script in php which will retrieve the username of the corrent logged on to windows user.
Hope that you can help.
Thank you, sasha.
- ambivalent
- Forum Contributor
- Posts: 173
- Joined: Thu Apr 14, 2005 8:58 pm
- Location: Toronto, ON
exec() + psloggedon from sysinternals can do that for you. This assumes that all of the systems on your private network are running Windows since *nix systems don't use that naming convention. You also need the Remote Registry service running on the client machine. While this works well in an intranet environment where one has control over machines and browsers, it probably won't be reliable if the client machines on your private network are not under the direct control/administration of your company.
-
b0necrack3r
- Forum Newbie
- Posts: 4
- Joined: Sat Sep 02, 2006 6:33 pm
must me some easier way!
can I somehow run msdos commands on the remote pc, so I can run 'nbtstat -a' and retrieve the username?
thnx.
thnx.
-
b0necrack3r
- Forum Newbie
- Posts: 4
- Joined: Sat Sep 02, 2006 6:33 pm
-
b0necrack3r
- Forum Newbie
- Posts: 4
- Joined: Sat Sep 02, 2006 6:33 pm
Yes, there are ...more or less.
volka wrote:If not configured otherwise the internet explorer (afaik no other browser) sends such an ntlm authentication without asking the user.
http://support.microsoft.com/kb/158229/ wrote:Unlike Basic authentication, NTLM authentication does not prompt users for their user name and password by default. The current Windows user account on the client machine is used for the NTLM authentication. Then, if this fails, it will prompt the user for the username and password to be used. If NTLM authentication succeeds, the requested application or resource is executed in the context of the specified user.
sweatje wrote:but when I did ASP pages, you could just force directory authentication, and then use Request.ServerVariables("AUTH_USER")