Jump to content

Not a question. Just some help regarding finding out which user runs your web...


jonsjava

Recommended Posts

....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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.