jonsjava Posted May 9, 2008 Share Posted May 9, 2008 ....scripts: This code will tell you who runs your web scripts. (more useful than most would think). I wrote it for an open-source app that I write, and I decided someone might find this to be of use. <?php $iam = exec("whoami"); if ($iam == ""){ print "you are on a windows machine!"; print "<br /> Try installing <a href='http://www.microsoft.com/downloads/details.aspx?familyid=3E89879D-6C0B-4F92-96C4-1016C187D429&displaylang=en'>Windows 2000 Resource Kit Tool: Whoami.exe</a>"; print "<br /> (hint) after downloading and installing, go to c:\\Program Files\\Resourcekit\\ and copy WHOAMI.EXE to c:\\Windows\\System32)"; exit(); } else{ if (strstr($iam, "\\")){ $name_array = explode("\\", $iam); $name = $name_array[1]; print "the domain that you are attached to: ".$name_array[0]; print "\n<br /> your username: $name"; exit(); } else{ print "the user who handles all your web scripts is: ".$iam; exit(); } } ?> Link to comment https://forums.phpfreaks.com/topic/104854-not-a-question-just-some-help-regarding-finding-out-which-user-runs-your-web/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.