Home  >  Article  >  php教程  >  利用img远程调用图片记录访问者浏览器信息操作系统等

利用img远程调用图片记录访问者浏览器信息操作系统等

WBOY
WBOYOriginal
2016-06-13 10:48:16766browse


判断操作系统我懒得写正则判断了大家直接根据浏览器信息就能知道了
 
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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:PHP获得客户端IPNext article:php 解析符