利用img远程调用图片记录访问者浏览器信息操作系统等
判断操作系统我懒得写正则判断了大家直接根据浏览器信息就能知道了
http://localhost/test.php
$pass=admin 这个是查看信息的密码
http://www.zzzyk.com /test.php?pass=admin
就能查看密码了
$filePath=’./x.txt’; //信息保存地址
$image=’x.jpg’; //读取图片并输出的 各位自己选择图片
<?php
date_default_timezone_set('PRC');
$pass='admin';
$filePath='./x.txt'; //信息保存地址
$image='x.jpg'; //输出图片名称
if(@$_GET['pass']==$pass){
$pics=file($filePath);
for($i=0;$i< count($pics);$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.'<br />浏览器信息:'.$USER_AGENT.'<br />COOKIE:<br />';
writeto($filePath,$content);
foreach($_COOKIE as $key=>$value){
$content=$key.' = '.htmlspecialchars($value).'<br />';
writeto($filePath,$content);
}
writeto($filePath,'访问时间:'.$data.'<br />');
$pics=file($image);
for($i=0;$i< count($pics);$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;
}
?>
补充:Web开发 , php ,