![]() |
|
Obtain the session windows username with PHP and other problem - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45) +--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449) +---- Forum: Beginner Hacking (https://hackforums.net/forumdisplay.php?fid=4) +---- Thread: Obtain the session windows username with PHP and other problem (/showthread.php?tid=5053257) |
Obtain the session windows username with PHP and other problem - FrenchDoxx - Nov 10, 2015 Hello, I had test my cookie stealer, I obtain : IP, Port, hostname (with ISP name), UserAgent but I want to got the session windows name, I tell about this example : [img]http://www.memoclic.com/medias/var/2009-15/ishot-0904101748301.jpg[/img] I found 3 php script : Code $username=shell_exec("echo %username%" ); echo ("username : $username" );?>Source : https://openclassrooms.com/forum/sujet/php-get-usernamesession-windows-nt-logon-57595 Or these : If by current windows user you mean the user running the script then that is set in an environment variable which you can get using: Code <?php echo getenv("username"); ?>If you want to get the home directory of the user running the script you should use<?php echo getenv("HOMEDRIVE") . getenv("HOMEPATH"); ?>This should output either C:\Users\Fred or C:\Documents and Settings\Fred depending on if you are using windows Vista/7 or windows XP. To see all of the environment variables you can do: Code <?php global $_ENV; var_dump($_ENV); ?>http://stackoverflow.com/questions/12754437/get-windows-username-of-current-user-using-php Which one is right ? Questions : on a cookie, I can see a username ? (Like his Facebook) I can use 2 scripts or more in the same time ? I want use 4 script I host on altervista and hostinger.fr |