> php教程 > php手册 > 본문

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

WBOY
풀어 주다: 2016-06-13 10:48:16
원래의
772명이 탐색했습니다.


判断操作系统我懒得写正则判断了大家直接根据浏览器信息就能知道了
 
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.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 추천
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!